🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.databases
2 messages
2 total messages Started by Gaz Tue, 19 Jan 1999 00:00
D3 & SLQA 5+ StoredProc not returning result set
#71
Author: Gaz
Date: Tue, 19 Jan 1999 00:00
27 lines
1666 bytes
I'm using Delphi 3 c/s with SQL Anywhere 5.5 and
I'm trying to run a simple Watcom SQL StoredProc that returns a 2
column multiple row result set, but keep getting 
"Syntax Error - Wrong number of parameters to FUNCTION 'GroupTest'.

The StoredProc component has picked up the two parameters defined and
I assume will use these for passing multiple results back?

This is the Procedure I am trying to call:

alter procedure grouptest()
result(base_group_id integer,description varchar(32))
on exception resume
begin
  select base_group_id,description
    from sims.base_group
    where base_group_type_id=12
end

if The same proc is converted to Transact SQL - the error is 'Trying
to return a multiple row result set' (or something similiar).

Any help on this would be appreciated,

Gareth.

Please remove the NOSPAM if you wish to reply by e-mail.
Re: D3 & SLQA 5+ StoredProc not returning result set
#69
Author: Robert Cerny
Date: Tue, 19 Jan 1999 00:00
47 lines
2307 bytes
TStoredProc does not work well with odbc databases. Use TQuery instead:
Q.SQL.Add('call grouptest()');
Q.Open;

One thing that is puzzling me is "FUNCTION" in the error message.
Check if you have a function with the same name:
select * from sysprocedure where proc_name='grouptest';

A good practice is allways prefix a proc (a table too) with creator name:
call public.grouptest()

--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.qwe.cerny@neosys.xrs.qwe.si

No questions via email, unless explicitly invited.
Gaz wrote in message <36a4a6bb.12020484@news.demon.co.uk>...
>I'm using Delphi 3 c/s with SQL Anywhere 5.5 and
>I'm trying to run a simple Watcom SQL StoredProc that returns a 2
>column multiple row result set, but keep getting
>"Syntax Error - Wrong number of parameters to FUNCTION 'GroupTest'.
>
>The StoredProc component has picked up the two parameters defined and
>I assume will use these for passing multiple results back?
>
>This is the Procedure I am trying to call:
>
>alter procedure grouptest()
>result(base_group_id integer,description varchar(32))
>on exception resume
>begin
>  select base_group_id,description
>    from sims.base_group
>    where base_group_type_id=12
>end
>
>if The same proc is converted to Transact SQL - the error is 'Trying
>to return a multiple row result set' (or something similiar).
>
>Any help on this would be appreciated,
>
>Gareth.
>
>Please remove the NOSPAM if you wish to reply by e-mail.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads