Heaven's Martini.....

Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Heaven's Martini.....

  1. #1
    Cindy Guest

    Default Heaven's Martini.....

    hi again... about the trgeers or default u were telling me... how do i go about doing that in sql?<BR><BR>if i use default... what do i put as the value? and how do i relate that to my table?<BR><BR>what is a stored procedure? can i use that as well?<BR><BR>i&#039;m not very good with databases... need help here!! thank u

  2. #2
    Cindy Guest

    Default Anyone? ... helpppp

    what do i need to do to automatically set the field total = price * quantity in my table?<BR><BR>using sql server7 ....

  3. #3
    Join Date
    Dec 1969

    Default Show your ....

    your current code for updating the fields.

  4. #4
    Join Date
    Dec 1969

    Default More info...

    Where are price and quantity coming from? Do you have them as ASP variables, or are they fields in your database, or what?

  5. #5
    Cindy Guest

    Default errrr....

    i have a table with 4 fields: itemID, price, quantity and total<BR>well, the price and quantity is pre defined.. and itemID is autogenerate. So that leaves the total field blank...<BR><BR>how do i fill up the total field?<BR><BR>when u ask about the update code... i guess i would user select (quantity * price) as total From table<BR><BR>so does that mean that i will have to create a form to update this table?

  6. #6
    Heaven's Martini Guest

    Default RE: Anyone? ... helpppp

    Hmm.<BR><BR><BR>it looks like a trigger is the simplest way.<BR><BR>if you right click when in the Open table part of sql server, <BR>in the tasks menu, you can write a trigger.<BR>for insert/update<BR><BR>the simplest method would be to insert it when you insert your data however. Insert into blah(num,quan,total) <BR> Values ("& mynum &","& myquan &","& mynum * myquan &")<BR>(or something like that)

  7. #7
    Heaven's Martini Guest

    Default I guess I don't make sense.

    umm.<BR><BR>this could be better.<BR>i think we need to know more info about the process you are going through, and then i can help more.

  8. #8
    Cindy Guest

    Default RE: More info...

    well the price and quantity comes from the fields in the table.<BR>so that leaves the field &#039;total&#039; empty. how do i fill this field with a value that is = price * quantity?<BR><BR>do i do it with asp or do i set it in sql? hmmm....<BR><BR>price and quantity is pre defined

  9. #9
    Hi-Tek Redneck Guest

    Default RE: errrr....

    is this a one time deal?<BR><BR>or this an ever changing process?<BR><BR>

  10. #10
    Cindy Guest

    Default here we go...

    ok, i&#039;m working on a simple shopping cart kinda thing. when user add an item to the cart, it is added into the Cart table.<BR>Cart table has 4 fields itemID, Price, Quantity, Total. So when item is added, only the itemID, Price and Quantity is stored. Therefore, i wanna know how to actually fill up the Total field... do i make sense? ....hmm.. should this be done during the add item or do i do it in the database itself?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts