Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New file uploaded to UT - SQUIRTer.
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
New file uploaded to UT - SQUIRTer.
Miscellaneous
Thread ID:
00429994
Message ID:
00429994
Views:
52
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.
Next
Reply
Map
View

Click here to load this message in the networking platform