16.6.5 SQLCopyDesc
- Organization of this subsection
(1) Function
This ODBC function copies descriptor information from one descriptor handle to another.
(2) Format
SQLRETURN SQLCopyDesc ( SQLHDESC SourceDescHandle, /* In */ SQLHDESC TargetDescHandle /* In */ )
(3) Arguments
- SourceDescHandle
-
Specifies a source descriptor handle.
- TargetDescHandle
-
Specifies a target descriptor handle. For this argument, you can specify a handle to an application descriptor or an IPD, but not a handle to an IRD.
(4) Return value
This ODBC function returns SQL_SUCCESS, SQL_ERROR, or SQL_INVALID_HANDLE.
(5) SQLSTATE
This ODBC function returns one of the following SQLSTATE values:
SQLSTATE |
Description |
Remarks |
Returned |
---|---|---|---|
01000 |
General warning |
-- |
N |
08S01 |
Communication link failure |
N |
|
HY000 |
General error |
N |
|
HY001 |
Memory allocation error |
Y |
|
HY007 |
Associated statement is not prepared |
Y |
|
HY010 |
Function sequence error |
Before this function was executed, SQLExecute, SQLExecDirect, SQLExecDirectW, or SQLParamData was called for StatementHandle associated with the descriptor handle of SourceDescHandle or TargetDescHandle and returned SQL_NEED_DATA. Since then, the setting of runtime data parameters or runtime data columns has not been completed. |
Y |
HY013 |
Memory management error |
-- |
N |
HY016 |
Cannot modify an implementation row descriptor |
TargetDescHandle was associated with an IRD. |
Y |
HY021 |
Inconsistent descriptor information |
-- |
N |
HY092 |
Invalid attribute or option identifier |
N |
|
HYT01 |
Connection timeout expired |
N |
|
IM001 |
Driver does not support this function |
N |
- Legend:
-
Y: This SQLSTATE might be returned by the HADB ODBC driver.
N: This SQLSTATE is not returned by the HADB ODBC driver.
--: None
(6) Notes
If the return value is not SQL_SUCCESS, execute SQLEndTran with SQL_ROLLBACK specified for CompletionType or execute SQLFreeHandle with SQL_HANDLE_STMT specified for HandleType.