Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Linking with OCI .so

Re: Linking with OCI .so

From: <liuye_at_hotmail.com>
Date: 2000/08/01
Message-ID: <8m7dga$elv$1@nnrp1.deja.com>#1/1

In article <8m607s$2dqj$1_at_adm.sci-nnov.ru>,   "Edward Kostukovich" <edward_at_internet2.ru> wrote:
> While i'm linking my application with OCI shared library, gcc issues :
> /db/u01/app/oracle/product/8.0.5/lib/libclntsh.so: the `llseek'
 function may
> be dangerous; use `lseek64' instead.
>
> What does it mean and what should i do to avoid this ?
>
> OS linux Mandrake 7.1 kernel 2.2.15-4mdk
> oracle 8.0.5 EE
>
>

Hi,

First question, what platform are you using? Is it a 64 bits machine?

In llseek, the address space is limited to 2G which use 32 bits signed integer for offset. That is, your datafile is limited to 2G.

In order to use large address space and to be compliant with 64 bit OS, llseek64 uses two 32 bit int as offet: low, high. Therefore you can use file more than 2G.

Second, I want to ask you a question. I hope any OCI programming guru can also help.

In using OCIDescribeAny() over Oracle 8.1.5, I want to get the whole schema of the database starting from database name.

Here is the piece of code:

	/* must allocate describe handle first for OCIDescribeAny */
	checkerr(errhp, OCIHandleAlloc((dvoid *) envhp, (dvoid **)
&dschp,
			(ub4) OCI_HTYPE_DESCRIBE,
			(size_t) 0, (dvoid **) 0));

	/* call OCIDescribeAny and passing in the type name */
	checkerr(errhp, OCIDescribeAny(svchp, errhp,
	  (text *)dbname,					/*
object name */
      (ub4) strlen((char *)dbname),	/* object name length */
	  OCI_OTYPE_NAME,				/* indicate that
object name is entered */
	  (ub1)1,						/* info
level 1 */
      (ub1) OCI_PTYPE_DATABASE,		/* object type */
	  dschp));						/*

description handle */
	/* get the parameter list for the requested type */
	checkerr(errhp, OCIAttrGet((dvoid *) dschp, (ub4)
OCI_HTYPE_DESCRIBE,
                  (dvoid *)&parmp, (ub4 *)0, (ub4)OCI_ATTR_PARAM,
errhp));
	/* get the schema list under this database */
	checkerr(errhp, OCIAttrGet((dvoid*) parmp,(ub4) OCI_DTYPE_PARAM,
                    (dvoid*)&namep, (ub4 *) &size,
                    (ub4) OCI_ATTR_LIST_SCHEMAS, (OCIError *) errhp));

	checkerr(errhp, OCIAttrGet((dvoid*) namep,(ub4) OCI_DTYPE_PARAM,
                    &numschms, 0,
					(ub4) OCI_ATTR_NUM_PARAMS,

(OCIError *) errhp));

I run the code over a database just created by installation, numschms is 20.

Question 1: There are 20 schemas in the database, what are they?

When I go futher down to get each schema under this schema list, what should I do?

I tried the following code:

	for (i=1; i<=numschms; i++)
	{
		checkerr(errhp, OCIParamGet((dvoid *)namep,
					(ub4) OCI_DTYPE_PARAM, errhp,
                    (dvoid *)&parmdp,
					(ub4) i));
		checkerr(errhp, OCIAttrGet((dvoid*) parmdp, (ub4)
OCI_DTYPE_PARAM,
                 (dvoid*) &coldesr[pos], (ub4 *) 0,
                 (ub4) OCI_ATTR_LIST_OBJECTS,
                 (OCIError *) errhp));
	}

just like the way when retrieving column information of table. But

OCIAttrGet((dvoid*) parmdp, (ub4) OCI_DTYPE_PARAM,

                 (dvoid*) &objdesr[pos], (ub4 *) 0,
                 (ub4) OCI_ATTR_LIST_OBJECTS,
                 (OCIError *) errhp)

always fails.

The only difference is that when getting the column information, the entry in objdesr[pos] is an elementary type and here I expect a list type.

Qusetion 2: How does it happen? Dose Oracle OCI support this or not? If not, how can I get all meta data starting from the name of the database? Maybe there are ways to query some data catalog tables/views?

Thanks,

--ye

yliu_at_tibco.com

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Aug 01 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US