在設置並插入SQL組件後,是否可以使用參數值檢索SQL語句?插入後,如何在SQL中輸出參數的值?
SQL語句:
SELECT * FROM SomeTable
WHERE SomeColumn = :pSomeValue;
代碼:
procedure LoadParams(aValue: string);
begin
Qry.Close;
Qry.ParamByName('pSomeValue').AsString := aValue;
MessageDlg(Qry.SQL.Text, mtInformation, [mbOK], 0); // this does not show the value but the parameter name.
Qry.Open;
end;
我想打開它之前能夠看到的聲明,但是當我嘗試這個現在我得到帕拉姆名稱,而不是值。
數據庫引擎和德爾福連接庫做u使用哪一個? http://en.wikipedia.org/wiki/Insert_sql#Retrieving_the_key –
您可以選擇使用AutoInc字段:http://www.nexusdb.com/support/index.php?q=howautoincworks2.htm嗯,您告訴您使用[tag:nexusdb],不是嗎? –
的確我是這樣做的:D + 1的提示! –