You are not logged in.
Pages: 1
{$ifdef ISDELPHIXE3}
function TSynDBSQLDataSet.PSExecuteStatement(const ASQL: string;
AParams: TParams): Integer;
var DS: TDataSet;
begin
DS := nil;
result := PSExecuteStatement(ASQL,AParams,DS);
DS.Free;
end;
function TSynDBSQLDataSet.PSExecuteStatement(const ASQL: string;
AParams: TParams; var ResultSet: TDataSet): Integer;
{$else}
function TSynDBSQLDataSet.PSExecuteStatement(const ASQL: string;
AParams: TParams; ResultSet: Pointer): Integer;
{$endif}
var Stmt: ISQLDBStatement;
p: integer;
begin // only execute writes in current implementation
if fConnection=nil then
raise ESQLQueryException.CreateUTF8('%.PSExecuteStatement with Connection=nil',[self]);
Stmt := fConnection.NewThreadSafeStatementPrepared(StringToUTF8(ASQL),false);
if Stmt<>nil then
try
if AParams<>nil then
for p := 0 to AParams.Count-1 do
if aParams[p].DataType = ftBlob then <-------------
Stmt.BindBlob(p+1,pointer(aParams[p].AsBlob),length(aParams[p].AsBlob)) <-------------
else Stmt.BindVariant(p+1,AParams[p].Value,false);
Stmt.ExecutePrepared;
result := Stmt.UpdateCount;
if result=0 then
result := 1; // optimistic result, even if SynDB returned 0
except
result := 0;
end else
result := 0;
end;
Offline
As stated by the forum rules, please don't post code directly in here, but use an external pastebin!
Thanks for sharing.
See https://synopse.info/fossil/info/1fe4c5c9c2
Offline
Pages: 1