sql - Oracle: Opening the same cursor within different IF statements -


Is it possible to open a cursor within a IF statement block:

  Process pattern (Ultimate, IoCoSers inTickers in IIT) ISV Coser Tickser; BEGIN If the Ultimate = 1 then select from Table 1 to IN.ER, open v_cursor for a.field, table.b at b.fieldid = a fieldid; Io_cursor: = v_cursor; Close v_cursor; ELSIF Ultimate = 2 Select from a.field, from c.field to Table 1 Join an INNER Include b.fieldid = a.fieldid INNER on table 2b table3c ON c.fieldid = a.fieldid; Io_cursor: = v_cursor; Close v_cursor; end if; End Consortium;   

So basically, the cursor must be filled in by the target, on which the if statement is correct.

I do not see any problems with your requirement and your efforts. Since, the IF-ELSE condition is not allowed in the cursor, however, in PL / SQL , you can do REF CURSOR : Ders Koor Ref Croser; If BEGIN (so many more) then the 'selection' from 'selection' is 'Table_1'; ELSE (so and so) is open and 'Select * Form Table_2'; end if ; End;

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -