Executes a bulk-copy of data between a database table and an operating-system file.
SqlBCPExec% ( sqlconn%, rowscopied& )
where
SUCCEED (1) or FAIL (0). The SqlBCPExec% function returns SUCCEED only when all rows are copied. If some or none of the rows are copied, SqlBCPExec% returns FAIL. Check the rowscopied& parameter for the number of rows successfully copied.
SqlBCPExec% copies data from an operating-system file to a database table or vice versa, depending on the value of the direction% parameter in SqlBCPInit%.
Before calling SqlBCPExec%, you must call SqlBCPInit% with a valid operating-system filename. Failure to do so results in an error.
'Initialize bcp. Result% = SqlBCPInit%(Sqlconn%,"pubs..authors", "authors.sav", "", DBOUT%) IF Result% = FAIL THEN SQLExit SQLWinExit End END IF 'Now, execute the bulk-copy. Result% = SqlBCPExec%(Sqlconn%, RowsCopied&) IF Result% = FAIL THEN PRINT "Incomplete bulk-copy. Only "; RowsCopied&; " rows copied." PRINT SQLExit SQLWinExit End END IF
SqlBCPColfmt%, SqlBCPColumns%, SqlBCPControl%, SqlBCPInit%