[pgsqlclient-checkins] SF.net SVN: pgsqlclient: [144] trunk/PostgreSqlClient/source/PostgreSql/Data/
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2006-05-18 19:49:23
|
Revision: 144 Author: carlosga_fb Date: 2006-05-18 12:49:14 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=144&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Added initial refcursor support for StoredProcedure calls to the PgDataReader class ( multiple refcursor's supported ). Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -46,6 +46,7 @@ Path , Point , Polygon , + Refcursor , Text , Time , TimeWithTZ , Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -101,7 +101,7 @@ DataTypes.Add(1560 , "bit" , PgDataType.Byte , 0, PgTypeFormat.Text, 1); DataTypes.Add(1562 , "varbit" , PgDataType.Byte , 0, PgTypeFormat.Binary, 0); DataTypes.Add(1700 , "numeric" , PgDataType.Decimal , 0, PgTypeFormat.Text, 8); - DataTypes.Add(1790 , "refcursor" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); + DataTypes.Add(1790 , "refcursor" , PgDataType.Refcursor , 0, PgTypeFormat.Text, 0); DataTypes.Add(2277 , "anyarray" , PgDataType.Array , 0, PgTypeFormat.Binary, 8); } Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -397,6 +397,7 @@ return this.ReadString(length).TrimEnd(); case PgDataType.VarChar: + case PgDataType.Refcursor: return this.ReadString(length); case PgDataType.Boolean: @@ -488,7 +489,8 @@ case PgDataType.Char: return stringValue.TrimEnd(); - case PgDataType.VarChar: + case PgDataType.VarChar: + case PgDataType.Refcursor: return stringValue; case PgDataType.Boolean: Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -318,7 +318,7 @@ packet.Write((short)this.rowDescriptor.Fields.Length); for (int i = 0; i < this.rowDescriptor.Fields.Length; i++) { - packet.Write((short)this.rowDescriptor.Fields[i].DataType.FormatCode); + packet.Write((short)this.rowDescriptor.Fields[i].FormatCode); } // Send packet to the server Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -81,6 +81,48 @@ get { return this.size; } } + public bool IsNumeric + { + get + { + bool returnValue = false; + + if (this.dataType == PgDataType.Currency || + this.dataType == PgDataType.Int2 || + this.dataType == PgDataType.Int4 || + this.dataType == PgDataType.Int8 || + this.dataType == PgDataType.Float || + this.dataType == PgDataType.Double || + this.dataType == PgDataType.Decimal || + this.dataType == PgDataType.Byte) + { + returnValue = true; + } + + return returnValue; + } + } + + public bool IsLong + { + get + { + bool returnValue = false; + + if (this.dataType == PgDataType.Binary) + { + returnValue = true; + } + + return returnValue; + } + } + + public bool IsRefCursor + { + get { return (this.DataType == PgDataType.Refcursor); } + } + #endregion #region \xB7 Constructors \xB7 @@ -98,41 +140,6 @@ #endregion - #region \xB7 Methods \xB7 - - public bool IsNumeric() - { - bool returnValue = false; - - if (this.dataType == PgDataType.Currency || - this.dataType == PgDataType.Int2 || - this.dataType == PgDataType.Int4 || - this.dataType == PgDataType.Int8 || - this.dataType == PgDataType.Float || - this.dataType == PgDataType.Double || - this.dataType == PgDataType.Decimal || - this.dataType == PgDataType.Byte) - { - returnValue = true; - } - - return returnValue; - } - - public bool IsLong() - { - bool returnValue = false; - - if (this.dataType == PgDataType.Binary) - { - returnValue = true; - } - - return returnValue; - } - - #endregion - #region \xB7 Private Methods \xB7 private Type InferSystemType() @@ -203,6 +210,9 @@ case PgDataType.Int8: return Type.GetType("System.Int64"); + case PgDataType.Refcursor: + return typeof(DataTable); + default: return Type.GetType("System.Object"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |