Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > conditional sql statements

Reply
Thread Tools

conditional sql statements

 
 
Bill
Guest
Posts: n/a
 
      08-29-2003
I have a shopping cart that I want to load items in that come from a
huge scrolling form. In other words, when someone clicks on a category
in our site, it scrolls out all the items in that category, maybe 30
or more. I have text boxes next to each item so somone can enter a
number, then press submit form button at the bottom of the form, and
send those slections to the shopping cart.

The problem is, many of the text boxes are empty, yet they are still
being sent to the shopping cart as a quatity of 0. Is there a way for
sql to ignore a value if the variable is zero, or only get the sql
statement to run if a variable is > 0?

Thanks,

Bill
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      08-29-2003
Post your code. [empty] <> 0 unless you cint() it, or unless in your DB,
you have a default value of 0. I don't know how your building your query,
but it sounds like you may want to change it so that it only inserts values
for columns that values were sent for from your form.

Ray at work

"Bill" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I have a shopping cart that I want to load items in that come from a
> huge scrolling form. In other words, when someone clicks on a category
> in our site, it scrolls out all the items in that category, maybe 30
> or more. I have text boxes next to each item so somone can enter a
> number, then press submit form button at the bottom of the form, and
> send those slections to the shopping cart.
>
> The problem is, many of the text boxes are empty, yet they are still
> being sent to the shopping cart as a quatity of 0. Is there a way for
> sql to ignore a value if the variable is zero, or only get the sql
> statement to run if a variable is > 0?
>
> Thanks,
>
> Bill



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements and case statements questions John Crichton Ruby 6 07-12-2010 06:17 PM
Prepare Statements VS Statements Vince Java 12 01-21-2008 01:18 PM
component statements within architecture statements Neil Zanella VHDL 8 10-20-2006 09:05 AM
send batch of sql statements to sql server JT ASP General 1 09-27-2005 10:07 PM
if statements with or w/o else statements Harry George Python 6 02-23-2004 06:48 PM



Advertisments