Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using ? mark in a parameterized statement
Message
From
08/08/2007 07:47:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/08/2007 15:15:41
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01246511
Message ID:
01246733
Views:
20
>Hi Cetin...
>
>My mistake.. I was looking at the wrong example. You code works perfactly. The following code causes an error with a ? mark in the description fields.
>
>
>
>lcSQL = "UPDATE so_b SET " +;
>	    "itm_numb = [" + so_b.itm_numb + "], " +;
>	    "itm_desc = [" + so_b.itm_desc + "], " +;
>         "WHERE iid_numb = " + TRANSFORM(liIid_numb)
>	=SQLEXEC(gnC, lcSQL)
>
>
>Thanks AGain
>Raz

Raza,
Check my sample again. It doesn't use transform() or any other hardcoding as you did. Instead it uses parameters. If you don't use parameters be prepared for a number of headaches (and you'd be lucky if you all get is syntax error).
lcSQL = "UPDATE so_b SET " +;
	    "itm_numb = ?so_b.itm_numb," +;
	    "itm_desc = ?so_b.itm_desc" +;
         "  WHERE iid_numb = ?m.liIid_numb"
	=SQLEXEC(m.gnC, m.lcSQL)
Also check:
Re: How to use ? in variables for UPDATE/INSERT statements? Thread #1235643 Message #1235960
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform