You are not logged in.
Pages: 1
Problem is not in `?`, problem is if DESCRIPT contains single quotes ' and question marks ?
Example 1 - success:
Props.ExecuteInlined('insert into NEW_TABLE (ID, DESCRIPT) values (4, ' + QuotedStr('I''m confused') + ');', False);
Example 2 - success:
Props.ExecuteInlined('insert into NEW_TABLE (ID, DESCRIPT) values (4, ' + QuotedStr('Im confused?') + ');', False);
Example 3 - error:
Props.ExecuteInlined('insert into NEW_TABLE (ID, DESCRIPT) values (4, ' + QuotedStr('I''m confused?') + ');', False);
Thank you for your suggestion, but I'm getting sql-query from other system.
I just want to execute queries.
Hi,
Whats wrong with this SQL query?
I have simple test Table (FIREBIRD):
CREATE TABLE NEW_TABLE (
ID INTEGER NOT NULL,
DESCRIPT VARCHAR(100)
);
i'm getting an error when trying to insert single quotes and question marks in DESCRIPT
Props.ExecuteInlined('insert into NEW_TABLE (ID, DESCRIPT) values (4, ' + QuotedStr('I''m confused?') + ');', False);
But, there is no parameters in this simple query.
Problem seems to be in "mormot.db.sql.ReplaceParamsByNames"?!
thx, now it works
Hi,
why is null as double in mormot2 not excepted?
this code works fine in mormot1.
procedure TForm1.Button1Click(Sender: TObject);
type
TTestRec = packed record
a: Integer;
b: Double;
c: RawUTF8;
end;
TTestRecDynArray = array of TTestRec;
var
hTmpBuff: TSynTempBuffer;
hArr: TTestRecDynArray;
begin
hTmpBuff.Init('[{"a":0,"b":null,"c":"abc"}]');
if (DynArrayLoadJSON(hArr, hTmpBuff.buf, TypeInfo(TTestRecDynArray)) = nil) then
ShowMessage('error');
hTmpBuff.Done;
end;
Pages: 1