Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SP declaration in PB using ASA & ASE

0 views
Skip to first unread message

Anil

unread,
Sep 17, 1999, 3:00:00 AM9/17/99
to

Hi,
I am working on an application which has to run on both ASA & ASE.
Are there any syntax rules to follows while declaring SP call , so that it works
on both ASA & ASE.

Thanks,
Anil

Jim Egan

unread,
Sep 17, 1999, 3:00:00 AM9/17/99
to

In general, as long as you use T-SQL syntax for your ASA procedures they
should be relatively compatible.
--
Jim Egan [TeamSybase]
Dynamic Data Solutions, Inc. http://www.dyn-data.com
Houston, TX

Anil

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to
I have the same procedure on ASE & ASA . When i run the Procedure on ASA it
gives me the following error. THis is the trace file entry for the error.
This is the case with other procedures too.

execute dbo.Pr_Sel_XXX @division ='ABC' output (3 MilliSeconds)
Error -131 (rc -1) : SQLSTATE = 37000
[Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error or access violation:
near 'output' in ...(@division ='' [output] )

Thanks,
Anil

On Fri, 17 Sep 1999 20:51:13 -0500,
in sybase.public.sqlanywhere.general

Jim Egan

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to

It's hard to say from that error. Can you post the procedure? If it's
large just post the relevant sections.

Anil

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to

Procedure is as below:--
Create procedure
dbo.Pr_Sel_Users_DivisionInit(@division char(10) output)
as
begin
select @division=DivisionInit from
PPIUSER where
UserLanName=suser_name(*)
end

IT is Declared in PB as below:

DECLARE lp_userdivinit PROCEDURE FOR dbo.Pr_Sel_Users_DivisionInit
@division = :is_userdivinit output ;
execute lp_userdivinit;
Fetch lp_userdivinit into :is_userdivinit;
close lp_userdivinit;

It works fine in PB\ASE .
It gives the below error in PB\ASA

execute dbo.Pr_Sel_Users_DivisionInit @division ='' output (9 MilliSeconds)


Error -131 (rc -1) : SQLSTATE = 37000
[Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error or access violation:
near 'output' in ...(@division ='' [output


The same happens with lot of other procedures.


On Mon, 20 Sep 1999 12:55:12 -0500,


in sybase.public.sqlanywhere.general
Jim Egan <je...@dyn-data.com> wrote:

Anil

Jim Egan

unread,
Sep 20, 1999, 3:00:00 AM9/20/99
to

The procedure is probably getting saved in Watcom syntax. OUTPUT is not
a valid parameter for Watcom syntax procedures. Try changing it to OUT
or INOUT. Also, note that you are not returning a result set. Therefore
the FETCH isn't doing anything. I think that to get a value as a
parameter (without the result set) you must declare it as a Remote
Procedure Call.

IMO, things are just easier if you return a result set. The syntax for
ASE and ASA procedures would be almost identical (if not 100%) if you
used a result set.

0 new messages