Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax of SQLEXEC
Message
From
12/11/2004 12:15:50
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00960758
Message ID:
00960911
Views:
8
No,
one SQLPREPARE() it is sufficient,
this compile the command, BUT NOT DO ANY INSERT .
After, for every record you execute one SQLEXEC(lnAccess) only,
this fill the odbc parameters only and do the INSERT command.
IF SQLPREPARE(m.lnAccess,[INSERT INTO IFCOMPAN ( CID, CNAME1, CNAME2, CADDRESS1, CZIPCODE, CLOCALITY, CVATCAT,;
CCUSTYPE, CSUPTYPE, CCUSCAT, CCUSPAYDELAY ) VALUES (;
?code, ?nomteleph , ?nom2 , ?rue,?(cpays+ccp) , ?localite , 'N' , 'C' , 'U' ,;
?codePersonnel , 30)])>0
    SELECT BobClient
    SCAN
      =SQLEXEC(m.lnAccess)
    ENDIF
ENDSCAN
But this code have none error control!

>Fabio,
>
>thank
>
>Is just ?
>
>csql = [INSERT INTO IFCOMPAN ( CID, CNAME1, CNAME2, CADDRESS1, CZIPCODE, CLOCALITY, CVATCAT,;
>CCUSTYPE, CSUPTYPE, CCUSCAT, CCUSPAYDELAY ) VALUES (;
>?code, ?nomteleph , ?nom2 , ?rue,?(cpays+ccp) , ?localite , 'N' , 'C' , 'U' ,;
>?codePersonnel , 30)]
>
>
>_TALLY=0
>
>SELECT BobClient
>SCAN ALL
>IF SQLPREPARE(m.lnAccess,m.csql)>0
>
>SQLEXEC(m.lnAccess,m.csql)
>
>   * with buffering
>  *COUNT NOOPTIMIZE FOR SQLEXEC(m.mlnAccess)>0 AND TABLEUPDATE()
>ENDIF
>ENDSCAN
>
> COUNT NOOPTIMIZE FOR SQLEXEC(m.mlnAccess)>0
>
>IF _TALLY<m.BobClientCount
&gt;	WAIT WINDOWS 'ERRORS'
&gt;ENDIF
&gt;
Previous
Reply
Map
View

Click here to load this message in the networking platform