Oracle Stored Procedure PLS-00306: wrong number or types of arguments

narue1992

I am receiving the following oracle errors:

ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'INSERT_CATEGORY'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

I read over this error and people say that if you are passing a different value type to the stored procedure type can make this error but it doesn't seem to be the case for me.

enter image description here

Most of my coding is almost identical to what I have(and they worked). Only difference with this one is I am using a Boolean as well so I am not sure if that is causing the issues too.

Protected Sub BtnNew_Click(sender As Object, e As EventArgs) Handles BtnNew.Click
    Dim conn As OleDbConnection = New OleDbConnection("Provider=""*******"";user id=" & strUserID & ";data source=" & strDatabase & ";password=" & strPssWd)

    If Page.IsValid Then

        If CatText.Text <> "" Then


            Dim ClassifiedStr As New OleDbCommand

            ClassifiedStr.CommandType = CommandType.StoredProcedure
            'name of stored procedure = 'insert_category'
            ClassifiedStr.CommandText = "insert_category"
            ClassifiedStr.Connection = conn

            'Must be organized based on Stored Procedure
            ClassifiedStr.Parameters.Add("val_category", OleDbType.VarChar, 40).Value = CatText.Text
            conn.Open()

            'Makes sure the Category doesn't already exist****************
            Dim myParm As OleDbParameter = ClassifiedStr.Parameters.Add("val_newcat", OleDbType.Boolean)
            myParm.Direction = ParameterDirection.Output

            ClassifiedStr.ExecuteNonQuery()
            'myParm needs Execute
            Dim standardid As Integer = myParm.Value
            '***********************************************

            If standardid = False Then

                conn.Close()

                Response.Write("<script language=""javascript"">alert('Thanks! Record Has Been Added.');</script>")
                Response.Redirect("DisplayCategories.aspx")
            Else
                Response.Write("<script language=""javascript"">alert('Sorry! Record Already Exist.');</script>")
                Exit Sub
            End If

        Else
            Response.Write("<script language=""javascript"">alert('You must insert a record.');</script>")
            Exit Sub
        End If

    End If

End Sub

Stored Procedure

CREATE OR REPLACE PROCEDURE insert_category
(val_category        TABLENAME.Category%type, 
 val_newcat out boolean) 

as num_catid number;  

begin   

select category_seq.nextval into num_catid from dual;   

  INSERT INTO TABLENAME  
   (select num_catid, val_category from TABLENAME WHERE Category != val_Category);  

commit; 

  val_newcat := SQL%FOUND; 

end;
narue1992

Updates that fixed issue:

Dim ClassifiedStr As New OleDbCommand

ClassifiedStr.CommandType = CommandType.StoredProcedure
'name of stored procedure = 'insert_category'
ClassifiedStr.CommandText = "insert_category"
ClassifiedStr.Connection = conn

'Must be organized based on Stored Procedure
ClassifiedStr.Parameters.Add("val_category", OleDbType.VarChar, 40).Value = CatText.Text
conn.Open()

'Makes sure the Category doesn't already exist
Dim myParm As OleDbParameter = ClassifiedStr.Parameters.Add("val_newcat", OleDbType.VarChar, 10)
myParm.Direction = ParameterDirection.Output

ClassifiedStr.ExecuteNonQuery()
'myParm needs Execute before declared

Dim standardid As String = myParm.Value

'***********************************************

If standardid = "TRUE" Then

    conn.Close()
    etc....

Stored Procedure:

(val_category        t_category.Category%type,     
val_newcat out varchar2)     

as num_catid number;      

begin       

select newCategory_seq.nextval into num_catid from dual;         

INSERT INTO TABLENAME      
select num_catid, val_category from dual WHERE not exists (select * from TABLENAME where Category = val_Category);      

val_newcat := case SQL%FOUND when TRUE then 'TRUE' else 'FALSE' end;    

commit;     

end;     

Collected from the Internet

