Executing MSSQL function

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tomin
Posts: 8
Joined: Tue 15 Apr 2008 06:06

Executing MSSQL function

Post by Tomin » Tue 15 Apr 2008 06:10

Hi,

I have a problem with executing MSSQL function.
I was trying MSStoredProc component but in a runtime it is showing me error of the execution:
"Line1: Invalid procedure number(0). Mustbe between 1 and 32767'

Have someone succeded to call functions with SDAC?

Tomin

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 15 Apr 2008 11:02

Please provide some more information about the the error:
- the command text of your TMSSQL component;
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.

Tomin
Posts: 8
Joined: Tue 15 Apr 2008 06:06

Post by Tomin » Tue 15 Apr 2008 11:54

Antaeus wrote:Please provide some more information about the the error:
- the command text of your TMSSQL component;
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.
1.
I'm tying to use TMSStoredProc for calling a function. The SQL command text is:
{:RETURN_VALUE = CALL fn_Supervision_NewNo;0(:ProjectID)}

where
:ProjectID is a string
:RETURN_VALUE defined as a Result in the body of MSSQL function is also string value

2.
My current SDAC version is: 4.35.0.17

3.
I'm using Delphi 2007 with installed SP3

4. Sql Server info is as follow
Microsoft SQL Server: 09.00.3054
Microsoft SQL Native Client: 9.00.3042.00

Thanks for your help in advance

Tomin

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 15 Apr 2008 14:06

You should remove the semicolon and zero symbols from the command to make it work:

Code: Select all

{:RETURN_VALUE = CALL fn_Supervision_NewNo (:ProjectID)}

Post Reply