Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 3.17 KB

ibcpsession-bcpreadfmt-ole-db.md

File metadata and controls

60 lines (44 loc) · 3.17 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords apiname apitype
IBCPSession::BCPReadFmt (Native Client OLE DB provider)
IBCPSession::BCPReadFmt (Native Client OLE DB provider)
markingmyname
maghan
03/14/2017
sql
native-client
reference
BCPReadFmt method
IBCPSession::BCPReadFmt (OLE DB)
COM

IBCPSession::BCPReadFmt (Native Client OLE DB Provider)

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]

Important

[!INCLUDEsnac-removed-oledb-only]

Reads format information for each column from the format file.

Syntax

  
HRESULT BCPReadFmt(   
      const wchar_t *pwszFormatFile);  

Remarks

The BCPReadFmt method is used for reading data from a format file that specifies the format of data in the data file. This method is capable of detecting the correct version of the format file. It can automatically detect whether the format file is in xml or old style text format and behaves accordingly. The format file versions supported by the [!INCLUDEssNoVersion] Native Client OLE DB provider BCP are version 6.0 or newer.

After the BCPReadFmt method reads the format values, it makes the appropriate calls to the IBCPSession::BCPColumns and IBCPSession::BCPColFmt methods. There is no need for the user to parse a format file and make these calls.

To save a format file, call the IBCPSession::BCPWriteFmt method. Calls to the BCPReadFmt method can reference saved formats. Alternatively, the bulk-copy utility (bcp) can save user-defined data formats in files that can be referenced by the BCPReadFmt method.

The BCP_OPTION_DELAYREADFMT value of the eOption parameter of IBCPSession::BCPControl modifies the behavior of IBCPSession::BCPReadFmt.

Arguments

pwszFormatFile[in]
The path and file name of the file containing the format values for the data file.

Return Code Values

S_OK
The method succeeded.

E_FAIL
A provider-specific error occurred, for detailed information use the ISQLServerErrorInfo interface.

E_OUTOFMEMORY
Out of memory error.

E_UNEXPECTED
The call to the method was unexpected. For example, the IBCPSession::BCPInit method was not called before calling this method.

See Also

IBCPSession (OLE DB)
Performing Bulk Copy Operations