Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Dynamic SQL
Thank you all for help!
Greg
Jared Still <jkstill_at_gmail.com> wrote:
This is probably close to what you are trying to do:
create table audittrail
as
select created dated, object_name details, owner moduser, 8 action
from
dba_objects
where rownum <= 10
/
DECLARE
m_dated DATE; m_count NUMBER(10); m_details varchar2(4000); m_moduser varchar2(250);
open m_cursor for 'select Dated, Details, Moduser from ' || r.owner || '.audittrail where action = 8'; LOOP fetch m_cursor into m_dated,m_details,m_moduser; exit when m_cursor%notfound; dbms_output.put_line ( m_dated || ':' || m_details || ':' || m_moduser); END LOOP;
Some serious study of the PL/SQL, PL/SQL supplied packages and SQL manuals is suggested
On 4/6/06, ora_forum <ora_forum_at_yahoo.com> wrote: Hi All: Could you tell me what I'm doing wrong? I need pass different schema owner in SQL, also in some tables there are multiple records will be returned.
DECLARE
m_dated DATE ; m_count NUMBER(10); m_details varchar2(4000); m_moduser varchar2(250);
Thanks.
-- Jared Still Certifiable Oracle DBA and Part Time Perl Evangelist --------------------------------- New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. -- http://www.freelists.org/webpage/oracle-lReceived on Thu Apr 06 2006 - 15:05:37 CDT