Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Procedure to show and spool all the results
On 2005-03-25, jackfung188_at_gmail.com <jackfung188_at_gmail.com> wrote:
> Thanks, but suppose the customer_id and product_id is not a number (eg.
> A1, A2, etc), how should I change it because I got this error
> ORA-00904: invalid column name
where customer_id = '&cust_id'
hth
Rene
>> define cust_id = &customer_id
>> spool &cust_id..csv
>> select col1||','||col2||','||col3||','||....
>> from ...
>> where customer_id = &cust_id
>> /
>> spool off
>> undefine cust_id
>>
>> define prod_id = &product_id
>> spool &prod_id..csv
>> ....
>> ....
>> spool off
>> undefine prod_id
>>
>> You will be prompted for customer_id and product_id.
>>
>> Regards
>> /Rauf
>
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Fri Mar 25 2005 - 14:37:59 CST
![]() |
![]() |