Passing Queries to PL/SQL procedures

Hi,
Is there any way in PL/SQL procedure that i can pass two Queries Texts as parameters and return the result set by taking MINUS of the rwo Query results.
Thanx in Advace
Shafiq

Here is the principle...
SQL> conn scott/tiger
Connected.
SQL> CREATE OR REPLACE FUNCTION qry_minus
  2     (p1 IN VARCHAR2, p2 IN VARCHAR2)
  3     RETURN sys_refcursor
  4  IS
  5     return_value sys_refcursor;
  6  BEGIN
  7     OPEN return_value FOR p1||' MINUS '||p2;
  8     RETURN return_value;
  9  END;
10  /
Function created.
SQL> VAR q refcursor
SQL> exec :q := qry_minus('SELECT deptno FROM dept', 'SELECT deptno FROM emp')
PL/SQL procedure successfully completed.
SQL> print q
    DEPTNO
        40
SQL> Obviously because the query is text strings the calling program is responsible for ensuring the validity of the two queries (matching number and datatype of selected columns, etc).
Cheers, APC

Similar Messages

  • Passing parameters to pl/sql procedure called in portal

    Hi all,
    I am trying to use a javascript window.open function to create a small popup window that is populated by a pl/sql procedure from inside portal.
    I am trying to pass it a parameter to refine a SQL query running in that procedure, unfortunately I'm not sure of the syntax. The url that I'm trying to open in the new window looks like this:
    http://my.server.com:7777/portal/pls/portal/myschema.mypackage.myprocedure
    If I just run this, it works fine and the popup window opens correctly and displays all results. If I try to pass a parameter, it errors out with a 404 Page Not Found.
    The parameter itself comes from a text field that the user can enter a value into. I am able to get the value of that text field and append it to the url I'm generating, but I can't find the proper syntax.
    I've tried numerous syntax variants, but none of them seem to work. The procedure does have the parameter defined in both the spec and body and properly handles it. Can anyone point me in the right direction?
    Thanks,
    -Mike Markiw

    You said you have a text field where a user enters a value, so I am assuming that you have form...
    you can try following
    <form action="/pls/portal/myschema.mypackage.myprocedure" method="post">
    your text field "inVar"
    your submit button
    </form>
    I am sure your myprocedure has inVar as an input...
    If you just want to pass a value to a procedure you can always do following:
    http://my.server.com:7777/portal/pls/portal/myschema.mypackage.myprocedure?inVar=the value

  • Passing array to pl/sql procedure - pls-00306 wrong number/types of args

    its oracle 10.2 database;
    I have a procedure with array parameters based on simple sql types.
    eg
    create or replace type vt_attrname is table of varchar2(50);
    Now my call to the procedure works when the array is empty;
    as soon as I bulk collect into my local array, I get a compilation error.
    eg
    declare
    my_array  vt_attrname;
    begin
    select label
      bulk collect
      into my_array
      from table_name
    where 1=1;
    my_proc(p_array=>my_array);  -- syntax error
    end;if I pass null the call works but obviously array is empty.
    I have read something about varray's being incompatible between sqltypes and pl/sql.
    How do I get around this problem?
    The bulk collect is working okay.
    A small example would be appreciated.

    Yep, I spotted the syntax error earlier.
    However even though that seems to compile ok, I still get the problem with my package call.
    heres the actual call from the code
    vt_attrname and vt_attrvalues are types declared on another schema.
    I have redeclared them on the current schema now.
    create or replace type vt_attrname is table of varchar2(50);
    create or replace type vt_attrvalue is table of varchar2(500);
    create procedure <name>
    as
    v_cardapplattrtag   vt_attrname;
    v_cardapplattrvalue vt_attrvalue;
      for cardappl_cur in
        (select cardappl_id 
           from ci_cardappl
          where custcard_id = cur.document_logical_number)
        loop
        select label
          bulk collect
          into v_cardapplattrtag
          from ci_applver_attribute
          where applver_id = v_applver_id;
          v_array_size := v_cardapplattrtag.count;
        -- populate this array
        -- ppt_cardapplattrtag comes from ci_pplver_attribute
        --ppt_cardapplattrvalue -- various
    cci_setcardappl.SetCardApplAttrValue(
              pn_cardappl_id                 =>     cardappl_cur.cardappl_id,
              ppt_cardapplattrtag     =>      v_cardapplattrtag, -- works when null
              ppt_cardapplattrvalue   =>     NULL,
              pn_cardapplattrsize     =>     v_array_size,
              pv_arn                  =>     cur.application_request_id,
              pv_commit               =>    'FALSE');and the procedure protototype is
    PROCEDURE SetCardApplAttrValue(
              pn_cardappl_id           IN     NUMBER,
              ppt_cardapplattrtag     IN     VT_BPATTRNAME DEFAULT NULL,
              ppt_cardapplattrvalue   IN     VT_BPATTRVALUE DEFAULT NULL,
              pn_cardapplattrsize     IN     NUMBER,
              pv_arn                  IN     VARCHAR2,
              pv_commit               IN     VARCHAR2 DEFAULT 'FALSE');Edited by: Keith Jamieson on Sep 23, 2009 10:42 AM

  • Passing ARRAYs to PL/SQL procedure

    Hi,
    How do i pass an array(from java program) to pl/sql stored procedure, and after doing some data manipulation in the database, i wanted to pass back the same array to the java program. Can anyone help me or post some sample code here?
    Thanks in advance.
    Kumar
    null

    Are you hoping to use JDBC or ODBC to pass this array? If JDBC, I'd suggest asking this question on the JDBC forum.
    Justin Cave
    ODBC Development

  • Passing value from ADF to BPEL, and to PL/SQL  procedure

    1. I have created BPEL which take 2 inputs and concatenate them.
    2. have created a PL/SQL procedure for invoking this BPEL( working fine).
    Now i need to create a simple ADF page which contain 2 text box, 2 for input and 1 for result(concatenate), this will take 2 inputs and send them into BPEL, this will invoke the BPEL process and perform the necessary concatenate function...
    in addition to this, i am passing code into PL/SQL procedure ...
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/OrderImportDemo">
    <ns1:InputRequest>
    <ns1:FirstName>abcdef</ns1:FirstName>
    <ns1:LastName>aaaaaa</ns1:LastName>
    </ns1:InputRequest>
    </soap:Body>
    </soap:Envelope>';
    this code will take vaule from BPEL and run properly.
    can you please help me,

    thanks for help, but the problem is diff.
    i don't have any schema, what i want i need to create a adf page that will contain 3 tent field, 2 for input and 1 for output. when i will enter 2 input field and click on ok button, this will invoke BPEL, BPEL will take these 2 inputs and do the concat on this and send back to adf with result.

  • Passing variable values to pl/sql procedures

    Hi,
    I wanted to log the step name and message into a table whenever a particular step/interface failed in the ODI package.
    Ex:PKG1
    A----OK--->B----OK-->C--OK-->LOG SUCCESS status into table. All steps are sequenced.
    when not OK
    A----KO--->B----KO-->C--KO-->LOG failed status into table with step and message.
    I have created 4 variables in ODI and used these vairables in to pass values in pl/sql procedure scenario.
    I have drag and drop procedure scenario and given values to every variable...thing is for i want to get the step name dynamically for the procedure scenario's variable i am directly passing
    v_int_step=odiRef.getPrevStepLog("STEP_NAME").
    I dont want drag and drop procedure for each KO and then pass values to v_int_step=A or B or C .
    My scenario command look like this for KO
    OdiStartScen "-SCEN_NAME=PROC_LOGEXE_STATUS" "-SCEN_VERSION=-1" "-LOG_LEVEL=3" "-SYNC_MODE=1" "-SESSION_NAME=PROC_CSA_LOGEXE_STATUS_CS_BRANCHES" "-FLEXCUBE_OFSAA.v_execution_status=E" "-project1.v_scen_int_name=A" "-project1.v_batch_id=PKG_GLOBAL_MNT_HANDOFF" "-project1.v_step_name=odiRef.getPrevStepLog("STEP_NAME")"
    I am getting following error
    oracle.odi.oditools.OdiToolInvalidParameterException: Error while setting parameters on tool
         at com.sunopsis.dwg.function.SnpsFunctionBase.getCoreOdiTool(SnpsFunctionBase.java:607)
         at com.sunopsis.dwg.function.SnpsFunctionBase.getSunopsisApi(SnpsFunctionBase.java:480)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:1340)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2785)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Invalid parameter
         at com.sunopsis.dwg.function.SnpsFunctionBase.getCoreOdiTool(SnpsFunctionBase.java:599)
         ... 15 more
    Please help me ,
    Thanks In Advance

    Hi,
    Mistakes i found in the script,
    1. You need to pass the variables with the "-<YOUR PROJECT CODE>.VARIABLE NAME" which i suppose would be in UPPER CASE.
    2. You need to pass OdiPrevStepLog with <%=%> enclosed. So your script will looks like,
    OdiStartScen "-SCEN_NAME=PROC_LOGEXE_STATUS" "-SCEN_VERSION=-1" "-LOG_LEVEL=3" "-SYNC_MODE=1" "-SESSION_NAME=PROC_CSA_LOGEXE_STATUS_CS_BRANCHES" "-FLEXCUBE_OFSAA.v_execution_status=E" "-PROJECT1.v_scen_int_name=A" "-PROJECT1.v_batch_id=PKG_GLOBAL_MNT_HANDOFF" "-PROJECT1.v_step_name=<%=odiRef.getPrevStepLog( "STEP_NAME" )%>"
    Thanks,
    Guru

  • Pass arrays from Java to PL/SQL procedure.

    Hi All,
    Can some body give an example, where an array of strings is passed from java to a PL/SQL procedure.
    Any help in this regard is appreciated.
    Thanks,
    Prashant

    Kiran Kumar Gunda wrote:
    I would want to use Oracle provided (Oracle Extensions) API to pass arrays to PL/SQL
    procedure from Java. I am using weblogic connection pool, but the 'createDescriptor'
    method donot allow Pooled connection. So I have taken Physical Connection by casting
    to 'WLConnection'. Now, weblogic strongly suggest NOT to use this,as pooling capabilities
    will be disabled.
    But by setting RemoveInfectedConnectionsEnabled to false, we can ask weblogic
    to return the Physical Connection to Pool. I have tested this with the attached
    code. I DON'T find any issue.Good. The only real risk to obtaining the physical connection is retaining and
    using it beyond the current thread execution. Your code looks OK. The only thing
    I'd suggest is to add to the finally block. I would put a separate try-catch-ignore
    block around every action in the finally, so if one fails, the others are still
    done.
    As long as you're writing good JDBC like that, there is no risk to telling the
    pool to trust the code, by setting RemoveInfectedConnectionsEnabled to false.
    That way you'll retain all the performance of the pools.
    Joe
    >
    I want your opinion in this, so that I will be confident in using this feature
    in our application.
    Note : Please look at the sample code that I am using. I AM NOT GOING TO USE PHYSICAL
    CONNECTIONS for normal operations. I will use Physical Connection only when I
    want to pass Arrays to Oracle.
    Thanks
    Kiran

  • Send Datetime2 value to a SQL Procedure from Java using Hibernate

    Hi All,
    I Have a Procedure which takes a parameter of type datetime2.
    The procedure is called from Java Hibernate.
    How can I Pass datetime2 value to SQL procedure from Java?
    Thanks in advance,
    Shraddha Gore

    You may define a global empty array in some package. Then you can do:
    SQL> CREATE OR REPLACE PACKAGE pkg
    AS
       g_empty   DBMS_SQL.varchar2_table;
    END pkg;
    Package created.
    SQL> CREATE OR REPLACE PROCEDURE p (
       p_tuids   IN   DBMS_SQL.varchar2_table "DEFAULT pkg.g_empty"
    AS
    BEGIN
       NULL;
    END p;
    Procedure created.
    SQL> BEGIN
       p ();
    END;
    PL/SQL procedure successfully completed.

  • PL/SQL stored procedure and passing queries

    Hi all.
    This is a really "newbie"-type question....sorry !
    I have written a PL/SQL procedure which takes a query (as varchar2) as an argument and returns the result in xml as a clob.
    ie: SELECT returnXML('SELECT * FROM test_table') FROM DUAL;
    This works fine, however how do I pass a query that also contains single quotes ?? I have tried escaping them in C-style with backslashes, but to no avail. As an example, I'd like to pass the following query to my procedure:
    SELECT * FROM test_table WHERE name='TEST' AND id='200'
    Any help would be greatly appreciated.
    Regards,
    Kristian.

    Try doubling up the quotes, ie
    SELECT returnXML('SELECT * FROM test_table WHERE name=''TEST'' AND id=''200''') FROM DUAL;

  • Passing table data to pl sql procedure oaf

    Hi All,
    I have a requirement where i have to pass table data to plsql procedure.
    In the first page i select the REQUISITION and click on RETURN button and it will take me to the next page.
    and in the Next page i will click on APPLY button.
    When i click on APPLY, it will call the procedure and will give input to the procedure whatever has been selected when i have selected requisition.
    Please help. Please tell me the approach how to get this task done. A sample code will work.
    Hope the requirement is clear.
    Thanks in Advance.

    Hi Chinmay,
    Refer below code for Your Requirement.
    //Code For Quering Data
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
    String Query = "SELECT organization_id FROM hr_operating_units WHERE organization_id = fnd_global.org_id";
    PreparedStatement stmt = conn.prepareStatement(Query);
    resultset=stmt.executeQuery();
    while (resultset.next())
    orgId = (String)resultset.getString("ORGANIZATION_ID").toString();
    conn.commit();
    catch(Exception e)
    e.printStackTrace();
    //Code for Pass Resulted column to Procedure Input for delete Particular Record
    Execute parameterized PL SQL procedure from OAF page
    Let us try to call PL/SQL package from OAF page. We will try to remove selected line from Database.
    Package Spec
    CREATE OR REPLACE PACKAGE APPS.genpack_pkg
    AS
    PROCEDURE roll_delete_proc (orgId IN VARCHAR2);
    END genpack_pkg;
    Package Body
    CREATE OR REPLACE PACKAGE BODY APPS.genpack_pkg
    AS
    PROCEDURE roll_delete_proc (orgId IN VARCHAR2)
    AS
    BEGIN
    DELETE FROM pklist_roll_details_temp
    WHERE roll_line_id = orgId;
    COMMIT;
    END roll_delete_proc;
    END genpack_pkg;
    //in Controller PFR
    import java.sql.CallableStatement;
    if (pageContext.getParameter("ActionsButton") != null)
    String val = pageContext.getParameter("ActionsChoice");
    if ("DELLN".equals(val))
    CallableStatement cstmt = null;
    for (OAViewRowImpl row = (OAViewRowImpl)tempvo.first(); row != null; row = (OAViewRowImpl)tempvo.next()) {
    if ((row.getAttribute("Selectflag") == null) ||
    (!row.getAttribute("Selectflag").toString().equals("Y"))) continue;
    try {
    int rollid = Integer.parseInt((String)row.getAttribute("orgId"));
    Connection conn = am.getOADBTransaction().getJdbcConnection();
    if (rollid == 1)
    temphm.put(row.getAttribute("orgId").toString(), row.getAttribute("PoNumber").orgId());
    tempvo.removeCurrentRow();
    else
    try
    StringBuilder sb = new StringBuilder();
    sb.append(rollid);
    String strI = sb.toString();
    System.out.println("Inside else in delete");
    cstmt = conn.prepareCall("{call GENPACK_PKG.tpc_roll_delete_proc(?)}");
    cstmt.setString(1, strI);
    System.out.println("Oracle Callable Statment Execution Init for Delete");
    cstmt.execute();
    catch (SQLException e) {
    throw new OAException(e.toString(), (byte)0);
    }tempvo.removeCurrentRow();
    catch (OAException e) {
    throw new OAException("No row selected", (byte)3);
    Thanks,
    Dilip

  • Passing variable of size greater than 32767 from Pro*C to PL/SQL procedure

    Hi,
    I am trying to pass a variable os size greater than 32767 from Pro*C to an SQL procedure.I tried assigning the host variable directly to a CLOB in the SQL section but nothing happens.In the below code the size of l_var1 is 33000.PROC_DATA is a procedure that takes CLOB as input and gives the other three(Data,Err_Code,Err_Msg) as output.These variables are declared globally.
    Process_Data(char* l_var1)
    EXEC SQL EXECUTE
    DECLARE
    l_clob clob;
    BEGIN
    l_clob := :l_var1
    PROC_DATA(l_clob,:Data,:Err_Code,:Err_Msg) ;
    COMMIT;
    END;
    END-EXEC;
    I also tried using DBMS_LOB.This was the code that i used.
    Process_Data(char* l_var1)
    EXEC SQL EXECUTE
    DECLARE
    l_clob clob;
    BEGIN
    DBMS_LOB.CREATETEMPORARY(l_clob,TRUE);
    DBMS_LOB.OPEN(l_clob,dbms_lob.lob_readwrite);
    DBMS_LOB.WRITE (l_clob, LENGTH (:l_var1), 1,:l_var1);
    PROC_DATA(l_clob,:Data,:Err_Code,:Err_Msg) ;
    COMMIT;
    END;
    END-EXEC;
    Here since DBMS_LOB packages allow a maximum of 32767,the value of l_var1 is not being assigned to l_clob.
    I am able to do the above process provided i split l_var1 into two variables and then append to l_clob using WRITEAPPEND.i.e l_var1 is 32000 in length and l_var2 contains the rest.
    Process_Data(char* l_var1,char* l_var2)
    EXEC SQL EXECUTE
    DECLARE
    l_clob clob;
    BEGIN
    dbms_lob.createtemporary(l_clob,TRUE);
    dbms_lob.OPEN(l_clob,dbms_lob.lob_readwrite);
    DBMS_LOB.WRITE (l_clob, LENGTH (:l_var1), 1,:l_var1);
    DBMS_LOB.WRITEAPPEND (l_clob, LENGTH(:l_var2), :l_var2);
    PROC_DATA(l_clob,:Data,:Err_Code,:Err_Msg) ;
    COMMIT;
    END;
    END-EXEC;
    But the above code requires dynamic memory allocation in Pro*C which i would like to avoid.Could you let me know if there is any other way to perform the above?

    Hi,
    The Long Datatype has been deprecated use Clob or Blob. This will solve lot of problems inherent with the datatype.
    Regards,
    Ganesh R

  • Passing a structure from Java to PL/SQL Procedure

    Environment: Oracle DB, Tomcat/Apache
    How do we pass a structure (Table Record Type) from Java to a PL/SQL Stored Procedure?
    We are doing JSP-->JavaClass/Bean to communicate to DB. We have an existing PL/SQL packages/Procedure to insert records into table (These procedures have record types as in/out parameters). So is there a way to call these from Java?
    Thanks in advance.
    Ramesh

    Oracle9 i JDBC Developers Guide and Reference(page 21-16):
    It is not feasible for Oracle JDBC drivers to support calling arguments or return
    values of the PL/SQL RECORD, BOOLEAN, or table with non-scalar element types.
    However, Oracle JDBC drivers support PL/SQL index-by table of scalar element
    types. For a complete description of this, see "Accessing PL/SQL Index-by Tables"
    on page 16-21.
    As a workaround to PL/SQL RECORD, BOOLEAN, or non-scalar table types, create
    wrapper procedures that handle the data as types supported by JDBC. For example,
    to wrap a stored procedure that uses PL/SQL booleans, create a stored procedure
    that takes a character or number from JDBC and passes it to the original procedure
    as BOOLEAN or, for an output parameter, accepts a BOOLEAN argument from the
    original procedure and passes it as a CHAR or NUMBER to JDBC. Similarly, to wrap a
    stored procedure that uses PL/SQL records, create a stored procedure that handles
    a record in its individual components (such as CHAR and NUMBER) or in a structured
    object type. To wrap a stored procedure that uses PL/SQL tables, break the data
    into components or perhaps use Oracle collection types.

  • How to pass values to select clause in PL/SQL procedure

    Am relatively new to PL/SQL programming and ran into the following issue...
    Table
    EMP_MASTER
    ID VARCHAR2(10);
    FIRSTNAME VARCHAR2(20);
    DATA FOR EMP_MASTER
    '1','SCOTT'
    '2','TIGER'
    I ran the following SQL Query
    SELECT COUNT(*) FROM EMP_MASTER WHERE FIRSTNAME IN ('SCOTT','TIGER');
    This select Query is working fine and we get the count = 2 as
    expected. Now I want a procedure for the same fn()
    CREATE OR REPLACE PROCEDURE TEST_EMP_MASTER(NAMELIST IN VARCHAR2)
    IS
    CNT NUMBER := 0;
    BEGIN
    SELECT COUNT(*) INTO CNT FROM EMP_MASTER WHERE FIRSTNAME IN (NAMELIST);
    DBMS_OUTPUT.PUT_LINE('Output-->NAMELIST:'||NAMELIST||':cnt:'||cnt);
    END;
    Now when I test the procedure by passing just one value its working
    fine. But when I want to pass multiple values, it doesnt work!
    set serveroutput on;
    i.e exec TEST_EMP_MASTER('SCOTT'); Works and the output is
    Output--->NAMELIST:SCOTT:cnt:1
    but don't get the expected output for exec TEST_EMP_MASTER('SCOTT,TIGER');
    I understand that the IN modifier in the WHERE clause expects the
    values as 'Value1','value2'....I tried different combination by the
    passing the values with quotes '''value1'',''value2'''.....but no
    success

    Select  e.*
    From EMP_MASTER e;
            ID     FIRSTNAME
    1     1     SCOTT
    2     2     TIGER
    3     3     CAT
    4     4     MOUSE
    SQL> create or replace procedure count_emp_master (p_namelist VARCHAR2)
      2  AS
      3     v_namelist   VARCHAR2 (1000) := p_namelist;
      4     v_name Varchar2(100);
      5     v_count Number := 0;
      6     p_count_emp  Number := 0;
      7  BEGIN
      8     v_namelist := ',' || v_namelist || ',';
      9 
    10     FOR cur IN 1 .. LENGTH (v_namelist) - LENGTH (REPLACE (v_namelist, ',', '')) - 1
    11     LOOP
    12        v_name := (SUBSTR (v_namelist,
    13                          INSTR (v_namelist, ',', 1, cur) + 1,
    14                          INSTR (v_namelist, ',', 1, cur + 1)
    15                          - INSTR (v_namelist, ',', 1, cur) - 1
    16                         ));
    17     Select Count(1)
    18     Into v_count
    19     From emp_master
    20     Where FIRSTNAME =  v_name;
    21 
    22     p_count_emp := p_count_emp + v_count;;
    23 
    24     END LOOP;
    25 
    26     dbms_output.put_line ('namelist --> '||p_namelist ||'p_count_emp -->'||p_count_emp);
    27  END count_emp_master;
    28  /
    Procedure created
    SQL> exec count_EMP_MASTER('SCOTT');
    namelist --> SCOTTp_count_emp -->1
    PL/SQL procedure successfully completed
    SQL> exec count_EMP_MASTER('SCOTT,TIGER');
    namelist --> SCOTT,TIGERp_count_emp -->2
    PL/SQL procedure successfully completed
    SQL> exec count_EMP_MASTER('SCOTT,TIGER,CAT');
    namelist --> SCOTT,TIGER,CATp_count_emp -->3
    PL/SQL procedure successfully completed
    SQL> exec count_EMP_MASTER('SCOTT,TIGER,CAT,MOUSE');
    namelist --> SCOTT,TIGER,CAT,MOUSEp_count_emp -->4
    PL/SQL procedure successfully completed
    SQL> Message was edited by:
    Nicloei W

  • Passing a list into a sql procedure via a unix shell.

    9.2.0.6
    for some dumb reason we cannot use java to do this task.
    anyways
    I need to build a list of all file in a particular directory. The list could be zero to very very long. I would like to be able to pass that list to a PL/SQL procedure.
    this is in unix
    I think I could do something like
    var=f1,f2,f3,f4
    sqlplus blah/blah $var
    exec my_proc(&var);
    I guess that would handle up to 32k in length. It would be up to me to parse the list.
    I am really looking for an way to do this a bit slicker.. like with a ref cursor but I seem to be getting stuck.
    Thanks

    Some examples here :
    Re: How to pass Character parameter
    Nicolas.

  • How to pass class object  as in parameter in call to pl/sql procedure ?

    hi,
    i have to call pl/sql proecedure through java. In pl/sql procedure as "In" parameter i have created "user defined record type" and i am passing class object as "In" parameter in call to pl/sql procedure. but it is giving error.
    so, anyone can please tell me how i can pass class object as "In" parameter in call to pl/sql procedure ?
    its urgent ...
    pls help me...

    793059 wrote:
    I want to pass a cursor to a procedure as IN parameter.You can use the PL/SQL type called sys_refcursor - and open a ref cursor and pass that to the procedure as input parameter.
    Note that the SQL projection of the cursor is unknown at compilation time - and thus cannot be checked. As this checking only happens at run-time, you may get errors attempting to fetch columns from the ref cursor that does not exist in its projection.
    You also need to ask yourself whether this approach is a logical and robust one - it usually is not. The typical cursor processing template in PL/SQL looks as follows:
    begin
      open cursorVariable;
      loop
        fetch cursorVariable bulk collect into bufferVariable limit MAX_ROWS_FETCH;
        for i in 1..bufferVariable.Count
        loop
          MyProcedure( buffer(i) );   --// <-- Pass a row structure to your procedure and not a cursor
        end loop;
        ..etc..
        exit when cursorVariable%not_found;
      end loop;
      close cursorVariable;
    end;

Maybe you are looking for

  • Size of image is getting increased

    Hi I have cross compiled BDB using m68k-elf toolchain. I'm using motorola coldfire processor with uClinux for our development purpose. Now I need to include BDB into uClinux and flash it into our processor. The flash we are using is 4mb. The image I

  • Do you NEED iWeb'08 to publish to .Mac under your domain name?

    Hi everyone, I want to publish my site to my .Mac space under my own domain name: do I need iWeb'08 to do that? The rest I prefer to do myself: design my site from scratch editing the html code -I believe you can't do that with iWeb, right? I'm askin

  • DHCP-Server (2008 R2) is not updating Reverse-DNS-Pointer

    Hi there, we have a 2008 R2 DHCP running. The DHCP is using an user which is member of "DnsUpdateProxy"-AD-Group to create, update and delete DNS-entries. Also the Option "Always dynamically update dns A and ptr records" is set! Now I have a strange

  • Uploading the Notes text pool using Conversion method for Dispute Cases.

    Hi Everybody, Please can anybody give the solution for uploading the Notes textarea in tab(Notes in dispute cases) using BDC method for transaction FDM_AUTO_CREATE(Dispute Cases). Here, the problem is, Notes is text area which is not having proper re

  • Printing Like a Magazine

    I'm printing a "magazine" style directory that I want stapled bound. Ideally I'd like it to be printed double-sided on 11x17 paper then when folded it will be two facing 8.5 x 11 pages. How do I set it up Pages to comply with the tricky pagination an