Please contact debug[email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PL/SQL: Error "PLS-00306: wrong number or types of arguments in call to" triggered for table of numbers

From Dev

Getting wrong number or types of arguments in call to exception while executing stored procedure

From Dev

PLS-00306: wrong number or types of arguments in call to 'OUTPUT_ARRAY'

From Dev

Stored procedure returning the wrong value?

From Dev

passing PHP array to Oracle Stored Proc (PLS-00306: wrong number or types of arguments)

From Dev

Oracle procedure call results in "PLS-00306: wrong number or types of arguments in call"

From Dev

nPLS-00306: wrong number or types of arguments in call

From Dev

Oracle : PLS-00103 occur on procedure with condition

From Dev

Stored procedure wrong output

From Dev

PLS-00201 - identifier 'Stored-Procedure-Name' must be declared

From Dev

PHP and oracle Stored procedure

From Dev

Oracle wrong number or types error

From Dev

Call Oracle Stored Procedure with Char Out Parameter errors with PLS-00306: wrong number or types of arguments in call

From Dev

PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

From Dev

Wrong number or types of arguments error while calling procedure

From Dev

Oracle stored delete procedure

From Dev

Blank Characters in Stored Procedure Arguments

From Dev

Oracle Stored Procedure problems

From Dev

PLS 00306 Error PL/SQL

From Dev

Stored Procedure in Oracle giving error PLS-00428

From Dev

Wrong number or types of arguments in call to even after correct parameters

From Dev

Stored procedure in mySQL going wrong

From Dev

PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

From Dev

Oracle DB - Stored Procedure has an invalid number of results

From Dev

Oracle Procedure - PLS-00306: wrong number or types of arguments

From Dev

Oracle SQL - SELECT with Variable arguments stored procedure

From Dev

Oracle Stored Procedure - Number of heat waves (number of pattern matches in a series)

From Dev

Wrong number or TYPES of arguments, error in PL/SQL

From Dev

Oracle Stored Procedure and Cursor

Related Related

  1. 1

    PL/SQL: Error "PLS-00306: wrong number or types of arguments in call to" triggered for table of numbers

  2. 2

    Getting wrong number or types of arguments in call to exception while executing stored procedure

  3. 3

    PLS-00306: wrong number or types of arguments in call to 'OUTPUT_ARRAY'

  4. 4

    Stored procedure returning the wrong value?

  5. 5

    passing PHP array to Oracle Stored Proc (PLS-00306: wrong number or types of arguments)

  6. 6

    Oracle procedure call results in "PLS-00306: wrong number or types of arguments in call"

  7. 7

    nPLS-00306: wrong number or types of arguments in call

  8. 8

    Oracle : PLS-00103 occur on procedure with condition

  9. 9

    Stored procedure wrong output

  10. 10

    PLS-00201 - identifier 'Stored-Procedure-Name' must be declared

  11. 11

    PHP and oracle Stored procedure

  12. 12

    Oracle wrong number or types error

  13. 13

    Call Oracle Stored Procedure with Char Out Parameter errors with PLS-00306: wrong number or types of arguments in call

  14. 14

    PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

  15. 15

    Wrong number or types of arguments error while calling procedure

  16. 16

    Oracle stored delete procedure

  17. 17

    Blank Characters in Stored Procedure Arguments

  18. 18

    Oracle Stored Procedure problems

  19. 19

    PLS 00306 Error PL/SQL

  20. 20

    Stored Procedure in Oracle giving error PLS-00428

  21. 21

    Wrong number or types of arguments in call to even after correct parameters

  22. 22

    Stored procedure in mySQL going wrong

  23. 23

    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

  24. 24

    Oracle DB - Stored Procedure has an invalid number of results

  25. 25

    Oracle Procedure - PLS-00306: wrong number or types of arguments

  26. 26

    Oracle SQL - SELECT with Variable arguments stored procedure

  27. 27

    Oracle Stored Procedure - Number of heat waves (number of pattern matches in a series)

  28. 28

    Wrong number or TYPES of arguments, error in PL/SQL

  29. 29

    Oracle Stored Procedure and Cursor

HotTag

Archive