>Hi Cetin,
>
>I'm getting an error when I try to insert more than 10 fields using SQLExec.
>
>lnsuccess = SQLEXEC(gnConnHandle, "INSERT INTO Sync_Box (;
> Ordernum, box, status, shiplist, charges, ship_date, inpart, hold_date, custnum, trackingno, box_id, ship_to, ship_via, ship_when) ;
> VALUES (;
> ?Order, ?box, ?status, ?shiplist, ?charges, ?ship_date, ?inpart, ?hold_date, ;
> ?custnum, ?trackingno, ?box_id, ?ship_to, ?ship_via, ?ship_when)")
>
>If I take out any 4 fields it works great. What am I doing wrong?
>Many thanks.
Rixon,
It's not because of field count but due to literal string limit of 255 I guess (I didn't check the lenght).
Use Text...endtext to build your SQL (is that SQL server? if so you don't need pretext):
text to m.lcSQL noshow pretext 15
INSERT INTO Sync_Box (
Ordernum, box, status, shiplist, charges,
ship_date, inpart, hold_date, custnum,
trackingno, box_id, ship_to, ship_via, ship_when)
VALUES (?m.Order, ?m.box, ?m.status, ?m.shiplist, ?m.charges,
?m.ship_date, ?m.inpart, ?m.hold_date, ?m.custnum,
?m.trackingno, ?m.box_id, ?m.ship_to, ?m.ship_via, ?m.ship_when)
endtext
lnsuccess = SQLEXEC(m.gnConnHandle, m.lcSQL)
Cetin