[Lazarus] SQLdb not able to retrieve data from stored procedures?

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Thu Jan 20 11:38:38 CET 2011



On Thu, 20 Jan 2011, Bo Berglund wrote:

> On Thu, 20 Jan 2011 09:31:44 +0100 (CET), michael.vancanneyt at wisa.be
> wrote:
>
>>
>>
>> On Wed, 19 Jan 2011, Bo Berglund wrote:
>>
>>> I am investigating Lazarus' capabilities for database work so I  have
>>> made a very simple test application using ODBC and the SQLdb
>>> components.
>>> I am doing this on a Windows XP platform.
>>>
>>> The code is a very slightly modified example that I got from the WIKI
>>> here:
>>> http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Lazarus_and_MSSQL
>>>
>>> My problem is that I get an exception on the query.Open line when the
>>> SQL text is something like this:
>>>
>>> 'EXEC SelectSomeData @Parameter=1234'
>>
>> Hm. Weird MS syntax.
>
> Not really, this is standard syntax for calling a stored procedure
> with a parameter value. I simplified the call for this post to have
> only one parameter and gave it a valid name, which is not the actual
> name...
>
>> Why could they not use SELECT * FROM SelectSomeData(1234) like everyone else ?
>
> Because the SelectSomeData is not a table, it is a stored procedure
> and must be called with the EXEC verb.

I understand that SelectSomeData is not a table.

But in other engines "SELECT * FROM SelectSomeData(1234)" does work on a stored procedure.
I assumed it was standard.

Michael.




More information about the Lazarus mailing list