pl help

Results 1 to 2 of 2

Thread: pl help

  1. #1
    Join Date
    Dec 1969

    Default pl help

    Hi,<BR>I am using ASP with Oracle.<BR>I have a doubt regarding ref cursors.<BR>I am using a package which contains a procedure.<BR>In the procedure I am using ref cursor.<BR>Depending on the if condition I open the cursor.<BR>I am not closing the cursor.<BR><BR>E.g., :-<BR>CREATE OR REPLACE PACKAGE S3<BR>AS<BR>TYPE CURSOR_TYPE IS REF CURSOR;<BR>PROCEDURE A3( Code IN Varchar2,A_RESULT_SET OUT CURSOR_TYPE);<BR>END;<BR>/<BR>CREATE OR REPLACE PACKAGE BODY S3<BR>AS<BR>Procedure A3<BR>(<BR>Code IN Varchar2, <BR>A_RESULT_SET OUT CURSOR_TYPE<BR>)<BR>AS<BR><BR>BEGIN<BR><BR>IF Code = &#039;Q&#039; then <BR>Open A_RESULT_SET for<BR>Select PNumber,ANumber,AType,Sc,TO_CHAR(EDate,&#039;MM/DD/YYYY&#039;) as EDate <BR>From S_AR<BR>END IF;<BR>IF Code = &#039;M&#039; then<BR>Open A_RESULT_SET for<BR>Select ATypeID,AType From S_ATypes; <BR>END IF;<BR><BR>END A3;<BR>END;<BR><BR>I am calling this procedure in ASP.<BR>I do not want to declare another cursor/variables,fetch this ref cursor into it <BR>and then close it because there r so many if conditions and the tables,columns and all are different.<BR>Will I face any problem in future bec I am not closing these cursors?<BR>PL help me. <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: pl help

    I don&#039;t know Oracle that well, but in SQL Server you will have problems when you don&#039;t close and deallocate the cursor. I think this is true for Oracle also.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts