Precompilers, OCI & OCCI :: How To Compile Simple PRO*C Code In Linux
Nov 6, 2008
Linux 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005 i686 i686 i386 GNU/Linux...As you'll see I do not understand anything about PRO*C. I need to compile this PRO*C code to use it to retrieve DBMS PIPES being sent.
I'm trying to compile it using the following command:
gcc -o IAPIPE IAPIPE.c
The code - file IAPIPE.c
#include <stdio.h>
#include <string.h>
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR username[20];
int status;
int msg_length;
char retval[2000];
EXEC SQL END DECLARE SECTION;
[code]....
View 3 Replies
ADVERTISEMENT
Nov 19, 2010
I wrote the below C code and I don't How can compile to so file
/* Include standard IO. */
#include <stdio.h>
#include <string.h>
#include <sqlca.h>
#include <stdlib.h>
[code].......
View 3 Replies
View Related
Oct 28, 2010
I compiled my c program to o file using the flowing command,
$gcc first.c -o first.o
the source code was lost.
How can I convert the o file to C code?
View -1 Replies
View Related
Jul 15, 2010
I am trying to compile a .pc file. I am working with Oracle 11gR1 and windows env. I am able to create .c file from .pc file. I am able to produce .o file from .obj file. But i am not able to link it and produce .exe. My installation does not contain / precomp /demo folder.
View 7 Replies
View Related
May 11, 2009
I am trying to use OCIColl datatype and thus wanted to check if a simple program using OCI functions and data types gets compile or not. sO I wrote the follwoing function which I want to compile as a DLL.
extern "C" CLUSTERINGDLL_API OCIColl *fnClusteringDLL(OCIColl *dxm[])
{
OCIError *errhp;
OCINumber num_1, num_2, sum;
OCINumberAdd(errhp, &num_1, &num_2, &sum);
std::cout<<"Members in the array are "<<dxm[1]<<std::endl;
std::cout<<"2 Member in the array are "<<dxm[0]<<std::endl;
printf("Is this printed %f", dxm[0]);
return dxm[1];
}
But I am getting the following error:-
Error6error LNK2019: unresolved external symbol _OCINumberAdd referenced in function _fnClusteringDLLclusteringdll.obj...
I have included the library folder containing oci.lib in the project directories.
View 7 Replies
View Related
Aug 13, 2010
I am trying to compile a pro c file. Rest of the pro c file is compiling fine. But one particular file is showing following error.
INTERNAL ERROR: Failed Assertion [Code=40706]
View 11 Replies
View Related
May 12, 2009
I've a Pro*C program which fills various large tables (in different schemas). I am executing the procedures which fill the tables as PThreads (since I want them to run in parallel for performance reasons). When I execute all threads sequentially (pthread_join(last_thread) before every pthread_create(next_thread)) everything works fine. But when a run the threads in parallel (as they should run), I am getting: "ORA-24550: signal received: si_signo=11si_errno=0si_code=1si_addr=0x18 Aborted"
View 1 Replies
View Related
Apr 2, 2009
I'm running a query similar to the one that I'm describing below -:
EXEC SQL INSERT INTO TABLE1
( C1
,C2
,C3
,C4 )
[code]....
Above query runs perfectly on SQL prompt.Same query, when being run in a Pro*C program gives compilation error-:
Error at specified line:
,( SELECT D.V3 FROM TABLE2 D WHERE D.V3 = C.V4)
.............................1
PCC-S-02201, Encountered the symbol "D" when expecting one of the following:
( ) * + - / . @ | at, day, hour, minute, month, second, year,
What are the possbile causes of error. I am using Oracle 10g on Unix.
View 1 Replies
View Related
Nov 18, 2009
i HAVE THE FOLLOWING CODE WRITTEN IN A *.pc FILE. I am trying to loop to fetch data from cursor. But the code exist after it fetches the first record. Let me know what is it the right way to fetch data from cursor?
EXEC SQL BEGIN DECLARE SECTION;
char str[64];
EXEC SQL END DECLARE SECTION;
/*cursor declarations*/
EXEC SQL DECLARE Get_SQLText_Cursor CURSOR FOR
[Code]....
View 6 Replies
View Related
Jan 22, 2008
I am trying to compile a .pc file with the make file which I created. But when I try to give make command I am getting following error
>make testfile
cc -o testfile testfile.c
"testfile.c", line 117: warning: no explicit type given
"testfile.c", line 119: warning: no explicit type given
"testfile.c", line 121: warning: no explicit type given
"testfile.c", line 122: warning: no explicit type given
"testfile.c", line 123: warning: no explicit type given
Undefined first referenced
symbol in file
sqlcxt testfile.o
ld: fatal: Symbol referencing errors. No output written to testfile
*** Error code 1
make: Fatal error: Command failed for target `testfile'
View 16 Replies
View Related
Jul 31, 2008
I have written make files that compile .pc files in unix. This was for several projects that use an oralib source code directory.Just running proc on one target .pc file works fine on unix. I am trying to use proc - Oracle 10.2.0 - in windows and I keep getting:
Quote:unable to open include file
#include <stdio.h>
and other C library headers.
I am doing all development under cygwin, this way I can write a makefile just like under unix instead of using nmake.All C library headers are in /usr/include When I run proc on Solaris as that:
proc program.pc
No problems, and I do get program.c.
However in windows I get the previous error message. I have tried to do proc include=/user/include program.pc and proc include=/user/include parse=full program.pc but I still get the same error message.
View 3 Replies
View Related
Jul 15, 2008
Recently, i had to restore /usr/lib folder (because some files crashes) to a previous point. This restore point is previous to Oracle client installation. Well, now, when i try to compile my Pro*C samples:
# make -u -f demo_proc32.mk sample1
/usr/ccs/bin/make -f
/oracle/oracle/product/10.2.0/client_1/precomp/demo/proc
/demo_proc32.mk OBJS=sample1.o EXE=sample1 build
[code]...
Can i fix it without re-installing Oracle client?
View 1 Replies
View Related
Aug 7, 2012
Why does is the code blow reuturning a null for a simple subtraction and division?I am trying to do 4-13/9 for one and 4-22/9 for 22
select unit,
term_1201,term_1202,r_slope,r_intercept,
(r_intercept - term_1201) / decode((r_slope),0,1) as ONE,
(r_intercept - term_1202) / decode((r_slope),0,1) as TWO
[code]...
View 6 Replies
View Related
Jul 11, 2012
I'm trying to compile an hello world example on my computer. I've read the documentation for requirements occi on the site
[URL]....
It says that the g++ compiler 3.4.6 or later is supported. I have:
Ubuntu 12.04
gcc 4.6.3
oracle instant client 11.2
g++ main.cpp -c -I/home/tim/skrivbord/bin/oracle/instantclient_11_2/include/ -D_REENTRANT -g -Wall
g++ -o pippo -L/home/tim/skrivbord/bin/oracle/instantclient_11_2/ -locci -lclntsh -lociei -lnnz11 main.o
main.o: In function `main':
/home/tim/skrivbord/dev/cpp/main.cpp:21: undefined reference to
[code]....
View 1 Replies
View Related
Nov 9, 2009
I would like to create a trigger that will execute a stored procedure when a package/function/procedure is compiled. I tried creating an update trigger on user_objects, but it statues aI cannot create that trigger tyoe on views.
View 1 Replies
View Related
Aug 12, 2008
Is it possible to connect with Oracle using C?
View 2 Replies
View Related
Sep 26, 2012
I am trying to give back data from a stored procedure written in C. I registered the functions as follows:create or replace procedure version(versioninfo OUT clob) as external name "version" library myLib language c with context parameters (context, versioninfo, versioninfo INDICATOR SB4); It compiles fine. The function being called look like this:
extern "C" DLLEXPORT
void version(OCIExtProcContext* context, OCILobLocator **out, sb4 *ind_out){
OCIEnv* envh;
OCISvcCtx* svch;
OCIError* errh;
OCIExtProcGetEnv (context, &envh, &svch, &errh);
std::string versioninfo = "104";
oraub8 maxChar = 10;
[code]...
If I execute the procedure with SQLDeveloper by pressing "play" it is getting executed but there is no result. If I try to execute it from an anonymous block it results in ORA-22275 instead of doing anything.
declare
res clob;
begin
-- the following doesn't work much
--dbms_lob.createtemporary(res,true);
version(res);
dbms_output.put_line(res);
end;
Actually I have to questions:
1.) Why does Oracle give me the error? In my opinion all requirements mentioned by the error description are met.
2.) Why is there no output when executing the function via SQL Developer? Is the usage of OCILobWrite wrong?
View 2 Replies
View Related
Nov 26, 2009
I am trying to describe an STP in a package, but it gives me an error.
e.g. In package ABC suppose there is an STP XYZ, I am trying to describe ABC.XYZ function but it gives me an error code 4043 and error message object XYZ.ABC does not exist.
View 2 Replies
View Related
Jan 24, 2009
My 10g pro*c application works perfectly, recently I upgraded it to 11g, but it keep crashing, why?
View 10 Replies
View Related
Mar 31, 2010
i need to compile a proc program, say prog.pc.have oracle 10g in my system. Since i am new to proc programming, me on the steps to compile the proc program in oracle proc compiler.
View 2 Replies
View Related
Aug 13, 2008
in my oci applications,if i get a column of number that is in the scope of int,i can use value = *(int *)field.data; get the value,but if the column size is larger than 10,the code can't be available,how can i get the value.
View 6 Replies
View Related
Nov 26, 2012
I am trying to call procedure from PRO C Procedure has many parameters and I do not need to put all of them when I call procedure. Is there way to make the same way as in PL/SQL
like this
my_procedure( q=>a1 , b=>'abc )
View 1 Replies
View Related
Aug 25, 2009
My program needs to connect to two databases and make operations in both databases:
Quote:connect to db1;
connect to db2;
select from table in db1;
update table in db2;
i would like to know whether it's possible, and how to do it ? how to specify for each query the database connection to use?
note that I can't use dblinks as i don't have enough access rights and privileges on neither of the databases.
View 2 Replies
View Related
Jan 30, 2009
How to report an Oracle bug? Is there webpage or email?
View 4 Replies
View Related
Sep 17, 2008
My OS is Linux and I installed Oracle 10.2. Everything is fine.I can use sqlplus, exp, imp etc with no problem.Now I have created another linux user test in /home/test. I unzipped basic-10.2xxxxxx.zip (/home/test/instantclient_10_2) and exported LD_LIBRARY_PATH.I guess I have installed instant client in this way.
My testOra.cpp:
#include <occi.h>
int main()
{
return 0;
}
This test.cpp would not compile. It cannot find occi.
View 8 Replies
View Related
Oct 7, 2010
I declare a cursor for a table with 8000 records, when I fetch the cursor this message appear ORA-03113: end-of-file on communication channels when the fetch reach the 6500 element, What is the problem here?. All data are ok, not null fields.
other problem
How I can reuse a cursor, I declare a cursor for a table where code_part = 300, then I fetch all elements until end cursor, then I close the cursor, Then I declare the same cursor again for the same table where code_part = 359, but it is not successful, when I tried to fetch the cursor again the cobol program show me the last record for the first code, How I can restart the cursor or delete it or freed the cursor position?
View 1 Replies
View Related
Apr 26, 2012
I am inserting empno in a table1 and updating another table2 using table1 empno and getting ora-01427 error. I want to print empno for whis this error is coming. How to print that value?
View 1 Replies
View Related
Dec 11, 2010
Can i convert a .c file to .pc file?The .c file is generated by compiling .pc file. I mistakenly deleted the .pc file. I need the original .pc file.
View 2 Replies
View Related
Apr 17, 2009
how to integrate SQLnet & c and I'm quite losted at the moment.
Searching with google gives some random stuff, which does seems to be irrelevant.some oracle db somewhere and need for good way to use that remote db (one solution seems to be using SQLnet).
View 1 Replies
View Related
Jun 1, 2010
If doing an insert into DATE type fields like below... how do I employ null indicator values with the TO_DATE sql to cope with NULL values for the End Date? I can test the NULLness of the pServiceRecord->itemTo value and set the indicator ind_dbToDate to -1 but I don't know how to incorporate this with the to_date syntax (if I can)?
EXEC SQL BEGIN DECLARE SECTION;
char dbFromDate[MAX_DATE_LEN];
char dbToDate[MAX_DATE_LEN];
short ind_dbToDate;
[code]...
View 2 Replies
View Related