Click here to Skip to main content
15,881,831 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am trying to call the Oracle function using the following code but it is showing the error like

"ORA-01403: no data found\nORA-06512: at \"TEST.VOD_BULK_TRANS1\", line 47\nORA-06512: at line 1"

the function takes 3 input parameters and return one integer value.
C#
using (OleDbConnection conn= new OleDbConnection(connectionString))
{
    conn.Open();
    
    //set the command text (stored procedure name or SQL statement)
    command.CommandText = "VOD_BULK_TRANS1";
   command.CommandType=CommandType.StoredProcedure;
    
    command.Parameters.Add(new OleDbParameter("retVal", OleDbType.Integer, 11, ParameterDirection.ReturnValue, true, 0, 0, "retVal", DataRowVersion.Current,null));
    command.Parameters.Add( OleDbParameter("@t_list", videosListWithCommaSeparated);
    command.Parameters.Add( OleDbParameter("@option1", 3);
    command.Parameters.Add( OleDbParameter("@id1", groupId);
    command.ExecuteNonQuery();
}


Please suggest me the way how to call the function or stored procedure using the Oledb Conneciton..

Thanks
Posted
Updated 9-Sep-14 23:06pm
v3

1 solution

Have you tried to set

C#
command.CommandType = CommandType.StoredProcedure;


I think the default is CommandType.Text

[Update]
ORA-06512: This error is caused by the stack being unwound by unhandled exceptions in your PLSQL code.
ORACLE/PLSQL: ORA-06512[^]

I think your c# code is ok, but the stored procedure throws an exception.
That might be because you are not matching the input parameters properly or that if no data is found, the SP doesn't return, but continues to execute with uninitialized variables.

Without seeing your SP declaration and SQL code, it is very difficult to help you.
Quote:
the function takes 3 input parameters and return one integer value.

The info above is not very useful without type information.

A variable with a name like this videosListWithCommaSeparated also raises suspicions when the internal SP code is unknown. Comma separated lists can be a cause of problems.
 
Share this answer
 
v2
Comments
V G S Naidu A 9-Sep-14 23:22pm    
yaa i tried with commandType.StoredProcedure, but i forgot to mention, but showing the same error..
George Jonsson 9-Sep-14 23:59pm    
Then you should update the question with this info.
What is the declaration of your stored procedure? (Like name, input, output parameters)
What happens if you call the stored procedure directly with the same input values?
Maybe add this information too.
The more relevant information you give the better the answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900