Read a datafile format definition from a host file.
RETCODE bcp_readfmt(dbproc, filename) DBPROCESS *dbproc; char *filename;
A pointer to the DBPROCESS structure that provides the connection for a particular front end/Adaptive Server Enterprise process. It contains all the information that DB-Library uses to manage communications and data between the front end and Adaptive Server Enterprise.
The full directory specification of the file containing the format definitions.
SUCCEED or FAIL.
bcp_readfmt reads a datafile format definition from a host file, then makes the appropriate calls to bcp_columns and bcp_colfmt. This automates the bulk copy of multiple files that share a common data format.
bcp, the bulk copy utility, copies a database table to or from a host file in a user-specified format. User-specified formats may be saved through bcp in datafile format definition files, which can later be used to automate the bulk copy of files that share a common format. See the Open Client and Open Server Programmers Supplement.
Application programs can call bcp_writefmt to create files with datafile format definitions.
The following code fragment illustrates the use of bcp_readfmt:
bcp_init(dbproc, "mytable", "bcpdata", "bcperrs", DB_IN);
bcp_readfmt(dbproc, "my_fmtfile");
bcp_exec(dbproc, &rows_copied);