Is Spool command allowed using OCI programming? [message #93715] |
Fri, 01 November 2002 03:35 |
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 |
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.
|
|
|