ExecSQL parameter placeholder
Posted: Wed  24 Jun 2015 12:26
				
				I want to use the ExecSQL method with parameters. My SQL-statement looks similar to
but the numbers should be the parameters. so i prepare a variant array
but cannot guess the correct VALUES-clause. Is it
https://www.devart.com/mydac/docs/?deva ... t[]%29.htm
doesnt specify this but only links to ExecSQLEx which uses named parameters.
ExecSQL uses an ordered param list and i expect the placeholders looking similar as in the Format-function.
			Code: Select all
INSERT INTO `trend` (`stamp`, `charge`, `prognr`, `tprim`, `tsek`)
  VALUES (CURRENT_TIMESTAMP, '2', '1', '37.9', '-32.33');Code: Select all
var
  pp: array of Variant;
begin
  SetLength(pp,4);
  pp[0] := 2;
  pp[1] := 1;
  pp[2] := 37.8;
  pp[3] := -32.16;- VALUES (CURRENT_TIMESTAMP, ?, ?, ?, ?)
 - VALUES (CURRENT_TIMESTAMP, %, %, %, %)
 
https://www.devart.com/mydac/docs/?deva ... t[]%29.htm
doesnt specify this but only links to ExecSQLEx which uses named parameters.
ExecSQL uses an ordered param list and i expect the placeholders looking similar as in the Format-function.