execute immediate with cursor

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
  

Poston Fri, 12 May 2006 4:20 pm

To run the pl below error return, this correct the scope of pl?
I need help .... the most urgent possible.

Code: Select all
declare
msg varchar2(5000);
resp varchar2(1000);
begin
for c in ( select distinct table_name,column_name
           from all_cons_columns
           where table_name like 'DIM%'
           and constraint_name like '%FK'
           and owner = 'MDW'
           order by table_name) loop
      msg := 'SELECT COUNT(*) FROM ' || c.table_name || ' WHERE ' || c.column_name ||  '= -1;';
      EXECUTE IMMEDIATE msg  into resp;
    --  execute immediate 'SELECT COUNT(1) FROM ' || c.table_name  || ';' 
      --into msg;
      dbms_output.put_line (msg);   
  end loop;
end;
mrj
Location: Rio de janeiro - RJ

Poston Sat, 13 May 2006 9:55 pm

That error?
What do you do?
Maybe what you seek is already ready. Search the forum!

Gilberto
gilbertoca
Location: Palmas - TO


Poston Mon, 05 Jun 2006 12:50 pm

It seems that the problem is; that's after the -1.
I took it and the routine work.

Another thing: Your dbms_output.put_line is showing the SELECT and not the RESP.
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Mon, 12 Jun 2006 11:49 am

Only complementing dbms_output.put_line (resp);

[] 's
MuLtAnI
Location: Videira - SC



  • See also
    Replies
    Views
    Last Post


      Return to PL/SQL

      Who is online

      Users browsing this forum: Google Adsense [Bot] and 6 guests