Home » Developer & Programmer » Precompilers, OCI & OCCI » sql_context (solaris)
sql_context [message #674276] Tue, 15 January 2019 12:10 Go to next message
vkalam
Messages: 1
Registered: January 2019
Junior Member
Hi,

can anyone share what is the precompiler option i need to provide to generate sql_context definition.
i tried with THREADS=YES but it is giving issue with EXEC SQL CONTEXT ALLOCATE :CTX1 statement


Thanks
Re: sql_context [message #678455 is a reply to message #674276] Thu, 05 December 2019 06:56 Go to previous message
NevemTeve
Messages: 1
Registered: November 2017
Junior Member
Here is the simplest example
/* minthrpc.pc */

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SQLCA_NONE
#define ORACA_NONE

#include <sqlca.h>
#include <oraca.h>

EXEC ORACLE OPTION (oraca=yes);

int main (void)
{
    struct sqlca sqlca;
    struct oraca oraca;
    sql_context pctx= NULL;

    memset (&sqlca, 0, sizeof sqlca);
    memset (&oraca, 0, sizeof oraca);
    oraca.oradbgf= 1;
    oraca.orastxtf=  2;

    EXEC SQL ENABLE THREADS;
    EXEC SQL CONTEXT ALLOCATE :pctx;
    EXEC SQL CONTEXT USE :pctx;

    return 0;
}
Previous Topic: Oracle Database 18c XE and Pro*C
Goto Forum:
  


Current Time: Sun Dec 08 15:18:26 CST 2019