OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

What if I don' t want a default value in the update statement?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> What if I don' t want a default value in the update statement?
Page: [1]
 
porsche944

 

Posts: 366
Joined: 3/6/2002
From: Regina Canada
Status: offline

 
What if I don' t want a default value in the update sta... - 8/10/2002 17:57:12   
I made an update statment for 10 fields. But not all of them are filled in all of the time. When some fields are blank, I don' t want the default value tossed in there like ti is. i f I don' t have a default value, i get an error.

What do i do?
Spooky

 

Posts: 26680
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/10/2002 18:01:48   
ASP or DRW?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to porsche944)
KeithG

 

Posts: 92
From: Irving TX Irving, Texas, USA
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/10/2002 18:09:34   
Sometimes that can be eliminated (in access db) by changing the " allow zero length" field propery (in design view) to " yes" . That way you would not have to send the default value.....

Keith

< Message edited by KeithG -- 8/9/2002 6:11:34 PM >

(in reply to porsche944)
porsche944

 

Posts: 366
Joined: 3/6/2002
From: Regina Canada
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/10/2002 18:57:45   
Spooky: i am using the DRW (on diet).

Keith: I have alreday have it det to allow zero legnth strings.
Anything else?

(in reply to porsche944)
KeithG

 

Posts: 92
From: Irving TX Irving, Texas, USA
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/10/2002 19:09:52   
You should be able to use a custom query in the DRW (step 2), put your code in there like

UPDATE Customers SET ContactFirstName=' ::ContactFirstName::' ,ContactMiddleName=' ::ContactMiddleName::' ,ContactLastName=' ::ContactLastName::' WHERE CustomerID=::CustomerID::

and if someone leaves the middle name blank in the form it should update the record alright. Maybe the field names are mispelled or maybe without using " customer query" in the DRW it causes problems? Just a thought.

Keith

(in reply to porsche944)
Spooky

 

Posts: 26680
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/10/2002 19:15:19   
The reason I ask, is that it tends to be easier to conditionally construct a SQL string based on user input

eg

If trim(request.form(input)) <> " "  then
  sql = sql & " , ContactFirstName=' ::ContactFirstName::' , " 
End if


Are you concerned it will overwrite existing information?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to porsche944)
porsche944

 

Posts: 366
Joined: 3/6/2002
From: Regina Canada
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/13/2002 1:29:15   
But i am being asked for default values for those fields. Using the drw at step 3 after the sql is in place. If i don' t set the default values i get an error when i try to update the record..saying one or more default values were empty.

(in reply to porsche944)
Spooky

 

Posts: 26680
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/13/2002 1:49:49   
You have to provide a value when using the DRW.
Parts of the SQL statement can be removed if using the diet.
Do you have an example SQL statement?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to porsche944)
KeithG

 

Posts: 92
From: Irving TX Irving, Texas, USA
Status: offline

 
RE: What if I don' t want a default value in the update... - 8/13/2002 9:53:58   
Porsche944,

I never put default values in that step but if you look at the underlying code produced FP automatically uses the field names used as the default. That said, I suspect that your problem may be in either a misspelled field name in the query, the default value if you are typeing them, or one of them does not match exactly the field name being sent from page 1. In my experience it is almost always a typo on my part. Just a thought.

Keith

(in reply to porsche944)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> What if I don' t want a default value in the update statement?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts