0

I am converting my application from using raw ADO calls to using FireDac.

Currently, I have the following line of code:

TQueryRunner.ExecuteQueryNoMsg('exec(''sp_who @@spid'')', iRA,rs,conn,True);

I need to be able to call that sp_id @@spid call in FireDac and return the result set. I can't seem to do so despite a number of different approaches. I've tried calling it with TFDStoredProc, but the parameter requires a value, and there really isn't a value for it. I've tried a TFDQuery, but that won't work at all (and by "won't work" i mean I get an access viloation when I try....)

Can someone point me in the right direction?

Nick Hodges
  • 16,902
  • 11
  • 68
  • 130
  • long shot.... does the answer to this older question of yours help at all? http://stackoverflow.com/questions/21705866/what-is-the-proper-way-to-dynamically-create-and-call-a-stored-procedure-in-delp – Tanner Mar 24 '15 at 13:48
  • @Tanner Hehe -- that was a question I asked as well. ;-) – Nick Hodges Mar 24 '15 at 14:06
  • yeh i noticed, hence the _older question of yours_ part, guess it doesn't help lol. got yourself a niche there – Tanner Mar 24 '15 at 14:09
  • Executing `sp_who @@spid` or `EXEC sp_who @@spid` from `TFDQuery` worked fine for me ([`example`](http://pastebin.com/0Fuq1u2r)). – TLama Mar 24 '15 at 14:56
  • Hmmm. Thought that's the very thing I tried. Weird. – Nick Hodges Mar 24 '15 at 15:11
  • FireDAC uses `:` to denote parameters. So your syntax (in FireDAC) should be `exec sp_who :spid` – crefird Mar 25 '15 at 12:14

0 Answers0