SQL INSERTer - SQUIRTer for short.
Mini VFP code generator for SQL INSERTs. Very useful for tables with large numbers of fields. Oracle / SQL Server / DB2, currently implemented.
Here is an example of code generated for AS400/DB2 if your table has only 3 fields:
cSqlStatement = "INSERT INTO Customer " ;
+ "( iID, cCompany, dFirstOrder ) " ;
+ " VALUES ( " ;
+ ['] + ALLTRIM( STR( iID )) + [',] ;
+ ['] + ALLTRIM( cCompany ) + [',] ;
+ [CAST ('] + DTOC(dFirstOrder) + [' AS DATE )] ;
+ ")"
At runtime cSqlStatement will end up containing:
"INSERT INTO Customer ( iID, cCompany, dFirstOrder ) VALUES
( '12345','New Company Name',CAST ('10/29/2000' AS DATE ) )"
This routine assumes that your backend table has the same field names as your VFP Table / Cursor.
How it works:1. Copy SQUIRTER files to c:\temp\squirter\
Then in the VFP developement environment:
2. DO c:\temp\squirter\Menu1.MPR
(best invoked by your CONFIG.FPW COMMAND=DO c:\temp\squirter\Menu1.MPR)
3. Open the table containing records to be uploaded to the backend.
4. Position the cursor where you want the SQL statement generated.
5. Select relevant SQUIRTer option from the TOOLS menu.
SQUIRTer should appear in the Recent Entries area of the Files Section either today or tomorrow - depending on how busy Nick and the others are.
Feedback would be appreciated - hell it would send me into shock!
censored.