OracleDataAdapter returning wrong number of columns

Hello All,
I have an issue of an oracle data adapter not returning all columns in my select statement. When I use code similar to below, the data adapter returns 2 columns per row instead of 5. And they are out of order (ie, DataRow(0) could be column 1 and DataRow(1) could be column 4 -- so I don't see which columns have been dropped without looking at the value).
The database id XE on the local machine. The connection works fine. And the internal VS.NET PL/SQL debugger returns the query just fine.
Some of the columns I'm trying to get are null -- in fact, most are. But they are changed during the program. So I still need them to show up in the dataset.
BTW, I have had zero success getting OracleCommand.BindByName and OracleParameters to work, so I punted. Since I can get what I want out of readers and datasets, I can live without'em -- or can I?!?!
I think my problem has something to do with handling null values. So I have tried the select statement with NVL wrapping the fields that could be null. But still no success.
Any ideas?
Table:
account char(30) not null
col_code as NUMBER(1,0) null ok
columnIDontNeed as whatever null ok
sum1 as char(1) null ok
sum2 as char(1) null ok
sum3 as char(1) null ok
anotherColumnIDontNeed as whatever null ok
Sample Code:
dim oconn as New OracleConnection(conStrBldr.toString)
Dim cmdLedger As OracleCommand = oconn.CreateCommand
cmdLedger.BindByName = True ' seems to affect nothing! ever!
cmdLedger.AddToStatementCache = False ' no noticable affect
cmdLedger.CommandText = " SELECT account,col_code,sum1,sum2,sum3 "
cmdLedger.CommandText &= "FROM gl.ledger "
cmdLedger.CommandText &= "ORDER BY gl.ledger.account "
cmdLedger.CommandType = CommandType.Text
' Create DataAdapter based on main Ledger SELECT
Dim cmdLedgerDA As New OracleDataAdapter(cmdLedger)
cmdLedgerDA.ReturnProviderSpecificTypes = True ' same results with False
' Create DataSet and Fill it.
' After this, we can now use this dataset
' to iterate through the GL ledger data.
Dim cmdLedgerDS As New DataSet("GLBal")
Try ' to fill dataset with Ledger SELECT
' fill dataset from OracleDataAdapter and the
' previously defined Oracle Command.
cmdLedgerDA.Fill(cmdLedgerDS, "GL.LEDGER") ' tried with and without src
Catch ex As OracleException
ShowEx(ex)
End Try ' to fill dataset with Ledger SELECT
These are the typical test from within VB that I've run to check what was returned:
console.writeline(cmdLedgerDS.Tables(0).Rows(0).ItemArray.Length)
2
dim row as DataRow = cmdLedgerDS.Tables(0).Rows(0)
console.writeline(row(0).toString & row(1).toString & row(2).toString & row(3).toString & row(4).toString) ' EXCEPTION IS THROWN

I cannot reproduce the error using basic code below. What is the specific exception you get?
And BindByName is not necessary since you're not using bind variables
Sub Main()
    Dim da As OracleDataAdapter
    Dim sqlstr As String
    Dim connstr As String
    Dim ds As DataSet
    Dim dr As DataRow
    Dim dc As DataColumn
    Try
        sqlstr = "select employee_id, first_name, last_name, null, salary "
        sqlstr &= "from employees where rownum < 10"
        connstr = "Data Source=xe;User ID=hr;Password=hr;"
        da = New OracleDataAdapter(sqlstr, New OracleConnection(connstr))
        ds = New DataSet("EmployeeDS")
        da.Fill(ds, "employees")
        For Each dc In ds.Tables("employees").Columns
            Console.Write(dc.ColumnName & " ")
        Next
        Console.WriteLine()
        For Each dr In ds.Tables("employees").Rows
            Console.WriteLine(dr(0).ToString & " " & _
                dr(1).ToString & " " & dr(2).ToString & " " & _
                dr(3).ToString & " " & dr(4).ToString)
        Next
    Catch ex As Exception
        Console.WriteLine(ex.Message)
    End Try
End SubOutput should look like
EMPLOYEE_ID FIRST_NAME LAST_NAME NULL SALARY
100 Steven King  24000
101 Neena Kochhar  17000
102 Lex De Haan  17000
103 Alexander Hunold  9000
104 Bruce Ernst  6000
105 David Austin  4800
106 Valli Pataballa  4800
107 Diana Lorentz  4200
108 Nancy Greenberg  12000I am using VS2005, ODP 10.2.0.2.21 and OracleXE on remote machine.
NH
Message was edited by:
nurhidayat

Similar Messages

  • SSIS OLE DB Source in Data Flow Task calling SP that returns variable number of column as output

    We have one old Stored Proc that I need to reuse. But that stored proc returns different number of Columns as output depending on input Parameter. Say, if I pass 1 to 9 it will return 'ID', if i pass 10 to 33 it will return 'ID', 'Name',  if I pass
    34 to 51 it will return 'ID', 'Name', 'DefaultPosition' 
    In this way.
    Now I wanted to use this in OLE DB Source in SSIS DFT. 
    During that time immediately it is picking all possible columns in Available External Columns. Even if I manually select/delete those, package is failing at Runtime, because in Runtime the parameter this will get, it should always return one & only one
    column which is ID. [Because in this package I will only have to pass parameters like, 1 or 2 or 5 or 7 or 9.
    Which in every  case should return only ID from stored proc.
    Any Idea how I can get this please?
    Regards, Avik M.

    Has any one tried something like it? Could you please provide me a sample if you have done it.
    I tried these options but always got errors as
    [usp_return [64]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E55.An OLE DB record is available.  Source:
    "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E55  Description: "Column does not exist.".
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "usp_return" (64) returned error code 0xC0202009.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning
    of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    ~ Thank you so much
    Regards, Avik M.

  • Bex query that returns variable number of columns based upon variable value

    I have a request to create a query that, at excution time, has a variable for 'nbr of months', and based on the value entered by the user, returns data for only the specified number of months. Value that can be entered can vary from 1 to 12. A simple example is, if the user enters 1, then they would only want to see one column, and if they entered 6, then they'd like to see 6 columns in the workbook.  All suggestions on how to implement this dynamic columns on a workbook will be appreciated.
    Thanks.
    BN

    Hi,
    Do this->
    1) first create a New Structure in Rows-> Place your New Selection and drag your KF.
    2) Nw Create a New Formual under this structure. Now Create a Formula variable ( "ZFVXXX")with user-entry and ready for input and dimension as NUmber. and place in formula area. And hide this formula.
    3)Now Create a New Customer-Exit variable on 0CALMONTH name as "ZCECMON" with following atrribute->Mandatory, Range(Interval) and remove check for Ready for entry.
    4)Drag your 0CALMONTH in Rows above That Structure and restrict it to "ZCECMON".
    5) Now go to CMOD and write this code.
    INCLUDE ZXRSRU01 *
    DATA: L_S_RANGE TYPE RSR_S_RANGESID. 'In global area
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT. 'In global area
    DATA: zmonth like /bi0/0calmonth.
    CASE I_VNAM.
    WHEN 'ZCECMON'.
    IF i_step = 2.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZFVXXX'.
    zyear = sy-datum(4).
    zmonth = sy-datum+4(2).
    l_s_range-low = zmonth.
    zmonth = zmonth + loc_var_range-low.
    l_s_range-HIgh = zmonth.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDCASE.
    6) activate the porject and go to rsrt and run there first.
    Regards,
    San!
    Message was edited by: San!

  • Using orcl:query-database to return a number of Columns

    I have a BPEL process that is pulling data from some Database tables everything is working fine.
    I now need to perform a lookup on the database to pull in some additional information (3 additional attributes) within the stylesheet, where each attribute comes from a separate table.
    i.e.
    select a.col1, b.col1, c.col1
    from tab1 a
    ,tab2 b
    , tab3 c
    where a.col2 = b.col2
    and .......blah blah blah....
    I have used the orcl:database-query successfully to retrieve a single column and a single row and it works great.
    However i'd like to run the above query as one statement, rather than 3 separate queries.
    I've googled the fucntion for examples where it returns a nodelist or XML snippet, but to no avail.
    I've tried it before and couldn't get it to work.
    Does anyone have any examples.
    Thanks in advance.
    Stuart

    I have a BPEL process that is pulling data from some Database tables everything is working fine.
    I now need to perform a lookup on the database to pull in some additional information (3 additional attributes) within the stylesheet, where each attribute comes from a separate table.
    i.e.
    select a.col1, b.col1, c.col1
    from tab1 a
    ,tab2 b
    , tab3 c
    where a.col2 = b.col2
    and .......blah blah blah....
    I have used the orcl:database-query successfully to retrieve a single column and a single row and it works great.
    However i'd like to run the above query as one statement, rather than 3 separate queries.
    I've googled the fucntion for examples where it returns a nodelist or XML snippet, but to no avail.
    I've tried it before and couldn't get it to work.
    Does anyone have any examples.
    Thanks in advance.
    Stuart

  • Query return wrong number of records

    In a function, I use a variable declare as my_var table_name1.column_name%type.
    This variable is used to to a test on a foreign key when I do a query on another table than table_name1 the number of rows return by the query is different than the number of rows return if I do the test directly with the value accorded.
    Ex:
    declare
    my_var table_name1.column_name%type;
    row_num number;
    begin
    my_var := 10;
    select count(1) into row_num
    from table_name2
    where column_name = my_var;
    dbms_output.put_line(row_num);
    select count(1) into row_num
    from table_name2
    where column_name = 10;
    dbms_output.put_line(row_num);
    end;
    the first query will return 2 and the second will return 1.
    Can someone explain me why I have this strange result ?
    Edited by: 897304 on Nov 15, 2011 5:12 AM
    Edited by: 897304 on Nov 15, 2011 5:32 AM

    I cannot put the description of the table :-/
    The type of the field is varchar2(12)
    This is the function the value past to param1 came from oracle 11 and the table tab1 is in oracle10.
    The first query work and return 1 (result expected) and the second return 2.
    FUNCTION getValue(param1 VARCHAR2) RETURN number AS
         var1 VARCHAR2(12 BYTE);
         res1 number;
    BEGIN
    var1 := param1;
    SELECT count(1)
    INTO res1
    FROM tab1
    WHERE col2 = var1;
    SELECT count(1)
    INTO res1
    FROM tab1
    WHERE col2 = param1;     
    RETURN res1;
    END getValue;

  • Number of columns in a table

    Hi,
    I am developing an application using jdbc. Is there any method which returns the number of columns in a table.
    Thanks
    Mallo

    actually, this exact code is posted in the docs that I gave the link to:
    ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();Jamie

  • Return specific number of rows depending on the data in a column in table

    Hi,
    I have a table named orders which has column orderid and noofbookstoorder in addition to other columns.
    I want to query the orders table and depending on the value of the 'noofbookstoorder' value return that number of rows.
    Eg
    Orderid noofbookstoorder
    1 1
    2 3
    3 2
    when I query the above data saying
    select * from orders where orderid=2;
    since it has noofbookstoorders value as 3 the query should return 3 rows and when I query
    select * from orders where orderid=3;
    it should return 2 rows and
    select * from orders where orderid=1;
    should return 1 row.
    Is it possible to achieve this. If yes, then how do I write my query.
    Thanks in advance.

    with t as (
               select 1 Orderid,1 noofbookstoorder from dual union all
               select 2,3 from dual union all
               select 3,2 from dual
    select  t.*
      from  t,
            table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
      where Orderid = <order-id>
    /For example:
    SQL> with t as (
      2             select 1 Orderid,1 noofbookstoorder from dual union all
      3             select 2,3 from dual union all
      4             select 3,2 from dual
      5            )
      6  select  t.*
      7    from  t,
      8          table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
      9    where Orderid = 2
    10  /
       ORDERID NOOFBOOKSTOORDER
             2                3
             2                3
             2                3
    SQL> with t as (
      2             select 1 Orderid,1 noofbookstoorder from dual union all
      3             select 2,3 from dual union all
      4             select 3,2 from dual
      5            )
      6  select  t.*
      7    from  t,
      8          table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
      9    where Orderid = 3
    10  /
       ORDERID NOOFBOOKSTOORDER
             3                2
             3                2
    SQL> with t as (
      2             select 1 Orderid,1 noofbookstoorder from dual union all
      3             select 2,3 from dual union all
      4             select 3,2 from dual
      5            )
      6  select  t.*
      7    from  t,
      8          table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.Odc
    iNumberList))
      9    where Orderid = 1
    10  /
       ORDERID NOOFBOOKSTOORDER
             1                1
    SQL>  -- And if you want to select multiple orders
    SQL> with t as (
      2             select 1 Orderid,1 noofbookstoorder from dual union all
      3             select 2,3 from dual union all
      4             select 3,2 from dual
      5            )
      6  select  t.*
      7    from  t,
      8          table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.Odc
    iNumberList))
      9    where Orderid in (2,3)
    10  /
       ORDERID NOOFBOOKSTOORDER
             2                3
             2                3
             2                3
             3                2
             3                2
    SQL> SY.
    Edited by: Solomon Yakobson on Oct 26, 2009 7:36 AM

  • Number of rows returned by SELECT LAST(column)

    I have about 50,000 rows in my MS Acess database table so I have used SELECT LAST(column) AS newField FROM table... to retrieve the last data in the column however when I check the number of rows in the resultset using
    resultset.last();
         int rowcount = rs.getRow();
    rowcnt returns the total no.rows (about 50,000) in the table.
    I thought it should just return one.
    Is it normal?

    Thanks again dcminta. I'll try with your code.
    I just wanted to know why resultset returned the number of all records in that column when I only selected the last.
    I had the �Invalid Cursor Position� error with "while(rs.next())" as I (thought I) had only one record in the resultset and I was fiddling with my code.
    They are all fine now.
    Thanks guys.
    Booh1(old lady)

  • FDPSTP failed due to ORA-06550: line1 ,column:" Wrong number of types of ar

    Hi All
    I am tying to submit the concurrent request through buttom, when i press the button.. the request is submitting but showing the error"FDPSTP failed due to ORA-06550: line1 ,column:" Wrong number of types of argument in call"
    What are the paramerter i submited in SRS window( normal submition not throu button) is are equall submition throw button.... And in procedure also i am using errbuf and retcode...
    Can any one help regarding the issue where i am doing the mistake...
    PROCEDURE Einvoice(ERRBUF OUT VARCHAR2,RETCODE OUT VARCHAR2,P_INVOICE_TYPE RA_CUST_TRX_TYPES_all.type%TYPE,
    P_INVOICE_FROM RA_CUSTOMER_TRX_PARTIAL_V.TRX_NUMBER%TYPE,
    P_INVOICE_TO RA_CUSTOMER_TRX_PARTIAL_V.TRX_NUMBER%TYPE,
    P_CUSTOMER_ID RA_CUSTOMER_TRX_PARTIAL_V.SOLD_TO_CUSTOMER_ID%TYPE,
    P_DOCUMENT_NUM NUMBER,
    P_reprint_flag VARCHAR2
    In the button trigger
    FND_REQUEST.SUBMIT_REQUEST('GETSAR'
    ,'EINVOICE'
    ,NULL ,NULL ,FALSE
    ,:main_b.invoice_type
    ,to_number(:main_b.From_Invoice_number)
    ,to_number(:main_b.to_invoice_number)
    ,:main_b.customer_id
    ,to_number(:main_b.document_no_from)
    ,:main_b.reprint_flag
    ,'') up to 100 parameters
    We need to change any datatypes in procedure ?????????????

    Duplicate post.
    "FDPSTP failed due to ORA-06550: line1 ,column:" Wrong number of types of
    "FDPSTP failed due to ORA-06550: line1 ,column:"   Wrong number of types of

  • Count the number of columns return in an user-input sql query

    I need to do something like this
    I let an user input a sql query and then execute it
    assuming the sql query is always correct, it will return a Resultset
    then a table will pop up to accomodate the number of columns the resultset will produce
    i'm stuck at the part on how to check how many columns of data will be return in the resultset

         ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
         ResultSetMetaData rsmd = rs.getMetaData();
         int numberOfColumns = rsmd.getColumnCount();

  • I want to return a number from a column, if the adjacent column contains either "nurse" or Receptionist"

    I have a table with dates which i have converted to a number using the Month Fx.  This number is then in a seperate column, which inus e for charts.  I am trying to return this number only if the adjacent column contains either "nurse" or "receptionist". ie I dont want them all....

    Kang,
    Yes.  Happy Easter!  was cloudy yesterday in Austin, Texas.
    I do not know where the formula you posted in your previous post came from.  It is certainly not correct.  What confuses me about the bottom table is I do not know how it connects to the top table.
    Are the groups of people "Clinical Staff", "PDR", "Fire Training"  (bottom table column A) groupings of the staff types listed in in the top table, column C?
    If so then it may be worth adding some columns to define how the roles map to the training groups.
    At this point it must be defined and assumed.  Which row are you wanting to fill out for "Nurse" and "Nurse Practitioner"?
    A little exaplaination:
    the countif() function contains two arguments like this:
    =countif(range, test)
    the range is a group of cells (often, but not always, a column).  The test must be an expression that evaluates to true or false.
    so if the column is set to column C of the top table then the range would be expressed as (assuming the table name is "Table 1"):
    "Table 1::$G"
    to test whether the role is a "Nurse" the test (or condition) would be:
    "Nurse"
    putting these together you would get a countif() function like this which would return the number of Nurses (not really what you want but getting close):
    =countif(Table 1::$G, "Nurse")
    you actually want to count when:
    A) the month is a particular month and
    B) the role is a "Nurse"
    you also want to count when:
    C) the month is a particular month and
    D) the role is a "Secialist Nurse Practitioner"
    so you can use the countifs() function.
    the countifs() function counts the occurances where only ALL conditions are met.
    you would use the counifs() twice and add the results together like this:
    =COUNTIFS(test-values1,condition1, test-values2,condition2)
    you can add as many test values and conditions as you like (you must add in pairs)
    To do this you should add an extra row in the header of the bottom table to hold the month number.  Jan is 1, Feb is 2, etc.
    Here is what I think you want:
    The top table corresponds to the bottom table in your post.  notice I added an extra row (to contain the month number):
    B3=COUNTIFS(Table 4::$C, "Nurse", Table 4::$G, B$1) + COUNTIFS(Table 4::$C, "Specialist Nurse Practitioner", Table 4::$G, B$1)
    this is shorthand for select cell B3, then type (or copy and paste from here) the formula:
    =COUNTIFS(Table 4::$C, "Nurse", Table 4::$G, B$1) + COUNTIFS(Table 4::$C, "Specialist Nurse Practitioner", Table 4::$G, B$1)
    no select B3 and fill to the right by hovering the cursor over the right edge of the, now select, cell B3 and dragging the little yellow circle to the right.

  • ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments

    I am getting an error:
    "ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'XYZ' ORA-06550: line 1, column 7: PL/SQL: Statement ignored".
    Stored Procedure:
    PROCEDURE XYZ
    (ip_number IN NUMBER,
    op_error_code OUT NUMBER,
    op_error_text OUT VARCHAR2,
    ret_cursor OUT OUT_CURSOR);
    In the procedure I am selecting a details from few tables with respect to the input parameter 'ip_number'.
    VB Code:
    strConnectionString = CONNECTION_STRING
    Set objConnection = Server.CreateObject("ADODB.Connection")
    objConnection.Open strConnectionString
    Set objCommand = Server.CreateObject("ADODB.Command")
    With objCommand
    .ActiveConnection = objConnection
    .CommandType = adCmdStoredProc
    End With
    With objCommand
    .CommandText = "Pkg_1.XYZ"
    .Parameters.Append objCommand.CreateParameter_
    ("ip_ipnumber",adNumeric,adParamInput,8,strIPNumber)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_code",adNumeric,adParamOutput,10)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_text",adVarChar,adParamOutput,512)
    Set RS = .Execute()
    End With
    Its working fine with ASP(VB)+ Oracle9i + Windows2000.
    But in ASP(VB) + Oracle 8.1.7 + Windows2000, its giving this error:
    "ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'XYZ' ORA-06550: line 1, column 7: PL/SQL: Statement ignored".
    Please help.

    Your procedure has 4 parameters 1 in and 3 out parameter
    whereas in your VB code
    Parameters.Append objCommand.CreateParameter_
    ("ip_ipnumber",adNumeric,adParamInput,8,strIPNumber)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_code",adNumeric,adParamOutput,10)
    .Parameters.Append objCommand.CreateParameter_
    ("op_error_text",adVarChar,adParamOutput,512)
    There are only 3 parameter added where is the 4 th one ?
    With Warm Regards
    SSR

  • Username column in dba_users PLS-00306: wrong number or types of arguments

    Can someone please help me understand what's going on here? I need to drop items in a few schemas, but I can't get the username column to work for some reason.
    SQL> begin
    2 for v_username in (select username from dba_users) loop
    3 dbms_output.put_line(v_username);
    4 end loop;
    5 end;
    6 /
    dbms_output.put_line(v_username);
    ERROR at line 3:
    ORA-06550: line 3, column 1:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    SQL> desc dba_users;
    Name Null? Type
    USERNAME NOT NULL VARCHAR2(30)
    USER_ID NOT NULL NUMBER
    PASSWORD VARCHAR2(30)
    ACCOUNT_STATUS NOT NULL VARCHAR2(32)
    LOCK_DATE DATE
    EXPIRY_DATE DATE
    DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
    TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
    CREATED NOT NULL DATE
    PROFILE NOT NULL VARCHAR2(30)
    INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
    EXTERNAL_NAME VARCHAR2(4000)
    SQL>

    Ms_Margaret wrote:
    Can someone please help me understand what's going on here? I need to drop items in a few schemas, but I can't get the username column to work for some reason.
    SQL> begin
    2 for v_username in (select username from dba_users) loop
    3 dbms_output.put_line(v_username);
    4 end loop;
    5 end;
    6 /
    dbms_output.put_line(v_username);
    ERROR at line 3:
    ORA-06550: line 3, column 1:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    SQL> desc dba_users;
    Name Null? Type
    USERNAME NOT NULL VARCHAR2(30)
    USER_ID NOT NULL NUMBER
    PASSWORD VARCHAR2(30)
    ACCOUNT_STATUS NOT NULL VARCHAR2(32)
    LOCK_DATE DATE
    EXPIRY_DATE DATE
    DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
    TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
    CREATED NOT NULL DATE
    PROFILE NOT NULL VARCHAR2(30)
    INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
    EXTERNAL_NAME VARCHAR2(4000)
    SQL>what datatype is V_USERNAME?

  • PLS-00306: wrong number or types of arguments in call to '(FUNCTION)'

    Hi all,
    I've spent quite some time trying to get this to work, but is appears that none of the code samples I have tried work with this version of ODP.Net : 2.102.2.20.
    It's the most basic thing : return a weak typed resultset from an oracle function using weak typed SYS_REFCURSOR. I got this to work with a procedure, but no way this works with a function.
    I'm using the code approach from this source : http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html
    CREATE OR REPLACE FUNCTION
    fn_getItemsByDispNumber(p_Number in varchar2)
    return sys_refcursor
    IS
    resultset sys_refcursor;
    begin
    open resultset for
    ....select statement
    return resultset;
    end;
    Exception is : ORA-06550: line 1
    PLS-00306: wrong number or types of arguments in call to '(fn_getItemsByDispNumber)'
    Using strong types is not an option I have too many columns adn result sets that it makes no sense.
    I tried to obtain the sys_refcursor as return value and as output parameters and it's the same results. I also tried adding the return value parameter to the command object first, but with no luck (same error).
    Is there some magical trick thet must be done for this simple thing to work ?
    Thanks

    user10940202 wrote:
    The calling code looks like this :
    Dim cmd As OracleCommand = New OracleCommand("fn_getItemsByDispNumber", con)
    cmd.CommandType = CommandType.StoredProcedure
    Dim p_refcursor As OracleParameter = New OracleParameter
    p_refcursor.OracleDbType = OracleDbType.RefCursor
    p_refcursor.Direction = ParameterDirection.ReturnValue
    cmd.Parameters.Add(p_refcursor)
    Dim inputparm As OracleParameter = New OracleParameter
    inputparm.OracleDbType = OracleDbType.Varchar2
    inputparm.Name = "p_Number"
    p_refcursor.Direction = ParameterDirection.Input
    cmd.Parameters.Add(inputparm)
    cmd.Parameters.Add(p_refcursor)
    'ExecuteNonQuery() also fails with the same error message
    Dim da As OracleDataAdapter = New OracleDataAdapter(cmd)
    Dim ds As DataSet = New DataSet
    da.Fill(ds)
    I also tried to rever the order in which parameters are specified but same the same error persists. I also tried with output parameter of type SYS_REFCURSOR but no luck, same exact error.
    Is it possible that weakly typed cursors are not supported with functions ? That would be strange because it's the first use I can think of for the function concept?
    Edited by: user10940202 on Sep 14, 2009 12:44 PMHi,
    Looks like a few things are jumbled together here...
    You have p_refcursor.Direction = ParameterDirection.Input and the parameters added to the collection multiple times, etc...
    You should just need something like this:
    Dim p_refcursor As OracleParameter = New OracleParameter
    p_refcursor.OracleDbType = OracleDbType.RefCursor
    p_refcursor.Direction = ParameterDirection.ReturnValue
    Dim inputparm As OracleParameter = New OracleParameter
    inputparm.OracleDbType = OracleDbType.Varchar2
    inputparm.Name = "p_Number"
    inputparm.Value = <Some Value>
    cmd.Parameters.Add(p_refcursor)
    cmd.Parameters.Add(inputparm)Regards,
    Mark

  • Java Applet in a HTML page: failing with PLS-00306: wrong number of args

    We are trying to use a Java Applet in a HTML page. as our system needs to be able to retrieve a predefined set of data from a third party system that uses Dynamic Data Exchange Protocol (DDE) and are encountering errors from APEX and in IE itself.
    We are using JavaDde from www.nevaobject.com that enables our Java applet to interact with Windows applications (Third Party System) using DDE.
    This functionality is currently used in our Web Form 6i application and we are trying to use the same in the new ApEx application.
    We are using ApEx version : 2.1 and actually aer encountering 2 problems:
    Problem 1: ApEx failing with PLS-00306: wrong number or types of arguments in call to 'ACCEPT'
    Problem 2: IE crashes if Applet used in a complex page with several regions (1 Context, 4 Report Regions, 2 level Tabs, Links)
    This problem does not occur in the page where there is only applet and one region. In the case of complex page the IE crashes if the page is reloaded
    Test scenario:
    1- Create a simple page with the HTML region.
    2- Define the Source of the above region as follows
    <OBJECT CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    CODEBASE="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#version=1,4,0,0"
    WIDTH="1"
    HEIGHT="1"
    ID="simpleApplet"
    NAME="simpleApplet">
    <PARAM NAME="code" VALUE="simpleApplet.class" >
    <PARAM NAME="archive" VALUE="simpleApplet.jar" />
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
    </OBJECT>
    3- Create a simple Java applet "simpleApplet" - for the test its enough if the applet will have just the init method printing out the mesage to the console
    4- Create a Submit Button (not redirect) in Region Header and create unconditional (do not set When Button Pressed property) Page Branch to navigate to another page (the page without the applet)
    6- Run the page and Submit -
    The error below is returned by the engine:
    In our case our applet is called ddeApplet - I do not know why is ApEx passing the Applet's ID down to the wwv_flow.accept method as a parameter
    Tue, 24 Jul 2007 08:15:39 GMT
    ORA-06550: line 7, column 2:
    PLS-00306: wrong number or types of arguments in call to 'ACCEPT'
    ORA-06550: line 7, column 2:
    PL/SQL: Statement ignored
    DAD name: rbdev2_ax
    PROCEDURE : wwv_flow.accept
    URL : http://castor:7778/pls/rbdev2_ax/wwv_flow.accept
    PARAMETERS :
    ============
    P_FLOW_ID:
    147
    P_FLOW_STEP_ID:
    500
    P_INSTANCE:
    6986070096861669560
    P_PAGE_SUBMISSION_ID:
    1005758
    P_REQUEST:
    CRASH
    P_ARG_NAMES:
    100380029717786501
    P_T01:
    147
    P_T02:
    101
    P_T03:
    5000044
    P_T04:
    1
    P_T05:
    S
    DDEAPPLET:
    Ddeapplet[panel0,0,0,1x1,layout=java.awt.BorderLayout,rootPane=javax.swing.JRootPane[,0,0,1x1,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    P_MD5_CHECKSUM:
    ENVIRONMENT:
    ============
    PLSQL_GATEWAY=WebDb
    GATEWAY_IVERSION=2
    SERVER_SOFTWARE=Oracle HTTP Server Powered by Apache/1.3.19 (Unix) mod_fastcgi/2.2.10 mod_perl/1.25 mod_oprocmgr/1.0
    GATEWAY_INTERFACE=CGI/1.1
    SERVER_PORT=7778
    SERVER_NAME=castor
    REQUEST_METHOD=POST
    QUERY_STRING=
    PATH_INFO=/pls/rbdev2_ax/wwv_flow.accept
    SCRIPT_NAME=/pls
    REMOTE_HOST=
    REMOTE_ADDR=192.168.66.169
    SERVER_PROTOCOL=HTTP/1.1
    REQUEST_PROTOCOL=HTTP
    REMOTE_USER=
    HTTP_CONTENT_LENGTH=661
    HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
    HTTP_HOST=castor:7778
    HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
    HTTP_ACCEPT_ENCODING=gzip, deflate
    HTTP_ACCEPT_LANGUAGE=en-us
    HTTP_ACCEPT_CHARSET=
    HTTP_COOKIE=ISCOOKIE=true; LOGIN_USERNAME_COOKIE=rdanko; ORACLE_PLATFORM_REMEMBER_UN=RDANKO:ngrb; WWV_FLOW_USER2=70FBB00945FE46B9; V6_AUTHENTICATION_COOKIE=70FBB00945FE46B9
    Authorization=
    HTTP_IF_MODIFIED_SINCE=
    HTTP_REFERER=http://castor:7778/pls/rbdev2_ax/f?p=147:500:6986070096861669560:::::
    HTTP_SOAPACTION=

    "theArrow",
    It looks like whatever HTML you're including on your page is creating HTML input form elements inside the HTML form "wwv_flow". This form is posted to wwv_flow.accept, and of course, the PL/SQL procedure wwv_flow.accept doesn't know anything these additional arguments/form elements you're attempting to POST.
    Joel

Maybe you are looking for

  • Zooming in on an InDesign document. Can it be smoother?

    When I zoom in or out or even scroll around an ID document, it's fairly clunky. Like the clicks on a regular mouse wheel. Chunk, Chunk, Chunk. Is there a way to have smooth scrolling or smooth zoom in/out? Dang that would be nice. OSX 10.8, IDCS 5.5

  • Price is too Low

    Hello, When I am getting the below error while processing the MIRO. The error is: Price too low (below tolerance limit of 1000.00 INR) Message No: M8084 We have done the changes for Unplanned Deliver cost tolerance limit to unlimited -ve amount but +

  • Table name to know the infoobject is flexible or direct.

    Hi,   Please let me know the table name where we can know whether the infoobject is flexible or direct update. Thanks in advance! Best regards.

  • Choosing a folder from the hard drive

    Hi I need to allow the user to choose a directory to save a logfile to from a Business One form that should get launched when they click on a browse button. I have currently got the below code which is located within the the ItemEvent. Dim FolderWind

  • Safari not loading pages

    Since upgrading to OSX 10.5 Safari has failed to load certain sites e.g. www.engadget.com, these sites work perfectly in other web browsers on the same machine. The machine is a early Intel iMac. In the status bar at the bottom of safari it simply sa