REF 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 Wed, 03 Nov 2004 4:46 pm

GOOD I HAVE a PROBLEM with the REF CURSOR TYPE in VERSION 8.0.5 I DECLARE
Code: Select all
TYPE CURSOR_AUX IS REF CURSOR;
CURSOR_LOKO CURSOR_AUX;
and then when I TRY to BIND a VARCHAR2 VARIABLE with a SQL QUERY to the CURSORELE GIVES an ERROR PLS-00103: ENCOUNTERED the SYMBOL CMD_SQL when ONE of the FOLLOWING SYMBOLS was Expected: " SELECT "
Code: Select all
cmd_sql := 'SELECT DISTINCT(SYSFON.CDCHAVE) CDCHAVE FROM SYSFON :wc';

OPEN CURSOR_LOKO FOR cmd_sql using where_clause
I appreciate the help ... hugs!
MuLtAnI
Location: Videira - SC


Poston Wed, 03 Nov 2004 5:32 pm

Does not that is missing a Where clause?

Code: Select all
'SELECT DISTINCT(SYSFON.CDCHAVE) CDCHAVE FROM SYSFON :wc';
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 Wed, 03 Nov 2004 5:41 pm

Hello adds, as I am passing a string to the ref cursor when I step in using the variable where_clause how passed as a parameter a string equivalent to the sql command even if I run sql run
Code: Select all
        cmd_sql := 'SELECT DISTINCT(SYSFON.CDCHAVE) CDCHAVE FROM SYSFON WHERE :cm';
      
OPEN CURSOR_LOKO FOR cmd_sql using condition;
where condition is the string mounted on condition of My sql he says he found waiting cmd_sql Select
MuLtAnI
Location: Videira - SC


Poston Wed, 03 Nov 2004 5:48 pm

This works??
I found that USING it was just to pass values to the binds. (And do not use as replacement of variable code)

I will search this ...
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 Wed, 03 Nov 2004 5:53 pm

Actually I também não know if it works, I need to create a dynamic where clause and thought something like the excute immediate, but how do I need to treat the values returned from the query I thought of using a cursor and fetch, dae would only shoot but apparently I can não do that ... unless there's some way I não found or am unaware of work with the values returned from the execute immediate as if it were a cursor for example thanks for listening!!!

[] 's
MuLtAnI
Location: Videira - SC



  • See also
    Replies
    Views
    Last Post


      Return to PL/SQL

      Who is online

      Users browsing this forum: Google [Bot] and 4 guests