[pgsqlclient-checkins] pgsqlclient/PostgreSql.Data.PGSqlClient/source PGCommand.cs,1.4,1.5 PGDataRea
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-07-28 12:18:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv29789 Modified Files: PGCommand.cs PGDataReader.cs Log Message: - Added support for Function calls using CommandType.StoredProcedure. Index: PGCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGCommand.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PGCommand.cs 16 Jul 2003 14:09:12 -0000 1.4 --- PGCommand.cs 28 Jul 2003 12:18:48 -0000 1.5 *************** *** 316,319 **** --- 316,321 ---- InternalPrepare(); InternalExecute(); + + InternalSetOutputParameters(); return statement.RecordsAffected; *************** *** 459,462 **** --- 461,470 ---- statement.Status == PGStatementStatus.Error) { + if (commandType == CommandType.StoredProcedure && + !CommandText.ToUpper().StartsWith("SELECT * FROM ")) + { + CommandText = "SELECT * FROM " + CommandText; + } + if (parameters.Count != 0) { *************** *** 549,555 **** } ! internal void SetOutputParameterValues() { ! /* TODO: Add implementation */ } --- 557,579 ---- } ! internal void InternalSetOutputParameters() { ! if (this.CommandType == CommandType.StoredProcedure && parameters.Count > 0) ! { ! IEnumerator paramEnumerator = Parameters.GetEnumerator(); ! int i = 0; ! ! object[] values = (object[])statement.Rows[0]; ! ! while (paramEnumerator.MoveNext()) ! { ! if (((PGParameter)paramEnumerator.Current).Direction == ParameterDirection.Output || ! ((PGParameter)paramEnumerator.Current).Direction == ParameterDirection.ReturnValue) ! { ! ((PGParameter)paramEnumerator.Current).Value = values[i]; ! i++; ! } ! } ! } } Index: PGDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient/PostgreSql.Data.PGSqlClient/source/PGDataReader.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PGDataReader.cs 16 Jul 2003 19:33:21 -0000 1.7 --- PGDataReader.cs 28 Jul 2003 12:18:48 -0000 1.8 *************** *** 144,148 **** { // Set values of output parameters ! // TODO : Implement // Close statement --- 144,148 ---- { // Set values of output parameters ! command.InternalSetOutputParameters(); // Close statement |