Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OCI release 8i problems

14 views
Skip to first unread message

Jens Lundell

unread,
Jul 29, 2000, 3:00:00 AM7/29/00
to
I'm having trouble getting started using OCI release 8i. I'm trying to
connect using:

OCIEnv *myenvhp;
OCIError *myerrhp=0;
OCISvcCtx *svchp;
sword ret;

ret=OCIEnvCreate((OCIEnv **)&myenvhp, OCI_DEFAULT, 0,0,0,0,0,0);
ret=OCILogon(myenvhp, myerrhp, &svchp,(unsigned char*) "user"
strlen("user"),(unsigned char*) "passwd", strlen("passwd"),
(unsigned char*) "db", strlen("db"));
checkerr(myerrhp,ret);

But I get an OCI_INVALID_HANDLE error. How do I create a default
environment and connect to oracle?

-Jens

Btw, does anyone know when Oracle are planning to ship OCI samples
written in OCI release 8i with Oracle 8i? All examples are currently
using the old OCI.


Sent via Deja.com http://www.deja.com/
Before you buy.

Peter Dickmann

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
Hi,

check e.g. ocidemo81.c in the $ORACLE_HOME/rdbms/demo directory. At least
the OCIInitialize(), OCIEnvInit(), and OCIHandleAlloc() calls are missing.

PD

Jens Lundell <Jens.O....@saic.com> wrote in message
news:8lt9uo$e56$1...@nnrp1.deja.com...

Jens Lundell

unread,
Jul 31, 2000, 3:00:00 AM7/31/00
to
In article <3985...@news.lhsgroup.com>,

"Peter Dickmann" <pdic...@de.lhsgroup.com> wrote:
> Hi,
>
> check e.g. ocidemo81.c in the $ORACLE_HOME/rdbms/demo
> directory. At least the OCIInitialize(), OCIEnvInit(),
> and OCIHandleAlloc() calls are missing.

Thanks Peter for having me look at the examples again. It seems like the
examples called oci*.c are all using OCI7 but the other examples are in
fact using OCI8.

-Jens

Justice Ocker

unread,
Aug 1, 2000, 3:00:00 AM8/1/00
to
You need to specifically create the error handle as well as statement
handle.

After creating the environment you need to use OCIHandleAlloc and create
the error handle.

OCIEnv *myenvhp;
OCIError *myerrhp=0;
OCISvcCtx *svchp;

OCIStmt* mystmthp;

ret=OCIEnvCreate((OCIEnv **)&myenvhp, OCI_DEFAULT, 0,0,0,0,0,0);

//create error handle
ret=OCIHandleAlloc(myenvhp, &myerrhp,
(ub4) OCI_HTYPE_ERROR, (size_t) 0, (dvoid **) 0));

ret=OCILogon(myenvhp, myerrhp, &svchp,(unsigned char*) "user"
strlen("user"),(unsigned char*) "passwd", strlen("passwd"),
(unsigned char*) "db", strlen("db"));
checkerr(myerrhp,ret);

//create statement handle
ret=OCIHandleAlloc(myenvhp, &mystmthp,
(ub4) OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0));


That should do it. Let me know if you have any problems or if you find
out why everytime I execute an insert statement I get this error:

ORA-12571
TNS: Packet Writer Failure


Justice

Jens Lundell wrote:
>
>
> I'm having trouble getting started using OCI release 8i. I'm trying to
> connect using:
>
> OCIEnv *myenvhp;
> OCIError *myerrhp=0;
> OCISvcCtx *svchp;
> sword ret;
>
> ret=OCIEnvCreate((OCIEnv **)&myenvhp, OCI_DEFAULT, 0,0,0,0,0,0);
> ret=OCILogon(myenvhp, myerrhp, &svchp,(unsigned char*) "user"
> strlen("user"),(unsigned char*) "passwd", strlen("passwd"),
> (unsigned char*) "db", strlen("db"));
> checkerr(myerrhp,ret);
>
> But I get an OCI_INVALID_HANDLE error. How do I create a default
> environment and connect to oracle?
>
> -Jens
>
> Btw, does anyone know when Oracle are planning to ship OCI samples
> written in OCI release 8i with Oracle 8i? All examples are currently
> using the old OCI.
>
>

> Sent via Deja.com http://www.deja.com/
> Before you buy.


--
Posted via CNET Help.com
http://www.help.com/

adin_...@my-deja.com

unread,
Aug 4, 2000, 3:00:00 AM8/4/00
to
TNS error-03505: Failed to creatae address binding

Hi all-

I get this error when I perform a tnsping.

Listener is running
Tns names is set up

I stumbled on this when trying to create a dblink. I was having
problems resolving service name so I went back and reconfigured
my
tnsnames file and my listener.ora files. In testing, I used the
tnsping utility and got this error. Has any body come accross
this
before?


Ragards

Adin

0 new messages