[Orclib-users] How to pass OCILIB connection to a function in C?
Open source C and C++ library for accessing Oracle Databases
Brought to you by:
vince_del_paris
From: <mod...@co...> - 2012-04-10 15:04:41
|
Hello, If I'm using OCILIB in the main function, such as: int main (void) { OCI_Connection *cn; OCI_Statement *st; ... OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT); OCI_EnableWarnings(TRUE); cn = OCI_ConnectionCreate(...); st = OCI_StatementCreate(cn); ... my_function(...); } When I create a new function, my_function, how do I pass the existing OCILIB connection into my_function for use? I want to avoid opening a new connection in my_function if it is not necessary. For example, I'd like to pass *cn and *st above into my_function. |