Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pasthrough
Message
From
04/02/2002 12:32:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/02/2002 12:16:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00614891
Message ID:
00614906
Views:
25
>I am using SPT to insert data into as AS400 database. All works fine until I try and add another field of the record to insert. What I think is happening is my insert string is getting too long. How can I use variables to make the string shorter?
>
>My Code:
>testthissd = "INSERT INTO drawmstrp (dm_drawing_number,dm_drawing_title,dm_pending_change,dm_date_issued,dm_requester_name1,dm_requester_name2, ;
>dm_job_order,dm_project,dm_customer) Values(&nfn,&nf2,&nf3,&nf4,&nf5,&nf6,&nf7,&nf8,&nf9)"
>*? testthissd
>
>= SQLSETPROP(gnHandle1n, 'Transactions', 2)
>= SQLEXEC(gnHandle1n, testthissd)

Steven,
2 things :
-Use ? instead of &
-Divide the SQL string into multiple quoted strings. ie :

Instead of :
"INSERT INTO drawmstrp (dm_drawing_number,dm_drawing_title,dm_pending_change,dm_date_issued,dm_requester_name1,dm_requester_name2, ;
dm_job_order,dm_project,dm_customer) Values(&nfn,&nf2,&nf3,&nf4,&nf5,&nf6,&nf7,&nf8,&nf9)"


"INSERT INTO drawmstrp "+;
" (dm_drawing_number,dm_drawing_title,dm_pending_change,"+;
" dm_date_issued,dm_requester_name1,dm_requester_name2,"+;
" dm_job_order,dm_project,dm_customer)"+;
" Values "+;
" (?nfn,?nf2,?nf3,?nf4,?nf5,?nf6,?nf7,?nf8,?nf9)"

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