TCustomSQLQuery class
Custom Class to handle SQL commands (with or without result set).
Declaration
TCustomSQLQuery = class(TCustomBufDataset)Inheritance
Descends from it: TSQLQuery
Description
TCustomSQLQuery encapsulates a SQL statement: it implements
all the necessary
TDataset functionality to be
able to handle a result set. It can also be used to execute SQL statements
that do not return data, using the
ExecSQL method.
Do not instantiate a TCustomSQLQuery class directly,
instead use the TSQLQuery descendent.
See also
Properties
TableName | protected | |
Prepared | public | Is the query prepared ? |
SQLConnection | public | Database as TSQLConnection. |
SQLTransaction | public | Transaction as TSQLTransaction. |
Active | protected | Is the dataset open or closed. |
Filter | protected | Filter to apply to the data in memory. |
Filtered | protected | Is the filter active or not. |
BeforeOpen | protected | Event triggered before the dataset is opened. |
AfterOpen | protected | Event triggered after the dataset is opened. |
BeforeClose | protected | Event triggered before the dataset is closed. |
AfterClose | protected | Event triggered after the dataset is closed. |
BeforeInsert | protected | Event triggered before the dataset is put in insert mode. |
AfterInsert | protected | Event triggered after the dataset is put in insert mode. |
BeforeEdit | protected | Event triggered before the dataset is put in edit mode. |
AfterEdit | protected | Event triggered after the dataset is put in edit mode. |
BeforePost | protected | Event called before changes are posted to the underlying database. |
AfterPost | protected | Event called after changes have been posted to the underlying database. |
BeforeCancel | protected | Event triggered before a Cancel operation. |
AfterCancel | protected | Event triggered after a Cancel operation. |
BeforeDelete | protected | Event triggered before a Delete operation. |
AfterDelete | protected | Event triggered after a successful Delete operation. |
BeforeRefresh | protected | Event triggered before the data is refreshed. |
AfterRefresh | protected | Event triggered after the data has been refreshed. |
BeforeScroll | protected | Event triggered before the cursor changes position. |
AfterScroll | protected | Event triggered after the cursor has changed position. |
AutoCalcFields | protected | How often should the value of calculated fields be calculated. |
Database | protected | Database this dataset is connected to. |
Transaction | protected | Transaction in which this dataset is running. |
SchemaType | protected | |
SQL | protected | |
InsertSQL | protected | |
UpdateSQL | protected | |
DeleteSQL | protected | |
RefreshSQL | protected | |
Options | protected | |
Params | protected | |
ParamCheck | protected | |
Macros | protected | Set of macros for this SQL statement. |
MacroCheck | protected | Check for macros in the SQL statement. |
MacroChar | protected | Macro delimiter character. |
ParseSQL | protected | |
UpdateMode | protected | |
UsePrimaryKeyAsKey | protected | |
StatementType | protected | |
DataSource | protected | Datasource this dataset is connected to. |
Sequence | protected | |
ServerFilter | protected | |
ServerFiltered | protected | |
ServerIndexDefs | protected |
Methods
OpenCursor | protected | |
CreateSQLStatement | protected | |
CreateParams | protected | |
RefreshLastInsertID | protected | |
NeedRefreshRecord | protected | |
RefreshRecord | protected | |
ApplyReturningResult | protected | |
Cursor | protected | |
LogEvent | protected | |
Log | protected | |
Fetch | protected | An empty implementation in TCustomBufDataset. |
LoadField | protected | An empty implementation in TCustomBufDataset. |
LoadBlobIntoBuffer | protected | Loads a Blob buffer for the specified field into the current record buffer. |
ApplyRecUpdate | protected | Raises an exception. ApplyRecUpdate is not supported in TCustomBufDataset and descendent classes. |
SetPacketRecords | protected | Sets the value for the PacketRecords property. |
UpdateServerIndexDefs | protected | |
SetDatabase | protected | |
SetTransaction | protected | |
InternalAddRecord | protected | |
InternalClose | protected | Performs actions needed to close the dataset. |
InternalInitFieldDefs | protected | Performs actions needed to initialize field definitions for the dataset. |
InternalOpen | protected | Performs actions needed to open the dataset. |
InternalRefresh | protected | Performs actions needed to refresh records in the dataset. |
GetCanModify | protected | Gets the value for the CanModify property. |
IsPrepared | protected | |
SetServerFiltered | protected | |
SetServerFilterText | protected | |
GetDataSource | protected | |
SetDataSource | protected | |
BeforeRefreshOpenCursor | protected | An empty implementation in TCustomBufDataset. |
SetReadOnly | protected | Sets the value in the ReadOnly property. |
Notification | protected | Called by components that are freed and which received a FreeNotification. |
DoOnNewRecord | protected | |
DoBeforePost | protected | |
FieldDefsClass | protected | |
PSGetUpdateException | protected | |
PSGetTableName | protected | |
Create | public | Create a new instance of TCustomSQLQuery. |
Destroy | public | Destroy instance of TCustomSQLQuery. |
Prepare | public | Prepare a query for execution. |
UnPrepare | public | Unprepare a prepared query. |
ExecSQL | public | Execute a SQL statement that does not return a result set. |
SetSchemaInfo | public | SetSchemaInfo prepares the dataset to retrieve schema info. |
RowsAffected | public | Return the number of rows (records) affected by the last DML/DDL statement. |
ParamByName | public | Return parameter by name. |
MacroByName | public | Convenience for Macros.ParamByName. |
ApplyUpdates | public | Apply updates and check result. |
Post | public | Post pending changes and optionally apply updates. |
Delete | public | Delete and optionally apply updates. |
Events
OnCalcFields | protected | Event triggered when values for calculated fields must be computed. |
OnDeleteError | protected | Event triggered when a delete operation fails. |
OnEditError | protected | Event triggered when an edit operation fails. |
OnFilterRecord | protected | Event triggered to filter records. |
OnNewRecord | protected | Event triggered when a new record is created. |
OnPostError | protected | Event triggered when a post operation fails. |
Inherited
From TCustomBufDataset (75)
AddIndex AllocRecordBuffer ApplyRecUpdateEx BookmarkValid CancelUpdates ChangeCount Clear ClearCalcFields ClearIndexes CompareBookmarks CopyFromDataset CreateBlobStream CreateDataset CreateDefaultPacketReader DataEvent DefaultPacketClass DefaultReadFileFormat DefaultWriteFileFormat DoBeforeClose DoFilterRecord DoLocate FileName FreeBlobBuffer FreeRecordBuffer GetBookmarkData GetBookmarkFlag GetChangeCount GetDatasetPacket GetFieldData GetNewBlobBuffer GetNewWriteBlobBuffer getnextpacket GetPacketReader GetRecNo GetRecord GetRecordCount GetRecordSize IndexDefs IndexFieldNames IndexName InternalAddIndex InternalCancel InternalDelete InternalFirst InternalGotoBookmark InternalInitRecord InternalLast InternalPost InternalSetToRecord IsCursorOpen IsReadFromPacket LoadFromFile LoadFromStream Locate Lookup ManualMergeChangeLog MaxIndexesCount MergeChangeLog OnUpdateError PacketRecords ReadOnly Refreshing RevertRecord SaveToFile SaveToStream SetBookmarkData SetBookmarkFlag SetDatasetPacket SetFieldData SetFiltered SetFilterText SetOnUpdateError SetRecNo UniDirectional UpdateStatus
From TDBDataset (1)
From TDataSet (167)
ActivateBuffers ActiveBuffer ActiveRecord Append AppendRecord BindFields BlobFieldCount BlockReadNext BlockReadSize BOF Bookmark BookmarkAvailable BookmarkSize BufferCount Buffers CalcBuffer CalcFieldsSize CalculateFields Cancel CanModify CheckActive CheckBiDirectional CheckBrowseMode CheckInactive ClearBuffers ClearFields Close CloseBlob CloseCursor Constraints ControlsDisabled CreateFields CurrentRecord CursorPosChanged DataConvert DefaultFields DestroyFields DisableControls DoAfterCancel DoAfterClose DoAfterDelete DoAfterEdit DoAfterInsert DoAfterOpen DoAfterPost DoAfterRefresh DoAfterScroll DoBeforeCancel DoBeforeDelete DoBeforeEdit DoBeforeInsert DoBeforeOpen DoBeforeRefresh DoBeforeScroll DoOnCalcFields Edit EnableControls EOF FieldByName FieldByNumber FieldCount FieldDefs Fields FieldsClass FieldValues FilterOptions FindField FindFirst FindLast FindNext FindPrior FindRecord First Found FreeBookmark FreeFieldBuffers GetBookmark GetBookmarkStr GetCalcFields GetChildren GetCurrentRecord GetDefaultBufferCount GetFieldClass GetfieldCount GetFieldList GetFieldNames GetFieldValues GetIndexDefs GetIsIndexField GetNextRecord GetNextRecords GetPriorRecord GetPriorRecords GotoBookmark InitFieldDefs InitFieldDefsFromFields InitRecord Insert InsertRecord InternalCalcFields InternalEdit InternalHandleException InternalInsert IsEmpty IsLinkedTo IsSequenced IsUniDirectional Last Loaded Modified MoveBy MyDataSourceCount MyDataSources Next Open OpenCursorcomplete Prior PSEndTransaction PSExecute PSExecuteStatement PSGetAttributes PSGetCommandText PSGetCommandType PSGetDefaultOrder PSGetIndexDefs PSGetKeyFields PSGetParams PSGetQuoteChar PSInTransaction PSIsSQLBased PSIsSQLSupported PSReset PSSetCommandText PSSetParams PSStartTransaction PSUpdateRecord RecalcBufListSize RecNo RecordCount RecordSize Refresh RefreshInternalCalcFields RestoreState Resync SetActive SetBookmarkStr SetBufListSize SetChildOrder SetCurrentRecord SetDefaultFields SetFields SetFieldValues SetFilterOptions SetFound SetModified SetName SetOnFilterRecord SetState SetTempState SetUniDirectional SparseArrays State TempBuffer Translate UpdateCursorPos UpdateIndexDefs UpdateRecord
From TComponent (69)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetDesigning SetDesignInstance SetInline 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.
