RE: Passing parameters

RE: Passing parameters

 

  

Michael -
table name is not a field that can be passed as a parameter. If you want to use a select which operates on different tables then you must use dynamic sql:

open x for 'select * from ' || table_name_varable || ' order by type';
loop
process/exit when x%notfound;
end loop;

x must be a ref cursor type

michael smith


-----Original Message-----
From: Michael Bacchus
[mailto:oracledba-ezmlmshield-x19987851.[Email address protected]
Sent: Thursday, February 23, 2006 4:08 PM
To: LazyDBA Discussion
Subject: Passing parameters



Hello all,

I am attempting to compile a script with a cursor that a parameter in
place of a file name. The compile fails on the table name in the cursor.
Could you tell me
Where I am going wrong.

Listed is part of the script:-
PROCEDURE MANDEEP_OPTION_SELECTION (cursorType number := 1, tableName
varchar := 'someTable') IS
cursor types is
select *
from tableName --request_types(this is the actual table) -- it fails
here
order by type;



Best regards,
Michael Bacchus

Research In Motion Ltd.
BlackBerry: 519.573.6823
Phone: 519.888.7465 x 5853
Fax: 519.886.0863
mailto:[Email address protected]
www.rim.com or www.blackberry.com




---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:http://www.lazydba.com/legal.html


Oracle LazyDBA home page