mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 06:06:17 +02:00
* made TSQLCursor.create virtual
* Raise exception if no fields have the pfInUpdate flag set while updating or inserting records on applyupdates git-svn-id: trunk@5812 -
This commit is contained in:
parent
56379c37a9
commit
abafbc147a
@ -86,6 +86,7 @@ Resourcestring
|
|||||||
SOnUpdateError = 'An error occured while applying the updates in a record: %s';
|
SOnUpdateError = 'An error occured while applying the updates in a record: %s';
|
||||||
SApplyRecNotSupported = 'Applying updates is not supported by this TDataset descendent';
|
SApplyRecNotSupported = 'Applying updates is not supported by this TDataset descendent';
|
||||||
SNoWhereFields = 'There are no fields found to generate the where-clause';
|
SNoWhereFields = 'There are no fields found to generate the where-clause';
|
||||||
|
SNoUpdateFields = 'There are no fields found to include in the update- or insert-clause';
|
||||||
SNotSupported = 'Operation is not supported by this type of database';
|
SNotSupported = 'Operation is not supported by this type of database';
|
||||||
SDBCreateDropFailed = 'Creation or dropping of database failed';
|
SDBCreateDropFailed = 'Creation or dropping of database failed';
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ type
|
|||||||
FStatementType : TStatementType;
|
FStatementType : TStatementType;
|
||||||
FBlobStrings : TStringList; // list of strings in which the blob-fields are stored
|
FBlobStrings : TStringList; // list of strings in which the blob-fields are stored
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1191,6 +1191,7 @@ Procedure TSQLQuery.ApplyRecUpdate(UpdateKind : TUpdateKind);
|
|||||||
sql_set := sql_set + fields[x].FieldName + '=:' + fields[x].FieldName + ',';
|
sql_set := sql_set + fields[x].FieldName + '=:' + fields[x].FieldName + ',';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if length(sql_set) = 0 then DatabaseError(sNoUpdateFields,self);
|
||||||
setlength(sql_set,length(sql_set)-1);
|
setlength(sql_set,length(sql_set)-1);
|
||||||
if length(sql_where) = 0 then DatabaseError(sNoWhereFields,self);
|
if length(sql_where) = 0 then DatabaseError(sNoWhereFields,self);
|
||||||
setlength(sql_where,length(sql_where)-5);
|
setlength(sql_where,length(sql_where)-5);
|
||||||
@ -1215,6 +1216,7 @@ Procedure TSQLQuery.ApplyRecUpdate(UpdateKind : TUpdateKind);
|
|||||||
sql_values := sql_values + ':' + fields[x].FieldName + ',';
|
sql_values := sql_values + ':' + fields[x].FieldName + ',';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
if length(sql_fields) = 0 then DatabaseError(sNoUpdateFields,self);
|
||||||
setlength(sql_fields,length(sql_fields)-1);
|
setlength(sql_fields,length(sql_fields)-1);
|
||||||
setlength(sql_values,length(sql_values)-1);
|
setlength(sql_values,length(sql_values)-1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user