Using Ref cursor from Procedure output in BPEL

Hi
Can any body help me ..
The output variable of db adapter is refcursor from stored procedure. in ref cursor i will get xml from a clob variable. how to use it in bpel...can an body help me how to do it....

APEX is based on Oracle Database. Whatever you can do with PL/SQL, the same can be done with APEX also. APEX stores the application definition in the form of metadata.
So if you put all your logic and code in packages, procedures or functions then it will be really good compact and modular approach.
Bottom line is that you can do all of those.
Check the documentation at
http://www.oracle.com/technetwork/developer-tools/apex/documentation/index.html
Thanks,
Mehabub

Similar Messages

  • How return parameter ref Cursor from procedure using dynamic SQL?

    I sorry, but i very need help.
    I using Oracle 8.0.6
    I need to return parameter of type ref Cursor from procedure.
    create or replace package PlanExp is
    type cursortype is ref cursor;
    procedure ShowPlan (cursorparam out
    cursortype.............);
    end PlanExp;
    create or replace package body PlanExp is
    procedure ShowPlan (cursorparam out cursortype,
    .............) Is
    sql_str varchar2(1000);
    sql_str_select varchar2(100);
    sql_str_from varchar2(100);
    sql_str_where varchar2(500);
    Return_Code integer;
    Num_Rows integer;
    cur_id_sel integer;
    tSum_Plan DBMS_SQL.NUMBER_TABLE;
    tSum_Plan_Ch DBMS_SQL.NUMBER_TABLE;
    tSum_Plan_Day DBMS_SQL.NUMBER_TABLE;
    begin
    /* calculating string variables ........... /*
    sql_str := 'select ' || sql_str_select ||
    'from ' || sql_str_from ||
    'where ' || sql_str_where ||
    'group by ' || sql_str_select;
    cur_id_sel := dbms_sql.open_cursor;
    dbms_sql.parse(cur_id_sel, sql_str, dbms_sql.native);
    dbms_sql.define_array(cur_id_sel, 1, tSum_Plan, 20, 1);
    dbms_sql.define_array(cur_id_sel, 2, tSum_Plan_Ch, 20, 1);
    dbms_sql.define_array(cur_id_sel, 3, tSum_Plan_Day, 20, 1);
    Return_Code := dbms_sql.execute(cur_id_sel);
    delete from TEMP_SHOWPLAN;
    Loop
    Num_Rows := dbms_sql.Fetch_Rows(cur_id_sel);
    dbms_sql.column_value(cur_id_sel, 1, tSum_Plan);
    dbms_sql.column_value(cur_id_sel, 2, tSum_Plan_Ch);
    dbms_sql.column_value(cur_id_sel, 3, tSum_Plan_Day);
    if Num_Rows = 0 then
    exit;
    end if;
    Exit When Num_Rows < 20;
    End Loop;
    dbms_sql.close_cursor(cur_id_sel);
    end;
    end PlanExp;
    How return cursor (cursorparam) from 3 dbms_sql.column_value-s ?

    I am using Oracle 8.1.7, so I don't know if this will work in
    8.0.6 or not:
    SQL> CREATE TABLE test
      2    (col1                    NUMBER,
      3     col2                    NUMBER,
      4     col3                    NUMBER)
      5  /
    Table created.
    SQL> INSERT INTO test
      2  VALUES (1,1,1)
      3  /
    1 row created.
    SQL> INSERT INTO test
      2  VALUES (2,2,2)
      3  /
    1 row created.
    SQL> INSERT INTO test
      2  VALUES (3,3,3)
      3  /
    1 row created.
    SQL> CREATE TABLE temp_showplan
      2    (tSum_Plan               NUMBER,
      3     tSum_Plan_Ch            NUMBER,
      4     tSum_Plan_Day           NUMBER)
      5  /
    Table created.
    SQL> EDIT planexp
    CREATE OR REPLACE PACKAGE PlanExp
    IS
      TYPE CursorType IS REF CURSOR;
      PROCEDURE ShowPlan
        (cursorparam    IN OUT CursorType,
         sql_str_select IN     VARCHAR2,
         sql_str_from   IN     VARCHAR2,
         sql_str_where  IN     VARCHAR2);
    END PlanExp;
    CREATE OR REPLACE PACKAGE BODY PlanExp
    IS
      PROCEDURE ShowPlan
        (cursorparam    IN OUT CursorType,
         sql_str_select IN     VARCHAR2,
         sql_str_from   IN     VARCHAR2,
         sql_str_where  IN     VARCHAR2)
      IS
        sql_str                VARCHAR2 (1000);
        cur_id_sel             INTEGER;
        return_code            INTEGER;
      BEGIN
        DELETE FROM temp_showplan;
        sql_str := 'INSERT INTO   temp_showplan '
               || ' SELECT '   || sql_str_select
               || ' FROM '     || sql_str_from
               || ' WHERE '    || sql_str_where;
        cur_id_sel := DBMS_SQL.OPEN_CURSOR;
        DBMS_SQL.PARSE (cur_id_sel, sql_str, DBMS_SQL.NATIVE);
        return_code := DBMS_SQL.EXECUTE (cur_id_sel);
        DBMS_SQL.CLOSE_CURSOR (cur_id_sel);
        OPEN cursorparam FOR SELECT * FROM temp_showplan;
      END ShowPlan;
    END PlanExp;
    SQL> START planexp
    Package created.
    Package body created.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC PlanExp.ShowPlan (:g_ref, 'col1, col2,
    col3', 'test', ' 1 = 1 ')
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    TSUM_PLAN TSUM_PLAN_CH TSUM_PLAN_DAY
             1            1             1
             2            2             2
             3            3             3

  • How to out Dynamic ref cursor from Procedure to Forms

    Hi
    I am trying to out Dynamic ref cursor from Procedure to Forms, But I am unable to do so. however cursor return the value within procedure but I am failed to capture the same in Forms
    Pl advice suggestion if any, Here I am attaching full procedure for reference
    CREATE PACKAGE winepkg
    IS
    TYPE wine IS RECORD ( mynumber number);
    /* Define the REF CURSOR type. */
    TYPE wine_type IS REF CURSOR RETURN wine;
    END winepkg;
    CREATE procedure find_wine
    (col1_in in number,
    c1 out winepkg.wine_type) as
    vsql varchar2(1000);
    cur sys_refcursor;
    x number;
    BEGIN
    vsql:='select bo_id from bo_details where bo_details.bo_id = '||col1_in ;
    open cur for vsql;
    c1:=cur;
    --fetch c1 into x;
    --dbms_output.put_line(x);
    END find_wine;
    In front end forms
    Declare
    TYPE F is REF CURSOR;
    CUR_F F;
    rec number;
    Begin
    break;
    find_wine( 1601480000011078,cur_f ) ;
    Loop
    fetch cur_f into rec ;
    Message(rec ) ;pause;
    exit when cur_f%notfound ;
    End loop ;
    exception
    when others then
    Message(sqlerrm) ;pause;
    End ;

    yo can use
    declare
    c_cursor EXEC_SQL.CursType;
    v_stmt varchar2(2000) = 'select a, b, c from mytab where cond1'; -- you can create this value dynamically
    begin
    c_cursor := Exec_SQL.Open_cursor;
    EXEC_SQL.PARSE(c_articulos, v_stmt);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,1, v_colchar1, 30);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,2, v_colchar2, 15);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,3, v_colchar3, 30);
    v_exec := EXEC_SQL.EXECUTE(c_cursor);
    WHILE EXEC_SQL.FETCH_ROWS(c_cursor) > 0 LOOP
    EXEC_SQL.COLUMN_VALUE(c_cursor,1,v_colchar1);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,2,v_colchar2);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,3,v_colchar3);
    assign_values_to_block;
    END LOOP;
    EXEC_SQL.CLOSE_CURSOR(c_cursor);
    end;
    and WORKS IN FORMS 6

  • Using REF CURSOR from JDBC?

    How do I use a REF CURSOR OUT parameter present in a Stored Procedure from my JDBC program?

    here is an example, calling a packaged function. 1st param is delared as IN OUT REF CURSOR.
    CallableStatement cs = conn.prepareCall("{? = call myPackage.myFunc(?,?)}");
    cs.registerOutParameter (1, OracleTypes.INTEGER);
    cs.registerOutParameter (2, OracleTypes.CURSOR);
    cs.setInt(3,mInt.intValue());
    boolean boolValue = cs.execute();
    ResultSet cursor = ((OracleCallableStatement)cs).getCursor (2);
    i hope this helps.
    null

  • Using Ref Cursor in procedure in place of normal cursor

    Hi,
    I have a procedure where i have the follwoing cursors declared,
    CURSOR c_wip IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'WIP_QUEUES%';
    CURSOR c_pending IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'PENDING_QUEUES%';
    CURSOR c_out IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'OUT_QUEUES%';
    CURSOR c_out_status IS
    SELECT tdvalue
    FROM tabledetails
    WHERE tdidcode = 'PEL_DASHBOARD'
    AND tdkey LIKE 'OUT_STATUS%';
    Will the usage of 1 ref cursor instead of the 4 cursors increase the performance.
    Thanks.

    Cursor is a structure which points to a memory locations.
    While a Ref-cursor is a datastructure which point to a object which inturn points to Memory locations.
    The advantage of having Ref-cursor is that we can pass dynamically the Ref-cursor as a parameter to a procedures.
    So it does improve the performance to a small extent.

  • Using Ref cursor in Procedure.

    Hi All,
    Can i use a single ref cursor multple times within the life cycle of a procedure.
    Thanks,
    Dillip

    Yes.
    See the example here. A cursor expression is selected - repeatedly, within a loop - into emp_cur (which is of type REF CURSOR) - and emp_cur is then used to process it in a nested loop.
    (By the way - this question would be better asked in the PL/SQL).
    Regards Nigel

  • Problem in using ref cursor

    I have a procedure which is using one ref cursor as OUT paramater. Now when I call this procedure, it gives me the following error:
    ORA-00932: inconsistent datatypes: expected CURSER got NUMBER
    ORA-06512: at "APPS.ORDER_RETURN1", line 8
    ORA-06512: at "APPS.ORDER_RETURN2", line 4
    ORA-06512: at line 1
    Below is my code
    PROCEDURE ORDER_RETURN1(p_order OUT sys_refcursor) IS
    TYPE OE_ORDER_rcur IS REF CURSOR;
    rcur OE_ORDER_rcur;
    BEGIN
    OPEN rcur FOR
    SELECT ORDER_NUMBER FROM OE_ORDER_HEADERS_ALL WHERE ROWNUM < 4;
    FETCH rcur INTO p_order;
    CLOSE rcur;
    END ORDER_RETURN1;
    PROCEDURE ORDER_RETURN2 IS
    OE_ORDER_rcur11 sys_refcursor;
    BEGIN
    ORDER_RETURN1(OE_ORDER_rcur11);
    end;
    I tried to call proc ORDER_RETURN1 with the help of proc ORDER_RETURN2, but no change, it gives me same error if i call the first proc ORDER_RETURN1 or i call ORDER_RETURN2.
    I am stuck with this problem, I had used ref cursor in procedure but not able to call the procedure which uses ref cursor as OUT parameter.
    Please help me to resolve this.
    Thanks
    Nidhi..

    Check out this
    SQL>VARIABLE X REFCURSOR
    SQL>CREATE OR REPLACE PROCEDURE ORDER_RETURN1(p_order OUT sys_refcursor) IS
      2  BEGIN
      3  OPEN p_order FOR
      4  SELECT OBJECT_ID FROM ALL_OBJECTS WHERE ROWNUM < 4;
      5  END ORDER_RETURN1;
      6  /
    Procedure created.
    SQL>EXEC ORDER_RETURN1(:X)
    PL/SQL procedure successfully completed.
    SQL>PRINT X
    OBJECT_ID
             4
            39
            30
    SQL>Regards
    Arun

  • Using Ref cursor in Bpel

    Hi,
    I need to use ref cursors in bpel.
    Basically calling a stored proc using DB Adapter , which returns a Ref cursor.
    Not able to get it work, any suggestion help is greatly appreciated.
    Also followed: http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm#CHDDDDJI
    But its quite abstract.
    Thanks !!

    Hi Raj,
    I am able to use the REF cursor with BPEL.
    I am able to pass the resultset from Database using a REF cursor to a BPEL variable .
    When you create a BPEL variable , create it with message type as the output message type of the REF Cursor.
    Regards
    Pradosh

  • How to get an UPDATABLE REF CURSOR from the STORED PROCEDURE

    using C# with
    ORACLE OLE DB version: 9.0.0.1
    ADO version: 2.7
    I returns a REF CURSOR from a stored procedure seems like:
    type TCursor is ref cursor;
    procedure test_out_cursor(p_Dummy in varchar, p_Cur out TCursor) is
    begin
         open p_Cur for select * from DUAL;
    end;
    I create an ADO Command object and set
    cmd.Properties["IRowsetChange"].Value = true;
    cmd.Properties["Updatability"].Value = 7;
    cmd.Properties["PLSQLRSet"].Value = 1;
    cmd.CommandText = "{CALL OXSYS.TEST.TEST_OUT_CURSOR(?)}";
    and I use a Recordset object to open it:
    rs.Open(cmd, Missing.Value,
    ADODB.CursorTypeEnum.adOpenStatic,
    ADODB.LockTypeEnum.adLockBatchOptimistic,
    (int) ADODB.CommandTypeEnum.adCmdText +
    (int) ADODB.ExecuteOptionEnum.adOptionUnspecified);
    The rs can be opened but can NOT be updated!
    I saved the recordset into a XML file and there's no
    rs:baseschema/rs:basetable/rs:basecolumn
    attributes for "s:AttributeType" element.
    Any one have idea about this?
    thanks very much

    It is not possible through ADO/OLEDB.
    Try ODP.NET currently in Beta, it is possible to update DataSet created with refcursors. You need to specify your custom SQL or SP to send update/insert/delete.
    As I remember there is a sample with ODP.NET Beta 1 just doing this.

  • Procedure to fetch table records using ref cursor

    Hi
    i need to fetch all the records in the table using ref cursor.we need to pass table
    name and the out paramater should be ref cursor.
    CREATE OR REPLACE PROCEDURE gettable(p_table_name IN VARCHAR2,
    p_ref_cursor OUT dept_pack.ref_cursor1)
    IS
    BEGIN
    OPEN p_ref_cursor FOR SELECT * FROM p_table_name;
    END gettable;
    is that a start ? then after this i have to execute this procedure to fetch the data from table. i am getting error that table doesnot exist but my idea was to pass p_table_name as IN parameter.
    Thnks in Advance

    here is the example
    SQL> CREATE OR REPLACE PROCEDURE TEST( t_name IN VARCHAR2
      2                                  , p_cursor OUT SYS_REFCURSOR)
      3  IS
      4  BEGIN
      5    OPEN p_cursor FOR
      6    'SELECT * FROM '|| t_name ;
      7  END TEST;
      8  /
    Procedure created.
    Elapsed: 00:00:00.02
    SQL>  var o refcursor;
    SQL> var tname varchar2(10);
    SQL> execute test('EMP',:o);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> print :o;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM        DNO
          7369 SMITH      CLERK           7902 17-DEC-80      800.2                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    Elapsed: 00:00:00.01
    SQL>  execute test('DEPT',:o);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    SQL>  print :o;
        DEPTNO DNAME          LOC
            90 LOGISTIC
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    Elapsed: 00:00:00.01

  • STORED PROCEDURE/REF CURSOR: How to output entire buffer

    I wrote a Stored Procedure wherein I use a Cursor to extract multiple
    rows and columns. I then write them into the buffer
    (dmbs_output.put_line). But when I try to capture the entire result
    into an OUT variable, I only get the last buffered line.
    So how do I output the entire buffer- all rows and columns? In other words (maybe), how do I use dbms_output.get_lines() to assign value to an OUT variable?
    Alternatively, using REF CURSOR as OUT variable, I added the following to "CREATE OR REPLACE PROCEDURE ... ()":
    cursor_out_test OUT cursor_test
    But when I tried:
    DEFINE CURSOR TYPE cursor_test IS REF CURSOR RETURN table%ROWTYPE;
    ...or...
    DECLARE TYPE cursor_test IS REF CURSOR RETURN table%ROWTYPE;
    I still got syntax errors.
    In one line, what I am trying to do is break the result array at the database level rather than at the application level.
    Cheers, Bill
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm#LNPLS00605

    I did the following:
    OPEN CURSOR x
         LOOP
              FETCH CURSOR x INTO col1, col2
              (EXIT WHEN...)
              variable_line := col1 || col2
         END LOOP
    CLOSE CURSOR
    But after closing this cursor, variable_line contains only the last buffered line. I want all the looped lines (without using associative arrays, nested tables etc). So I guess I am just looking for some way to append data lines- adding chr(10) doesn't work either.
    Cheers, Bill

  • Reports 3.0, Ref Cursor from stored procedure

    I have a problem trying to use Ref Cursor as datasource (i.e.
    Ref Cursor Query) in Reports 3.0
    I have created a stored package with a function which returns
    Ref Cursor.
    That function just opens the cursor and returns it to the
    calling module.
    Reports recognizes returned cursor - it creates a group for that
    query, with all columns, than I built
    a layout model - everything is OK on that stage.
    During the execution of that report (from previewer or using
    Reports Runtime) I got an error message like that:
    REP-0065 Virtual Memory System Error
    REP-0200 Cannot allocate enough memory cavaa22
    Error's description does not correspond the reality :) - there
    is enough virtual & physical memory according to
    Task Manager information.
    So, that does not work when this package is stored one.
    When I create the package on the client side - in Reports -
    everything works just fine.
    Cursor is opened with a very simple query, selecting records
    from the very simple table having only one record.
    There is no code written which closes that cursor or fetches the
    records.
    Client platform: WinNT 4.0 SP3
    Oracle Reports: 3.0.5.8.0
    Oracle Server: Oracle8 8.0.5.0.0 (and I tried also on Oracle7
    7.3.4.3.0)
    Thanx.
    null

    Sara,
    GTT (Global Temporary Tables) in Oracle work a different way compared to SQL Server and Informix. There you can create temporary tables on the fly and drop them on the fly.
    Here you should (note, you don't have to, but, best practice says that you should) create the table using the syntax...
    create global temporary table.....
    Once you create it, even though it looks like persistent table, it's not. It will have it's own individual data PER SESSION . You have two types of GTTs:
    ON COMMIT PRESERVE ROWS and ON COMMIT DELETE ROWS (they work in slightly different way).
    Look up GTTs here:
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2213
    HTH,
    Rahul

  • Call procedure that uses REF CURSOR?

    Can someone tell me how to call a procedure that uses a REF CURSOR?
    Procedure is something like this:
    PROCEDURE my_proc
    P_PROG_ID IN VARCHAR2,
    P_CRITERIA IN VARCHAR2,
    P_TASKCURSOR OUT MYREFCUR
    IS
    blah, blah blah
    I tried this to call the procedure:
    exec my_proc(variable1,variable2,variable3)
    but I don't know how to define variable3.
    Can someone help me out?

    Based on the parameters for the procedure, it looks like you have a cursor (myrefcursor) defined in a package somewhere. So, in sqlplus, you would need to do it in an anonymous block, something like:
    DECLARE
       l_cur package_name,myrefcur;
       variables to hold cursor fields
    BEGIN
       my_proc('ID', 'Criteria', l_cur);
       LOOP
          FETCH l_cur INTO variables to hold cursor fields
          EXIT WHEN l_cur%NOTFOUND;
          Do something with variables
       END LOOP;
       CLOSE l_cur;
    END;If you are on Oracle 9 or higher, assuming that myrefcursor is weakly typed,
    you could change the definition of the procedure to:
    PROCEDURE my_proc (p_prog_id    IN  VARCHAR2,
                       p_criteria   IN  VARCHAR2,
                       P_TASKCURSOR OUT SYS_REFCURSOR)then you could call it in sql plus like:
    -- Define the variables
    var var1 VARCHAR2(100);
    var var2 VARCHAR2(100);
    var cur  SYS_REFCURSOR;
    -- Assign Vlaues to the IN parameters
    EXEC :var1 := 'ID'; :var2 := 'Criteria';
    EXEC my_proc(:var1, :var2, :cur);
    -- See the contents of the cursor
    print curHTH
    John

  • Problem using REF CURSOR in JDBC

    i have several stored procedures and functions that return REF CURSOR object as output. however, i'm noticing that if
    no rows are returned within the cursor, the JDBC driver is throwing a "No more data to read from socket" exception.
    i'm using the Oracle Thin JDBC driver v8.1.6 for JDK 1.2.
    any help is appreciated.
    thanks,
    gary
    null

    I am not able to reproduce the problem. Could you post a testcase so that we can follow it up?
    Thanks.

  • Unable to use ref cursor as a input parameter at the time of inserting reco

    Hi
    i am unable to use ref cursor when inserting the data to oracle 11g from visual studio 2008. please help me as early as possible my code is bellows
    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Web.Configuration;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public partial class App_frmTest : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    protected void btnClick_Click(object sender, EventArgs e)
    OracleCommand cmd=new OracleCommand();
    Data objdata = new Data();
    int i = 0;
    string constr = "Data Source=Cwc;User Id=scott; Password=tiger;";// enlist=false; pooling=false;
    OracleConnection con = new OracleConnection(constr);
    /*Connection Open*/
    con.Open();
    cmd.Connection = con;
    /*Connection Open End*/
    /*Select Through Ref Cursor*/
    cmd.CommandText = "scott.TEST_USER.getUSER";
    cmd.CommandType = CommandType.StoredProcedure;
    OracleParameter p_rc = cmd.Parameters.Add("p_rc", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output);
    OracleParameter p_rc1;
    if (TextBox1.Text == "")
    p_rc1 = cmd.Parameters.Add("p_rc", OracleDbType.Int16, DBNull.Value, ParameterDirection.Input);
    else
    p_rc1 = cmd.Parameters.Add("p_rc", OracleDbType.Int16, Convert.ToInt16(TextBox1.Text), ParameterDirection.Input);
    // OracleParameter p_rc1 = cmd.Parameters.Add("p_rc", OracleDbType.Int16, 2, ParameterDirection.Input);
    OracleDataReader reader = cmd.ExecuteReader();
    DataSet ds = new DataSet();
    DataTable dt1 = new DataTable();
    dt1.Load(reader);
    ds.Tables.Add(dt1);
    GridView1.DataSource = ds;
    GridView1.DataBind();
    cmd.Parameters.Clear();
    con.Close();
    con.Dispose();
    OracleCommand cmd1 = new OracleCommand();
    OracleConnection con1 = new OracleConnection(constr);
    con1.Open();
    cmd1.Connection = con1;
    cmd1.CommandText = "scott.TEST_USER.ADDUSER";
    cmd1.CommandType = CommandType.StoredProcedure;
    OracleParameter P_ADDUSER = cmd1.Parameters.Add("P_ADDUSER", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Input);
    cmd1.ExecuteNonQuery(); // i am getting error when executing this line
    Server Error in '/CWC' Application.
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Source Error: 
    Line 77: OracleParameter P_ADDUSER = cmd1.Parameters.Add("P_ADDUSER", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Input);
    Line 78: //OracleParameter P_MSG = cmd.Parameters.Add("P_MSG", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.Output);
    Line 79: cmd1.ExecuteNonQuery();
    Line 80:
    Line 81: DataTable dt = new DataTable();
    Source File: d:\CWC\App\frmTest.aspx.cs    Line: 79 
    Stack Trace: 
    [AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
    Oracle.DataAccess.Client.OpsSql.ExecuteNonQuery(IntPtr opsConCtx, IntPtr& opsErrCtx, IntPtr& opsSqlCtx, IntPtr& opsDacCtx, IntPtr opsSubscrCtx, Int32& isSubscrRegistered, Int32 bchgNTFNExcludeRowidInfo, Int32 bQueryBasedNTFNRegistration, Int64& query_id, OpoSqlValCtx*& pOpoSqlValCtx, String pCommandText, IntPtr& pUTF8CommandText, IntPtr[] pOpoPrmValCtx, String[] ppOpoPrmRefCtx, OpoMetValCtx*& pOpoMetValCtx, Int32 prmCnt, Int32 bFromPool) +0
    Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() +4731
    App_frmTest.btnClick_Click(Object sender, EventArgs e) in d:\CWC\App\frmTest.aspx.cs:79
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    Hi;
    Its better to ask it at visual studio forum site:http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio
    Regard
    Helios

Maybe you are looking for

  • Tvtime not working after upgrading to kernel-2.6.31-1 (Solved)

    Hello friends, When I am using kernel-2.6.30.8 it was everything ok with my system. tvtime has been working with least cpu utilization then. But after upgrading to kernel-2.6.31-1 I got following error messages when trying to open tvtime damu@station

  • SAP B1 Crystal Reports Add On and Crystal Report 2008

    Hi, I have posted the question at SAP Reporting Forum, but not much luck. The following reports is created in Crystal report 2008. From  http://help.sap.com/businessobject/product_guides/cr2008V1/en/CR2008_SP2_Fixed_Issues_en.pdf, I tnocie there coul

  • Adapter module to insert into DB

    Hello, is it possible to write an adapter module which will insert whole payload into predefined table in DB? Can you please provide me hints, how to do it? Is it possible to use Java JDBC API in it, or do you have any best practices/cookbooks? The r

  • How to capture mapping error and able to send it..

    Hi Friends, We have a requirement, where in, if a mapping fails due to missing required element or improper formation of the source xml message, we need to capture this and need to create an error message, which contains the error description as one

  • Mini CD ... will it run on an iMac G5

    My brother sent me a mini-CD, a "pocket" CD. He thought it would run on my iMac G5. I put it in and no icon appeared. Pressing eject didn't eject it either. Had to restart and hold eject to get it out. Does anyone know if the smaller, mini CDs are su