OCIDescribeAny Fails with ora-4043 when Describing PUBLIC Synonym of an UDT Object. (Doc ID 1225793.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: 8.1.7.4 to 11.2.0.1.0 - Release: 8.1.7 to 11.2
Information in this document applies to any platform.

Symptoms

When trying to describe a public synonym using OCIDescribeAny type fails with ORA-04043

UTest.c
#include <oci.h>
#include <string.h>
#include <stdio.h>

const text *dbname = (text *)"";

static void checkerr(errhp, status)
OCIError *errhp;
sword status;
{
text errbuf[512];
ub4 errcode;

switch (status)
{
case OCI_SUCCESS:
break;
case OCI_SUCCESS_WITH_INFO:
printf("Error - OCI_SUCCESS_WITH_INFO\n");
break;
case OCI_NO_DATA:
printf("Error - OCI_NO_DATA\n");
break;
case OCI_ERROR:
OCIErrorGet ((dvoid *) errhp, (ub4) 1, (text *) NULL, &errcode, errbuf, (ub4) sizeof(errbuf), (ub4) OCI_HTYPE_ERROR);
printf("OCI Error - %s\n", errbuf);
break;
case OCI_INVALID_HANDLE:
printf("Error - OCI_INVALID_HANDLE\n");
break;
default:
break;
}
}

void main()
{
OCIEnv *p_env;
OCIError *p_err;
OCISvcCtx *p_svc;

OCIDescribe *p_describe1 = (OCIDescribe *) 0;

OCIDefine *p_define1 = (OCIDefine *) 0;
sb4 status;

printf("Initialize and logon \n");
checkerr(p_err, OCIInitialize((ub4) OCI_OBJECT, (dvoid *) 0, (dvoid * (*) ()) 0, (dvoid * (*) ()) 0, (void (*) ()) 0));

checkerr(p_err, OCIEnvInit(&p_env, (ub4) OCI_DEFAULT, (size_t) 0, (dvoid **)0));

checkerr(p_err, OCIHandleAlloc(p_env, &p_err, OCI_HTYPE_ERROR, (size_t) 0, (dvoid **) 0));
checkerr(p_err, OCIHandleAlloc(p_env, &p_svc, OCI_HTYPE_SVCCTX, (size_t) 0, (dvoid **) 0));
checkerr(p_err, OCIHandleAlloc(p_env, &p_describe1, OCI_HTYPE_DESCRIBE, (size_t) 0, (dvoid **) 0));

checkerr(p_err, OCILogon(p_env, p_err, &p_svc, "scott", strlen("scott"), "tiger", strlen("tiger"), (text *)dbname, strlen(dbname)));

printf("Connection created \n");

printf("Describe object \n");
checkerr(p_err, OCIDescribeAny(p_svc, p_err, (text *)"SDO_GEOMETRY", (ub4) strlen((char *)"SDO_GEOMETRY"), OCI_OTYPE_NAME, (ub1)OCI_DEFAULT, (ub1) OCI_PTYPE_TYPE, p_describe1));

printf("Done Describe object \n");

}

Build and execute
> make -f demo_rdbms.mk build EXE=UTest OBJS=UTest.o
> UTest
Initialize and logon
Connection created
Describe object
OCI Error - ORA-04043: object SDO_GEOMETRY does not exist

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms