Sign in Join
FPDoc Onlineexperiment

TCustomSQLStatement class

In unit SQLDB

Object to execute SQL statements without result set.

Declaration

pascal
TCustomSQLStatement = class(TComponent)

Inheritance

  1. TCustomSQLStatement
  2. TComponent
  3. TPersistent
  4. TObject

Descends from it: TSQLStatement

Description

TCustomSQLStatement is a light-weight object that can be used to execute SQL statements on a database. It does not support result sets, and has none of the methods that a TDataset component has. It can be used to execute SQL statements on a database that update data, execute stored procedures and DDL statements etc.

The TCustomSQLStatement is equivalent to TSQLQuery in that it supports transactions (in the Transaction property) and parameters (in the Params property) and as such is a more versatile tool than executing queries using ExecuteDirect.

To use a TCustomSQLStatement is simple and similar to the use of TSQLQuery: set the Database property to an existing connection component, and set the Transaction property. After setting the SQL property and filling Params, the SQL statement can be executed with the Execute method.

TCustomSQLStatement is a parent class. Many of the properties are only made public (or published) in the TSQLStatement class, which should be instantiated instead of the TCustomSQLStatement class.

See also

Properties

Cursorprotected
Databaseprotected
Transactionprotected
SQLprotected
Paramsprotected
MacrosprotectedSet of macros for this SQL statement.
MacroCharprotected
DataSourceprotected
ParseSQLprotected
ParamCheckprotected
MacroCheckprotectedCheck for macros in the SQL statement.
InfoQueryprotected
PreparedpublicIs the statement prepared or not.

Methods

CreateDataLinkprotected
OnChangeSQLprotected
GetDataSourceprotected
SetDataSourceprotected
CopyParamsFromMasterprotected
AllocateCursorprotected
DeAllocateCursorprotected
GetSchemaTypeprotected
GetSchemaObjectNameprotected
GetSchemaPatternprotected
IsSelectableprotected
GetStatementInfoprotected
DoExecuteprotected
DoPrepareprotected
DoUnPrepareprotected
CreateParamsprotected
LogEventprotected
Logprotected
NotificationprotectedCalled by components that are freed and which received a FreeNotification.
CreatepublicCreate a new instance of TCustomSQLStatement.
DestroypublicDestroy a TCustomSQLStatement instance.
PreparepublicPrepare the statement for execution.
ExecutepublicExecute the SQL statement.
UnpreparepublicUnprepare a previously prepared statement.
ParamByNamepublicFind a parameter by name.
RowsAffectedpublicNumber of rows affected by the SQL statement.

Events

OnSQLChangedprotected

Inherited

From TComponent (73)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.