SCM

[#1010184] error in fxn with in params and return refcursor

View Trackers | Bugs | Download .csv | Monitor

Date:
2007-11-13 21:59
Priority:
3
State:
Open
Submitted by:
jason mcilvain (mcilvain)
Assigned to:
Nobody (None)
Npgsql Version:
2.0
Category:
Group:
Resolution:
None
Summary:
error in fxn with in params and return refcursor

Detailed description
calling a function that returns a refcursor works only if no parameters are included.

the following works(as shown in manual):
NpgsqlConnection conn = new NpgsqlConnection("Server=localhost;Port=5432;User id=x;password=x;Database=x;");
conn.Open();
NpgsqlTransaction t = conn.BeginTransaction();
NpgsqlCommand command = new NpgsqlCommand("x.qry_test3", conn);
command.CommandType = CommandType.StoredProcedure;
command.Transaction = t;
NpgsqlDataAdapter da = new NpgsqlDataAdapter(command);
DataSet myDS = new DataSet();
da.Fill(myDS);



However with paramseters it does not:

NpgsqlConnection conn = new NpgsqlConnection("Server=localhost;Port=5432;User id=x;password=x;Database=x;");
conn.Open();
NpgsqlTransaction t = conn.BeginTransaction();
NpgsqlCommand command = new NpgsqlCommand("cx.qry_test3", conn);
command.CommandType = CommandType.StoredProcedure;
command.Transaction = t;
command.Parameters.Add(new NpgsqlParameter("p_usr_nm", DbType.String));
command.Parameters[0].Direction = ParameterDirection.Input;
command.Parameters[0].Value = "me";
NpgsqlDataAdapter da = new NpgsqlDataAdapter(command);
DataSet myDS = new DataSet();
da.Fill(myDS);

I have tried almost every possible permutation of adding parameters and none worked. The result I always get is a single column with the name of the function.

any help would be greatly appreciated.
regards,
Jason

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge