Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Call Oracle remote procedure

2 posts in General Discussion Last posting was on 2006-08-26 03:06:48.0Z
Lau Posted on 2006-08-25 08:51:28.0Z
Sender: 91a.44eeb99e.1804289383@sybase.com
From: Lau
Newsgroups: ianywhere.public.general
Subject: Call Oracle remote procedure
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <44eeba10.91e.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Aug 2006 01:51:28 -0700
X-Trace: forums-1-dub 1156495888 10.22.241.41 (25 Aug 2006 01:51:28 -0700)
X-Original-Trace: 25 Aug 2006 01:51:28 -0700, 10.22.241.41
Lines: 48
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5595
Article PK: 1624

always return error - wrong number of parameters to function
sqlcode = -154, odbc 3 stat = 42000

Can anyone help ? What's the format to call the Oracle
remote procedure.
expect to call the remote prcedure, return rows into ASA

environment
-ASA 9.02.2451
-Sybase Central 4.3.0.2387
-ODBC Oracle Wire Protocol Driver 04.20.0081 (B0067,U0062)
with Option 'Procedure return results' ON
-Oracle db 9i - 9.02.0.06

Package/procedure in Oracle
CREATE OR REPLACE PACKAGE "OP"."SPINFO" as
Type SPRec is record (
col1 varchar(30),
col2 varchar(100)
);
Type SPCursor is ref cursor return SPRec;
End SPInfo;

CREATE OR REPLACE PROCEDURE "OP"."DOWNLOADMYTABLE" (
spcursor IN OUT OP.SPInfo.SPCursor,
in_num IN integer ) As
Begin
Open spcursor For
select object_type,
object_name
from all_objects
where rownum <= in_num;
End;

Adding the procedure "DOWNLOADMYTABLE" to ASA
ALTER PROCEDURE "DBA"."DOWNLOADMYTABLE"() at
'aktp2;;OP;DOWNLOADMYTABLE'
/* Type the remote procedure parameter definitions here
[IN | OUT | INOUT] parameter_name parameter_type [DEFAULT
default_value], ... */

In Isql
call dba.DOWNLOADMYTABLE(15)
then return errors wrong number of parameters to function
'DOWNLOADMYTABLE'
sqlcode = -154, odbc 3 stat = 42000, line 1 column 1

Thanks for your help


Lau Posted on 2006-08-26 03:06:48.0Z
Sender: 13f2.44efb9d2.1804289383@sybase.com
From: Lau
Newsgroups: ianywhere.public.general
Subject: Re: Call Oracle remote procedure
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <44efbac8.13fc.1681692777@sybase.com>
References: <44eeba10.91e.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Aug 2006 20:06:48 -0700
X-Trace: forums-1-dub 1156561608 10.22.241.41 (25 Aug 2006 20:06:48 -0700)
X-Original-Trace: 25 Aug 2006 20:06:48 -0700, 10.22.241.41
Lines: 8
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5597
Article PK: 1625

Resolved - by adding a parameteres into the procedure
ALTER PROCEDURE "DBA"."DOWNLOADMYTABLE"(in in_num integer)
at

> 'aktp2;;OP;DOWNLOADMYTABLE'
> /* Type the remote procedure parameter definitions here
> [IN | OUT | INOUT] parameter_name parameter_type [DEFAULT
> default_value], ... */
>