Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: simple SQL query ...


Message #1 by "Ken Schaefer" <ken@a...> on Fri, 8 Mar 2002 19:00:38 +1100
final = tocnt - a



Next time, please post the error message and code you are receiving.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Handy" <handymulia@h...>

Subject: [asp_databases] simple SQL query ...





: Hi guys, I need help with this

:

: Set temprec=conn.execute("SELECT stock FROM Product where name = 'asd' ")

:     totcnt = temprec("stock")       'no syntax error here'

:          a = CInt(qty)              'no syntax error here'

:     final = "&  totcnt - a  &"      'no syntax error here'

:

:

:

: conn.Execute("Update Product Set stock = "&final&"' where name = 'asd' ")

:

: The program needs to do substraction  -->  totcnt - a

: and I have checked that there is no syntax error until before the

: execution of SQL query.

:

: The error is here  ==>  Set stock = "& final &"



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #2 by "Drew, Ron" <RDrew@B...> on Fri, 8 Mar 2002 14:37:51 -0500
Too many single quotes..

conn.Execute("Update Product Set stock =3D " & final & " where name =3D

'asd' ")



-----Original Message-----

From: Handy [mailto:handymulia@h...]

Sent: Friday, March 08, 2002 1:46 AM

To: ASP Databases

Subject: [asp_databases] simple SQL query ...





Hi guys, I need help with this :





Set temprec=3Dconn.execute("SELECT stock FROM Product where name =3D 

'asd'

")

    totcnt =3D temprec("stock")       'no syntax error here'

         a =3D CInt(qty)              'no syntax error here'

    final =3D "&  totcnt - a  &"      'no syntax error here'



           



conn.Execute("Update Product Set stock =3D "&final&"' where name =3D 

'asd'

")







The program needs to do substraction  -->  totcnt - a

and I have checked that there is no syntax error until before the

execution of SQL query.



The error is here  =3D=3D>  Set stock =3D "& final &"





Does anybody know how to solve it ?





Thanks alot !






$subst('Email.Unsub').

Message #3 by "Handy" <handymulia@h...> on Fri, 8 Mar 2002 06:45:46
Hi guys, I need help with this :





Set temprec=conn.execute("SELECT stock FROM Product where name = 'asd' ") 

    totcnt = temprec("stock")       'no syntax error here'

         a = CInt(qty)              'no syntax error here'

    final = "&  totcnt - a  &"      'no syntax error here'



            



conn.Execute("Update Product Set stock = "&final&"' where name = 'asd' ")







The program needs to do substraction  -->  totcnt - a

and I have checked that there is no syntax error until before the 

execution of SQL query.



The error is here  ==>  Set stock = "& final &"





Does anybody know how to solve it ?





Thanks alot !


  Return to Index