Sign in Join
FPDoc Onlineexperiment

TCustomSQLQuery class

In unit SQLDB

Custom Class to handle SQL commands (with or without result set).

Declaration

pascal
TCustomSQLQuery = class(TCustomBufDataset)

Inheritance

  1. TCustomSQLQuery
  2. TCustomBufDataset
  3. TDBDataset
  4. TDataSet
  5. TComponent
  6. TPersistent
  7. TObject

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

TableNameprotected
PreparedpublicIs the query prepared ?
SQLConnectionpublicDatabase as TSQLConnection.
SQLTransactionpublicTransaction as TSQLTransaction.
ActiveprotectedIs the dataset open or closed.
FilterprotectedFilter to apply to the data in memory.
FilteredprotectedIs the filter active or not.
BeforeOpenprotectedEvent triggered before the dataset is opened.
AfterOpenprotectedEvent triggered after the dataset is opened.
BeforeCloseprotectedEvent triggered before the dataset is closed.
AfterCloseprotectedEvent triggered after the dataset is closed.
BeforeInsertprotectedEvent triggered before the dataset is put in insert mode.
AfterInsertprotectedEvent triggered after the dataset is put in insert mode.
BeforeEditprotectedEvent triggered before the dataset is put in edit mode.
AfterEditprotectedEvent triggered after the dataset is put in edit mode.
BeforePostprotectedEvent called before changes are posted to the underlying database.
AfterPostprotectedEvent called after changes have been posted to the underlying database.
BeforeCancelprotectedEvent triggered before a Cancel operation.
AfterCancelprotectedEvent triggered after a Cancel operation.
BeforeDeleteprotectedEvent triggered before a Delete operation.
AfterDeleteprotectedEvent triggered after a successful Delete operation.
BeforeRefreshprotectedEvent triggered before the data is refreshed.
AfterRefreshprotectedEvent triggered after the data has been refreshed.
BeforeScrollprotectedEvent triggered before the cursor changes position.
AfterScrollprotectedEvent triggered after the cursor has changed position.
AutoCalcFieldsprotectedHow often should the value of calculated fields be calculated.
DatabaseprotectedDatabase this dataset is connected to.
TransactionprotectedTransaction in which this dataset is running.
SchemaTypeprotected
SQLprotected
InsertSQLprotected
UpdateSQLprotected
DeleteSQLprotected
RefreshSQLprotected
Optionsprotected
Paramsprotected
ParamCheckprotected
MacrosprotectedSet of macros for this SQL statement.
MacroCheckprotectedCheck for macros in the SQL statement.
MacroCharprotectedMacro delimiter character.
ParseSQLprotected
UpdateModeprotected
UsePrimaryKeyAsKeyprotected
StatementTypeprotected
DataSourceprotectedDatasource this dataset is connected to.
Sequenceprotected
ServerFilterprotected
ServerFilteredprotected
ServerIndexDefsprotected

Methods

OpenCursorprotected
CreateSQLStatementprotected
CreateParamsprotected
RefreshLastInsertIDprotected
NeedRefreshRecordprotected
RefreshRecordprotected
ApplyReturningResultprotected
Cursorprotected
LogEventprotected
Logprotected
FetchprotectedAn empty implementation in TCustomBufDataset.
LoadFieldprotectedAn empty implementation in TCustomBufDataset.
LoadBlobIntoBufferprotectedLoads a Blob buffer for the specified field into the current record buffer.
ApplyRecUpdateprotectedRaises an exception. ApplyRecUpdate is not supported in TCustomBufDataset and descendent classes.
SetPacketRecordsprotectedSets the value for the PacketRecords property.
UpdateServerIndexDefsprotected
SetDatabaseprotected
SetTransactionprotected
InternalAddRecordprotected
InternalCloseprotectedPerforms actions needed to close the dataset.
InternalInitFieldDefsprotectedPerforms actions needed to initialize field definitions for the dataset.
InternalOpenprotectedPerforms actions needed to open the dataset.
InternalRefreshprotectedPerforms actions needed to refresh records in the dataset.
GetCanModifyprotectedGets the value for the CanModify property.
IsPreparedprotected
SetServerFilteredprotected
SetServerFilterTextprotected
GetDataSourceprotected
SetDataSourceprotected
BeforeRefreshOpenCursorprotectedAn empty implementation in TCustomBufDataset.
SetReadOnlyprotectedSets the value in the ReadOnly property.
NotificationprotectedCalled by components that are freed and which received a FreeNotification.
DoOnNewRecordprotected
DoBeforePostprotected
FieldDefsClassprotected
PSGetUpdateExceptionprotected
PSGetTableNameprotected
CreatepublicCreate a new instance of TCustomSQLQuery.
DestroypublicDestroy instance of TCustomSQLQuery.
PreparepublicPrepare a query for execution.
UnPreparepublicUnprepare a prepared query.
ExecSQLpublicExecute a SQL statement that does not return a result set.
SetSchemaInfopublicSetSchemaInfo prepares the dataset to retrieve schema info.
RowsAffectedpublicReturn the number of rows (records) affected by the last DML/DDL statement.
ParamByNamepublicReturn parameter by name.
MacroByNamepublicConvenience for Macros.ParamByName.
ApplyUpdatespublicApply updates and check result.
PostpublicPost pending changes and optionally apply updates.
DeletepublicDelete and optionally apply updates.

Events

OnCalcFieldsprotectedEvent triggered when values for calculated fields must be computed.
OnDeleteErrorprotectedEvent triggered when a delete operation fails.
OnEditErrorprotectedEvent triggered when an edit operation fails.
OnFilterRecordprotectedEvent triggered to filter records.
OnNewRecordprotectedEvent triggered when a new record is created.
OnPostErrorprotectedEvent 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)

CheckDatabase

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.