On Sat, 22 Jan 2011 21:38:34 +0000, Mark Morgan Lloyd
<[email protected]> wrote:

>Bo Berglund wrote:
>
>>       query.SQL.Text := 'EXEC SelectDongleData @SerialNo=2485';
>
>Having just spent a bit of time with Google and MS docs: is EXEC 
>standard? What happens if you use CALL or EXECUTE? What happens if you 
>use positional rather than named parameters?
>

'EXECUTE SelectDongleData @SerialNo=2485'
'EXECUTE SelectDongleData 2485'

Both work, but return only one record (there should be 4).
Or at least the code loop below only traverses once:

  while not query.EOF do
  begin
    S := S + query.FieldByName('AppNo').AsString + #13#10;
    query.Next;
  end;


'CALL SelectDongleData 2485'

==> Exception: 'Cannot open a non-select statement'

Seems like SQLdb accepts EXECUTE in place of EXEC but when running the
call it fails to observe that more than one record is returned.

CALL is probably not recognized at all...


-- 
Bo Berglund
Developer in Sweden


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to