1 // created on 21/5/2002 at 20:03
3 // Npgsql.NpgsqlCommand.cs
6 // Francisco Jr. (fxjrlists@yahoo.com.br)
8 // Copyright (C) 2002 The Npgsql Development Team
9 // npgsql-general@gborg.postgresql.org
10 // http://gborg.postgresql.org/project/npgsql/projdisplay.php
12 // This library is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU Lesser General Public
14 // License as published by the Free Software Foundation; either
15 // version 2.1 of the License, or (at your option) any later version.
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Lesser General Public License for more details.
22 // You should have received a copy of the GNU Lesser General Public
23 // License along with this library; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 using System.Net.Sockets;
33 using System.ComponentModel;
34 using System.Collections;
41 /// Represents a SQL statement or function (stored procedure) to execute against a PostgreSQL database. This class cannot be inherited.
43 [System.Drawing.ToolboxBitmapAttribute(typeof(NpgsqlCommand)), ToolboxItem(true)]
44 public sealed class NpgsqlCommand : Component, IDbCommand
47 private NpgsqlConnection connection;
48 private NpgsqlTransaction transaction;
50 private Int32 timeout;
51 private CommandType type;
52 private NpgsqlParameterCollection parameters;
53 private String planName;
54 private static Int32 planIndex = 0;
55 private static Int32 portalIndex = 0;
57 private NpgsqlParse parse;
58 private NpgsqlBind bind;
60 // Logging related values
61 private static readonly String CLASSNAME = "NpgsqlCommand";
62 private System.Resources.ResourceManager resman;
67 /// Initializes a new instance of the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> class.
69 public NpgsqlCommand() : this(String.Empty, null, null)
72 /// Initializes a new instance of the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> class with the text of the query.
74 /// <param name="cmdText">The text of the query.</param>
75 public NpgsqlCommand(String cmdText) : this(cmdText, null, null)
78 /// Initializes a new instance of the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> class with the text of the query and a <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see>.
80 /// <param name="cmdText">The text of the query.</param>
81 /// <param name="connection">A <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> that represents the connection to a PostgreSQL server.</param>
82 public NpgsqlCommand(String cmdText, NpgsqlConnection connection) : this(cmdText, connection, null)
85 /// Initializes a new instance of the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> class with the text of the query, a <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see>, and the <see cref="Npgsql.NpgsqlTransaction">NpgsqlTransaction</see>.
87 /// <param name="cmdText">The text of the query.</param>
88 /// <param name="connection">A <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> that represents the connection to a PostgreSQL server.</param>
89 /// <param name="transaction">The <see cref="Npgsql.NpgsqlTransaction">NpgsqlTransaction</see> in which the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> executes.</param>
90 public NpgsqlCommand(String cmdText, NpgsqlConnection connection, NpgsqlTransaction transaction)
92 resman = new System.Resources.ResourceManager(this.GetType());
93 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME);
95 planName = String.Empty;
97 this.connection = connection;
98 parameters = new NpgsqlParameterCollection();
100 type = CommandType.Text;
101 this.Transaction = transaction;
106 /// Finalizer for <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see>.
113 // Public properties.
115 /// Gets or sets the SQL statement or function (stored procedure) to execute at the data source.
117 /// <value>The Transact-SQL statement or stored procedure to execute. The default is an empty string.</value>
118 [Category("Data"), DefaultValue("")]
119 public String CommandText {
127 // [TODO] Validate commandtext.
128 NpgsqlEventLog.LogPropertySet(LogLevel.Debug, CLASSNAME, "CommandText", value);
130 planName = String.Empty;
137 /// Gets or sets the wait time before terminating the attempt
138 /// to execute a command and generating an error.
140 /// <value>The time (in seconds) to wait for the command to execute.
141 /// The default is 20 seconds.</value>
143 public Int32 CommandTimeout {
152 throw new ArgumentOutOfRangeException(resman.GetString("Exception_CommandTimeoutLessZero"));
155 NpgsqlEventLog.LogPropertySet(LogLevel.Debug, CLASSNAME, "CommandTimeout", value);
160 /// Gets or sets a value indicating how the
161 /// <see cref="Npgsql.NpgsqlCommand.CommandText">CommandText</see> property is to be interpreted.
163 /// <value>One of the <see cref="System.Data.CommandType">CommandType</see> values. The default is <see cref="System.Data.CommandType">CommandType.Text</see>.</value>
164 [Category("Data"), DefaultValue(CommandType.Text)]
165 public CommandType CommandType {
174 NpgsqlEventLog.LogPropertySet(LogLevel.Debug, CLASSNAME, "CommandType", value);
178 IDbConnection IDbCommand.Connection {
186 connection = (NpgsqlConnection) value;
187 NpgsqlEventLog.LogPropertySet(LogLevel.Debug, CLASSNAME, "IDbCommand.Connection", value);
192 /// Gets or sets the <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see>
193 /// used by this instance of the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see>.
195 /// <value>The connection to a data source. The default value is a null reference.</value>
196 [Category("Behavior"), DefaultValue(null)]
197 public NpgsqlConnection Connection {
200 NpgsqlEventLog.LogPropertyGet(LogLevel.Debug, CLASSNAME, "Connection");
206 if (this.transaction != null && this.transaction.Connection == null)
207 this.transaction = null;
208 if (this.connection != null && this.connection.InTransaction == true)
209 throw new InvalidOperationException(resman.GetString("Exception_SetConnectionInTransaction"));
210 this.connection = value;
211 NpgsqlEventLog.LogPropertySet(LogLevel.Debug, CLASSNAME, "Connection", value);
215 IDataParameterCollection IDbCommand.Parameters {
223 /// Gets the <see cref="Npgsql.NpgsqlParameterCollection">NpgsqlParameterCollection</see>.
225 /// <value>The parameters of the SQL statement or function (stored procedure). The default is an empty collection.</value>
226 [Category("Data"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
227 public NpgsqlParameterCollection Parameters {
230 NpgsqlEventLog.LogPropertyGet(LogLevel.Debug, CLASSNAME, "Parameters");
236 /// Gets or sets the <see cref="Npgsql.NpgsqlTransaction">NpgsqlTransaction</see>
237 /// within which the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> executes.
239 /// <value>The <see cref="Npgsql.NpgsqlTransaction">NpgsqlTransaction</see>.
240 /// The default value is a null reference.</value>
241 [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
242 public IDbTransaction Transaction {
245 NpgsqlEventLog.LogPropertyGet(LogLevel.Debug, CLASSNAME, "Transaction");
247 if (this.transaction != null && this.transaction.Connection == null)
249 this.transaction = null;
251 return this.transaction;
256 NpgsqlEventLog.LogPropertySet(LogLevel.Debug, CLASSNAME, "Transaction" ,value);
258 this.transaction = (NpgsqlTransaction) value;
263 /// Gets or sets how command results are applied to the <see cref="System.Data.DataRow">DataRow</see>
264 /// when used by the <see cref="System.Data.Common.DbDataAdapter.Update">Update</see>
265 /// method of the <see cref="System.Data.Common.DbDataAdapter">DbDataAdapter</see>.
267 /// <value>One of the <see cref="System.Data.UpdateRowSource">UpdateRowSource</see> values.</value>
268 [Category("Behavior"), DefaultValue(UpdateRowSource.Both)]
269 public UpdateRowSource UpdatedRowSource {
273 NpgsqlEventLog.LogPropertyGet(LogLevel.Debug, CLASSNAME, "UpdatedRowSource");
275 return UpdateRowSource.Both;
280 throw new NotImplementedException();
285 /// Attempts to cancel the execution of a <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see>.
287 /// <remarks>This Method isn't implemented yet.</remarks>
290 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Cancel");
292 // [TODO] Finish method implementation.
293 throw new NotImplementedException();
297 /// Creates a new instance of an <see cref="System.Data.IDbDataParameter">IDbDataParameter</see> object.
299 /// <returns>An <see cref="System.Data.IDbDataParameter">IDbDataParameter</see> object.</returns>
300 IDbDataParameter IDbCommand.CreateParameter()
302 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "IDbCommand.CreateParameter");
304 return (NpgsqlParameter) CreateParameter();
308 /// Creates a new instance of a <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object.
310 /// <returns>A <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object.</returns>
311 public NpgsqlParameter CreateParameter()
313 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "CreateParameter");
315 return new NpgsqlParameter();
319 /// Executes a SQL statement against the connection and returns the number of rows affected.
321 /// <returns>The number of rows affected.</returns>
322 public Int32 ExecuteNonQuery()
324 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ExecuteNonQuery");
328 // If nothing is returned, just return -1.
329 if(connection.Mediator.CompletedResponses.Count == 0) {
333 // Check if the response is available.
334 String firstCompletedResponse = (String)connection.Mediator.CompletedResponses[0];
336 if (firstCompletedResponse == null)
339 String[] ret_string_tokens = firstCompletedResponse.Split(null); // whitespace separator.
342 // Check if the command was insert, delete or update.
343 // Only theses commands return rows affected.
344 // [FIXME] Is there a better way to check this??
345 if ((String.Compare(ret_string_tokens[0], "INSERT", true) == 0) ||
346 (String.Compare(ret_string_tokens[0], "UPDATE", true) == 0) ||
347 (String.Compare(ret_string_tokens[0], "DELETE", true) == 0))
349 // The number of rows affected is in the third token for insert queries
350 // and in the second token for update and delete queries.
351 // In other words, it is the last token in the 0-based array.
353 return Int32.Parse(ret_string_tokens[ret_string_tokens.Length - 1]);
359 /// Sends the <see cref="Npgsql.NpgsqlCommand.CommandText">CommandText</see> to
360 /// the <see cref="Npgsql.NpgsqlConnection">Connection</see> and builds a
361 /// <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see>.
363 /// <returns>A <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see> object.</returns>
364 IDataReader IDbCommand.ExecuteReader()
366 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "IDbCommand.ExecuteReader");
368 return (NpgsqlDataReader) ExecuteReader();
372 /// Sends the <see cref="Npgsql.NpgsqlCommand.CommandText">CommandText</see> to
373 /// the <see cref="Npgsql.NpgsqlConnection">Connection</see> and builds a
374 /// <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see>
375 /// using one of the <see cref="System.Data.CommandBehavior">CommandBehavior</see> values.
377 /// <param name="cb">One of the <see cref="System.Data.CommandBehavior">CommandBehavior</see> values.</param>
378 /// <returns>A <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see> object.</returns>
379 IDataReader IDbCommand.ExecuteReader(CommandBehavior cb)
381 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "IDbCommand.ExecuteReader", cb);
383 return (NpgsqlDataReader) ExecuteReader(cb);
387 /// Sends the <see cref="Npgsql.NpgsqlCommand.CommandText">CommandText</see> to
388 /// the <see cref="Npgsql.NpgsqlConnection">Connection</see> and builds a
389 /// <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see>.
391 /// <returns>A <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see> object.</returns>
392 public NpgsqlDataReader ExecuteReader()
394 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ExecuteReader");
396 return ExecuteReader(CommandBehavior.Default);
400 /// Sends the <see cref="Npgsql.NpgsqlCommand.CommandText">CommandText</see> to
401 /// the <see cref="Npgsql.NpgsqlConnection">Connection</see> and builds a
402 /// <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see>
403 /// using one of the <see cref="System.Data.CommandBehavior">CommandBehavior</see> values.
405 /// <param name="cb">One of the <see cref="System.Data.CommandBehavior">CommandBehavior</see> values.</param>
406 /// <returns>A <see cref="Npgsql.NpgsqlDataReader">NpgsqlDataReader</see> object.</returns>
407 /// <remarks>Currently the CommandBehavior parameter is ignored.</remarks>
408 public NpgsqlDataReader ExecuteReader(CommandBehavior cb)
410 // [FIXME] No command behavior handling.
412 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ExecuteReader", cb);
416 // Get the resultsets and create a Datareader with them.
417 return new NpgsqlDataReader(connection.Mediator.ResultSets, connection.Mediator.CompletedResponses, connection, cb);
421 /// This method binds the parameters from parameters collection to the bind
424 private void BindParameters()
427 if (parameters.Count != 0)
429 Object[] parameterValues = new Object[parameters.Count];
430 for (Int32 i = 0; i < parameters.Count; i++)
432 // Do not quote strings, or escape existing quotes - this will be handled by the backend.
433 parameterValues[i] = NpgsqlTypesHelper.ConvertNpgsqlParameterToBackendStringValue(parameters[i], false);
435 bind.ParameterValues = parameterValues;
438 connection.Bind(bind);
439 connection.Mediator.RequireReadyForQuery = false;
442 connection.CheckErrorsAndNotifications();
446 /// Executes the query, and returns the first column of the first row
447 /// in the result set returned by the query. Extra columns or rows are ignored.
449 /// <returns>The first column of the first row in the result set,
450 /// or a null reference if the result set is empty.</returns>
451 public Object ExecuteScalar()
453 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ExecuteScalar");
455 /*if ((type == CommandType.Text) || (type == CommandType.StoredProcedure))
457 connection.Query(this);
461 connection.Execute(new NpgsqlExecute(bind.PortalName, 0));
464 throw new NotImplementedException(resman.GetString("Exception_CommandTypeTableDirect"));
469 // Now get the results.
470 // Only the first column of the first row must be returned.
473 ArrayList resultSets = connection.Mediator.ResultSets;
475 // First data is the RowDescription object.
476 // Check all resultsets as insert commands could have been sent along
477 // with resultset queries. The insert commands return null and and some queries
478 // may return empty resultsets, so, if we find one of these, skip to next resultset.
479 // If no resultset is found, return null as per specification.
481 NpgsqlAsciiRow ascii_row = null;
482 foreach( NpgsqlResultSet nrs in resultSets )
484 if( (nrs != null) && (nrs.Count > 0) )
486 ascii_row = (NpgsqlAsciiRow) nrs[0];
495 /// Creates a prepared version of the command on a PostgreSQL server.
497 public void Prepare()
499 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Prepare");
501 // Check the connection state.
502 CheckConnectionState();
504 if (! connection.SupportsPrepare) {
505 return; // Do nothing.
508 if (connection.BackendProtocolVersion == ProtocolVersion.Version2)
510 NpgsqlCommand command = new NpgsqlCommand(GetPrepareCommandText(), connection );
511 command.ExecuteNonQuery();
515 // Use the extended query parsing...
516 planName = "NpgsqlPlan" + System.Threading.Interlocked.Increment(ref planIndex);
517 String portalName = "NpgsqlPortal" + System.Threading.Interlocked.Increment(ref portalIndex);
519 parse = new NpgsqlParse(planName, GetParseCommandText(), new Int32[] {});
521 connection.Parse(parse);
522 connection.Mediator.RequireReadyForQuery = false;
525 // Check for errors and/or notifications and do the Right Thing.
526 connection.CheckErrorsAndNotifications();
528 bind = new NpgsqlBind(portalName, planName, new Int16[] {0}, null, new Int16[] {0});
534 /// Releases the resources used by the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see>.
536 protected override void Dispose (bool disposing)
541 // Only if explicitly calling Close or dispose we still have access to
542 // managed resources.
543 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Dispose");
544 if (connection != null)
546 connection.Dispose();
548 base.Dispose(disposing);
554 /// This method checks the connection state to see if the connection
555 /// is set or it is open. If one of this conditions is not met, throws
556 /// an InvalidOperationException
558 private void CheckConnectionState()
560 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "CheckConnectionState");
562 // Check the connection state.
563 if (connection == null)
564 throw new InvalidOperationException(resman.GetString("Exception_ConnectionNull"));
565 if (connection.State != ConnectionState.Open)
566 throw new InvalidOperationException(resman.GetString("Exception_ConnectionNotOpen"));
571 /// This method substitutes the <see cref="Npgsql.NpgsqlCommand.Parameters">Parameters</see>, if exist, in the command
572 /// to their actual values.
573 /// The parameter name format is <b>:ParameterName</b>.
575 /// <returns>A version of <see cref="Npgsql.NpgsqlCommand.CommandText">CommandText</see> with the <see cref="Npgsql.NpgsqlCommand.Parameters">Parameters</see> inserted.</returns>
576 internal String GetCommandText()
578 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetCommandText");
580 if (planName == String.Empty)
581 return GetClearCommandText();
583 return GetPreparedCommandText();
587 private String GetClearCommandText()
589 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetClearCommandText");
592 String result = text;
594 if (type == CommandType.StoredProcedure)
595 if (connection.SupportsPrepare)
596 result = "select * from " + result; // This syntax is only available in 7.3+ as well SupportsPrepare.
598 result = "select " + result; // Only a single result return supported. 7.2 and earlier.
599 else if (type == CommandType.TableDirect)
600 return "select * from " + result; // There is no parameter support on table direct.
602 if (parameters.Count == 0)
608 String parameterName;
610 for (Int32 i = 0; i < parameters.Count; i++)
612 parameterName = parameters[i].ParameterName;
614 result = ReplaceParameterValue(result, parameterName, NpgsqlTypesHelper.ConvertNpgsqlParameterToBackendStringValue(parameters[i], true));
624 private String GetPreparedCommandText()
626 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetPreparedCommandText");
628 if (parameters.Count == 0)
629 return "execute " + planName;
632 StringBuilder result = new StringBuilder("execute " + planName + '(');
635 for (Int32 i = 0; i < parameters.Count; i++)
637 result.Append(NpgsqlTypesHelper.ConvertNpgsqlParameterToBackendStringValue(parameters[i], false) + ',');
640 result = result.Remove(result.Length - 1, 1);
643 return result.ToString();
649 private String GetParseCommandText()
651 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetParseCommandText");
653 String parseCommand = text;
655 if (type == CommandType.StoredProcedure)
656 parseCommand = "select * from " + parseCommand; // This syntax is only available in 7.3+ as well SupportsPrepare.
657 else if (type == CommandType.TableDirect)
658 return "select * from " + parseCommand; // There is no parameter support on TableDirect.
660 if (parameters.Count > 0)
662 // The ReplaceParameterValue below, also checks if the parameter is present.
664 String parameterName;
667 for (i = 0; i < parameters.Count; i++)
669 //result = result.Replace(":" + parameterName, parameters[i].Value.ToString());
670 parameterName = parameters[i].ParameterName;
671 //textCommand = textCommand.Replace(':' + parameterName, "$" + (i+1));
672 parseCommand = ReplaceParameterValue(parseCommand, parameterName, "$" + (i+1));
682 private String GetPrepareCommandText()
684 NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetPrepareCommandText");
688 planName = "NpgsqlPlan" + System.Threading.Interlocked.Increment(ref planIndex);
690 StringBuilder command = new StringBuilder("prepare " + planName);
692 String textCommand = text;
694 if (type == CommandType.StoredProcedure)
695 textCommand = "select * from " + textCommand;
696 else if (type == CommandType.TableDirect)
697 return "select * from " + textCommand; // There is no parameter support on TableDirect.
700 if (parameters.Count > 0)
702 // The ReplaceParameterValue below, also checks if the parameter is present.
704 String parameterName;
707 for (i = 0; i < parameters.Count; i++)
709 //result = result.Replace(":" + parameterName, parameters[i].Value.ToString());
710 parameterName = parameters[i].ParameterName;
711 // The space in front of '$' fixes a parsing problem in 7.3 server
712 // which gives errors of operator when finding the caracters '=$' in
714 textCommand = ReplaceParameterValue(textCommand, parameterName, " $" + (i+1));
718 //[TODO] Check if there is any missing parameters in the query.
719 // For while, an error is thrown saying about the ':' char.
723 for (i = 0; i < parameters.Count; i++)
725 command.Append(NpgsqlTypesHelper.GetBackendTypeNameFromDbType(parameters[i].DbType));
730 command = command.Remove(command.Length - 1, 1);
735 command.Append(" as ");
736 command.Append(textCommand);
739 return command.ToString();
744 private String ReplaceParameterValue(String result, String parameterName, String paramVal)
746 Int32 resLen = result.Length;
747 Int32 paramStart = result.IndexOf(parameterName);
748 Int32 paramLen = parameterName.Length;
749 Int32 paramEnd = paramStart + paramLen;
750 Boolean found = false;
752 while(paramStart > -1)
754 if((resLen > paramEnd) &&
755 (result[paramEnd] == ' ' ||
756 result[paramEnd] == ',' ||
757 result[paramEnd] == ')' ||
758 result[paramEnd] == ';'))
760 result = result.Substring(0, paramStart) + paramVal + result.Substring(paramEnd);
763 else if(resLen == paramEnd)
765 result = result.Substring(0, paramStart)+ paramVal;
770 resLen = result.Length;
771 paramStart = result.IndexOf(parameterName, paramStart);
772 paramEnd = paramStart + paramLen;
776 throw new IndexOutOfRangeException (String.Format(resman.GetString("Exception_ParamNotInQuery"), parameterName));
779 }//ReplaceParameterValue
782 private void ExecuteCommand()
784 // Check the connection state first.
785 CheckConnectionState();
788 connection.Query(this);
790 // Check for errors and/or notifications and do the Right Thing.
791 connection.CheckErrorsAndNotifications();
795 // Check for errors and/or notifications and do the Right Thing.
796 connection.CheckErrorsAndNotifications();
798 connection.Execute(new NpgsqlExecute(bind.PortalName, 0));
800 // Check for errors and/or notifications and do the Right Thing.
801 connection.CheckErrorsAndNotifications();
804 throw new NotImplementedException(resman.GetString("Exception_CommandTypeTableDirect"));*/