Oracle® interMedia Reference 10g Release 1 (10.1) Part Number B10829-01 |
|
|
View PDF |
Format
compatibilityInit(release IN VARCHAR2,
errmsg OUT VARCHAR2)
RETURN NUMBER;
Description
Provides compatibility between software releases by allowing for the evolution of the interMedia object types.
Parameters
The release number. For example, this string should be set to 10.1 to allow a release 10.1 application to work with a future release of the Oracle Database software and the interMedia evolved object types.
String output parameter. If the function returns a status other than 0, this errmsg string contains the reason for the failure.
Pragmas
None.
Exceptions
None.
Usage Notes
You should begin using the compatibilityInit( ) method as soon as possible so you will not have to upgrade the Oracle software on your client node, or recompile your client application in order to work with a future release of the Oracle Database software if the interMedia object types change in a future release. See Section 2.1 to determine if you need to call this function.
The compatibility initialization function for interMedia is located in the ORDSYS.IM package.
Examples
Use OCI and set the compatibilityInit( ) method release parameter to 10.1 to allow a release 10.1 application to work with a future release of the Oracle Database software and evolved interMedia object types. This is not a standalone program; it assumes that you have allocated handles beforehand.
void prepareExecuteStmt( OCIEnv *envHndl, OCIStmt **stmtHndl, OCIError *errorHndl, OCISvcCtx *serviceCtx, OCIBind *bindhp[] ) { text *statement = (text *) "begin :sts := ORDSYS.IM.compatibilityInit( :vers, :errText ); end;"; sword sts = 0; text *vers = (text *)"10.1"; text errText[512]; sb2 nullInd; printf( " Preparing statement\n" ); OCIHandleAlloc( envHndl, (void **) stmtHndl, OCI_HTYPE_STMT, 0, NULL ); OCIStmtPrepare( *stmtHndl, errorHndl, (text *)statement, (ub4)strlen( (char *)statement ), OCI_NTV_SYNTAX, OCI_DEFAULT ); printf( " Executing statement\n" ); OCIBindByPos( *stmtHndl, &bindhp[ 0 ], errorHndl, 1, (void *)&sts, sizeof( sts ), SQLT_INT, (void *)0, NULL, 0, 0, NULL, OCI_DEFAULT ); OCIBindByPos( *stmtHndl, &bindhp[ 1 ], errorHndl, 2, vers, strlen((char *)vers) + 1, SQLT_STR, (void *)0, NULL, 0, 0, NULL, OCI_DEFAULT ); OCIBindByPos( *stmtHndl, &bindhp[ 2 ], errorHndl, 3, errText, sizeof( errText ), SQLT_STR, &nullInd, NULL, 0, 0, NULL, OCI_DEFAULT); OCIStmtExecute( serviceCtx, *stmtHndl, errorHndl, 1, 0, (OCISnapshot *)NULL, (OCISnapshot *)NULL, OCI_DEFAULT ); printf( " Statement executed\n" ); if (sts != 0) { printf( "CompatibilityInit failed with Sts = %d\n", sts ); printf( "%s\n", errText ); } }