Home » Developer & Programmer » Precompilers, OCI & OCCI » [Oci8 C] OCIDate & OCIBindByName problem
[Oci8 C] OCIDate & OCIBindByName problem [message #134084] Tue, 23 August 2005 08:47 Go to next message
lauranger
Messages: 3
Registered: August 2005
Location: Paris
Junior Member
Hey all.
Using OCIBindByName to bind a date in a stored procedure call,
I get an error 01485 (difference in length between compilation and execution) at insert, and a 03113 (end of file in communication canal) at reading.
I searched google very long for a good example of call to
OCIBindByName with an OCIDate but not succeeded.
Has anybody such code to show ?
Or at least a better hint than page 15 of the OCI Programmer's Guide ?
Thanks in advance.
Laurent G.

[Updated on: Tue, 23 August 2005 08:52]

Report message to a moderator

(Solved)Re: [Oci8 C] OCIDate & OCIBindByName problem [message #134337 is a reply to message #134084] Wed, 24 August 2005 07:10 Go to previous messageGo to next message
lauranger
Messages: 3
Registered: August 2005
Location: Paris
Junior Member
That seemed strange : nobody had asked about such a problem on internet before ...
I finally found what caused the weird errors and diagnostics.
Does anyone knows how one could translate "tomber en marche" ?
I got in charge the maintenance of the db-library used on our applications. Every type inserting and selecting was ok, even date if as out arrays. But single date : no. Why ? It took me two days to catch the point, or the two points as the key was that OCIBindByName waits for param name strings to begin with a colon. That was not what we used to do : param name were in the form 'fred' not ':fred'. This changed, single dates are now gently handled as out and in.
Hope this will help if anybody falls in this trap.
Re: (Solved)Re: [Oci8 C] OCIDate & OCIBindByName problem [message #134493 is a reply to message #134337] Thu, 25 August 2005 04:38 Go to previous messageGo to next message
Michael Hartley
Messages: 110
Registered: December 2004
Location: West Yorkshire, United Ki...
Senior Member

Hi,

When the SQL string is parsed the list of bind variable names is generated within the client OCI layer.
eg select col1, col2 from mytable where col3=:var1;
where var1 is a bind variable.

At the point where the bind variables are bound to client application memory spaces you can either use bindbypos function or bindbyname functions. I personally prefer bindbypos because I don't have to be so worried about bind variable names getting changed, but I do have to worry about position.

Kind regards
Michael Hartley
http://www.openfieldsolutions.co.uk
Re: [Oci8 C] OCIDate & OCIBindByName problem [message #134506 is a reply to message #134084] Thu, 25 August 2005 05:49 Go to previous message
lauranger
Messages: 3
Registered: August 2005
Location: Paris
Junior Member
Hi
I guess OCIBinByPos is also quicker than OCIBindByName, so I added in out db-lib the possibility to use by pos when I am sure that the order in the string is the same order as in binding but left by name for what's left because of a heavy legacy.
Regards.
Laurent G.
Previous Topic: how to read hard disk serial number
Next Topic: Can you call OCI from Oracle Forms application
Goto Forum:
  


Current Time: Thu Mar 28 04:00:16 CDT 2024