Skip to main content

developerWorks >  Information Management  >  Forums  >  Unleash the new Java, .NET, PHP and Ruby client and Developer solutions for IDS 11  >  developerWorks

How to get output parameters of SP through Informix Net Provider?    Point your RSS reader here for a feed of the latest messages in this thread


Tags for this thread: 

     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 1 - Pages: 1 - Last Post: Jul 23, 2008 7:05 AM Last Post By: ymslx
Frank.Gui

Posts: 2
Registered: Jan 31, 2008 12:29:26 AM
How to get output parameters of SP through Informix Net Provider?
Posted: Jan 31, 2008 12:33:26 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hello, All:

I'm building a new application to call an Informix stored procedure, which has an output parameter. I'm using Informix Net Provider installed along with IBM Informix Client-SDK2.90.
My stored procedure is:
create procedure irp001_p_onepara(i_id int)
returning char(10);
define v_name char(10);
select emp_name into v_name from pub_t_employee where emp_id = i_id;
return v_name;
end procedure

My Net code is like:
........
IfxConnection conn = getConnection(); //Get connection. No probelm here
IfxCommand command = new IfxCommand();
command.CommandType = CommandType.StoredProcedure;
command.Connection = conn;
command.CommandText = "irp001_p_onepara";

IfxCommandBuilder.DeriveParameters(command); //Get parameters

foreach (IfxParameter item in command.Parameters)
{
if (item.ParameterName.Equals("i_id", StringComparison.OrdinalIgnoreCase))
item.Value = 4;
}

IDataReader dr = command.ExecuteReader(CommandBehavior.SingleRow); //An exception occurs
...........

When executing, the following error occurs on the last line:

IBM.Data.Informix.IfxException: ERROR HY000 http://Informix .NET providerInformix
Routine (irp001_p_onepara) can not be resolved.
at IBM.Data.Informix.IfxConnection.HandleError(IntPtr hHandle, SQL_HANDLE hTy
pe, RETCODE retcode)
at IBM.Data.Informix.IfxCommand.ExecuteReaderObject(CommandBehavior behavior,
String method)
at IBM.Data.Informix.IfxCommand.ExecuteReader(CommandBehavior behavior)
at test.informix.InformixTest.TestSP() in D:\My Documents\Visual Studio 2005\
Projects\ConsoleApplication2\ConsoleApplication2\InformixTest.cs:line 73
(Exception under Informix Client-SDK3.00)

System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at IBM.Data.Informix.IfxParameter.GetParameterValue()
at IBM.Data.Informix.IfxParameter.Bind(IntPtr stmt, IfxCommand parent, Int16
ordinal, CNativeBuffer buffer, CNativeBuffer intbuffer)
at IBM.Data.Informix.IfxCommand.ExecuteReaderObject(CommandBehavior behavior,
String method)
at IBM.Data.Informix.IfxCommand.ExecuteReader(CommandBehavior behavior)
at test.informix.InformixTest.TestSP() in D:\Frank_Work\APBNet\ConsoleApplica
tion2\ConsoleApplication2\InformixTest.cs:line 72
(Exception under Informix Client-SDK2.90)

Any one can help me? Thanks.

ymslx

Posts: 2
Registered: Jul 23, 2008 06:29:17 AM
Re: How to get output parameters of SP through Informix Net Provider?
Posted: Jul 23, 2008 07:05:40 AM   in response to: Frank.Gui in response to: Frank.Gui's post
 
Click to report abuse...   Click to reply to this thread Reply
I run into the same problem.
Can you mail me the resolution if you have resolve it?
jecoso(at)gmail.com

Thank you very much^^
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums