Home » Developer & Programmer » Precompilers, OCI & OCCI » Is Spool command allowed using OCI programming?
Is Spool command allowed using OCI programming? [message #93715] Fri, 01 November 2002 03:35 Go to next message
fa
Messages: 1
Registered: November 2002
Junior Member
Hello,

i want to spool the query result as it will be very big with two columns and many rows.
my application is in c. i am using OCIAPI. who do i spool the query result?
Or is there any alternative to store the query result?

Thanks in advance...
Re: Is Spool command allowed using OCI programming? [message #93723 is a reply to message #93715] Sun, 10 November 2002 22:18 Go to previous message
Gnanam
Messages: 19
Registered: July 2002
Junior Member
Hi,
I don't know what is OCIAPI...
but in Pro*C
1. Declare one cursor for select all the data like
EXEC SQL AT DB_NAME
DECLARE CURSOR CUR_NAME FOR
SELECT field1,...
FROM TABLE_NAME;
2. Open the cursor by using
OPEN CURSOR CUR_NAME;
3. Fetche the cursor into bind variable (or bind array)
FETCH CUR_NAME INTO :var1,:var2,...;
4. write the variables into a file
fprintf(fp,"%s",var1.arr);

This is the way to spool the selected values into a file.
Previous Topic: How to Read Long law In Pro*c,Oracle8.0.5!
Next Topic: Re: want to download Pro*c/C++ compiler free download site
Goto Forum:
  


Current Time: Thu Apr 18 11:54:01 CDT 2024