we are trying to write multi thread application using c++ and pro*c. is there any interface function in Pro*c such that we will be getting database connection back to c++ layer so that it can attached to thread. i read several documentation in pro*c but there is no such feasibility. what ever the examples i am getting is spawning threads in pro*c layer and writing business logic in pro*c layer
I'm not sure I understand the question. From what I read, Pro*C is a precompilation step for C and C++ programs that lets the programmer embed SQL statements directly in the C/++ source code, letting the preprocessor generate all the boilerplate code to assign data to program variables.
As I understand your question, you want to somehow call a C++ function from the middle of an SQL statement, is that correct? For example,
1 2 3 4 5 6
bool foo(int n){
return n > 42;
}
//...
SELECT COUNT(*) FROM table WHERE foo(column);
Something along those lines, right?
I would be extremely surprised if that was possible. Think about it: the Orable server will definitely be a different process, at least on the same machine, and almost certainly on a different computer. How would the database server be able to execute your foo() function from the other end of a network connection?