Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL Questions

PL/SQL Questions

From: Aik Khoon <panadol_at_singnet.com.sg>
Date: 1999/08/03
Message-ID: <7o4tig$hs1$1@clematis.singnet.com.sg>#1/1

Hi,

  1. For my application end (both VB and Java), besides returning resultsets (from table) using cursors, how could I possibly return values that I defined personally e.g. returning 'doc', c2 records rather than selecting specifically from columns c1 , c2 from table.

    I'm using WinNt Oracle8.

2. Just to check whether my way of coding PL/SQL statements is correct?

    create or replace package P1 as

      cursor cnC1 is select c1 from tab1;
      type cnC1cur is ref cursor return c1%ROWTYPE;
      function getC1 return cnC1cur;

    end P1;

    create or replace package body P1 as

      function getC1 return cnC1cur
      as
        l_cursor types.cursorType;
      begin
        open l_cursor is select c1 from tab1;
        return l_cursor;
      end;

    end P1;

    My question is whether it is efficient or needed to define the cursor     twice, once in the package header and another time in the function itself.

    Also is using function this way better or using a procedure with IN OUT settings

TIA,
Aik Khoon Received on Tue Aug 03 1999 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US