Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server Insert Failing
Message
From
04/05/2007 20:32:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/05/2007 17:29:08
David Knoup
Unique Solutions Software Inc.
Pecatonica, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01222651
Message ID:
01222683
Views:
24
>Sometimes when we use this insert command on MS SQL Server it returns that was successfull, but it doesn't always insert the record when we go back and look at the data.
>
>lcinsert="INSERT INTO iciadj
> (cuid,cadjno,cmodule,citemno,cwarehouse,cbin,centerby,cadjacc,cremark,dadjust,nadjqty) VALUES(?lcUID,?lccid,'IC',?lcitem,?lcwhs,?lcbin ,?lcemp ,'11111-111',?lccode,getdate(),?lcqty)"
>
>x=SQLEXEC(gnhandle,lcinsert)
>
>IF x<1
>
>Now when it fails to do the insert, it still doesn't return a value less than one, but the data is not in the table.
>
>Any help would be appreciated.
>
>Thanks!
>
>-David

-This code doesn't guarantee that it is not returning a value less than 1 while you think the return value was not < 1.
-It might be returning 1 and the record is inserted but you think it didn't checking a different row.
-Or there is a constraint hiding the inserted record from your check.
-Or it is inserted but deleted before you checked back (maybe a trigger did that).

Put m. prefix to your variables at least to prevent hard to catch name collisions.

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