[Info-ingres] [Info-Ingres] Environment setting order and API

Ingres Forums info-ingres at kettleriverconsulting.com
Wed Aug 6 17:34:29 UTC 2014


Martin Bowes;49576 Wrote: 
> 
> If I alter the environment handle given to me by IIapi_initialize() with
> multiple calls to IIapi_setConnectParam() ... taking care to save the
> pointerto the new environment handle returned by each call for use in
> the next call ... that all is OK. I can use dbmsinfo() calls within the
> connection established with this environment to verify this is cool. 
> 

IIapi_setConnectParam() does not modify an environment handle.  If given
an environment handle on input, a new connection handle is created (or
if given NULL), connection settings in the environment hadle are copied
to the new connection handle, the new connection parameter is added, and
the new connection handle is returned.  If given a connection handle,
the new parameter is added and the same connection handle is returned.

Martin Bowes;49576 Wrote: 
> 
> Take that code and move the calls to IIapi_setEnvParam() AFTER the calls
> toIIapi_setConnectParam() ... All is NOT cool.  The first attempt to
> call IIapi_setEnvParam() now fails with errors indicating I passed an
> invalid environment handle.
> 

IIapi_setEnvParam() only accepts an environment handle or NULL and only
returns an environment handle.  The error is expected since you passed a
connection handle returned from IIapi_setConnectParam() into
IIapi_setEnvParam().

I believe this is clearly documented in the OpenAPI User's Guide.


-- 
thogo01
------------------------------------------------------------------------
thogo01's Profile: http://community.actian.com/forum/member.php?userid=4992
View this thread: http://community.actian.com/forum/showthread.php?t=16112




More information about the Info-ingres mailing list