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.

error JZ0R0 ResultSet has already been closed

2 posts in General Discussion Last posting was on 2004-02-24 07:49:57.0Z
sen Posted on 2004-02-24 05:48:33.0Z
Sender: 24ef.403ae558.1804289383@sybase.com
From: sen
Newsgroups: ianywhere.public.general
Subject: error JZ0R0 ResultSet has already been closed
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <403ae5bb.24f3.846930886@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 23 Feb 2004 21:48:43 -0800, 10.22.241.42
Lines: 42
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Feb 2004 21:48:03 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Feb 2004 21:48:33 -0800
X-Trace: forums-1-dub 1077601713 10.22.108.75 (23 Feb 2004 21:48:33 -0800)
X-Original-Trace: 23 Feb 2004 21:48:33 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2604
Article PK: 5742

error JZ0R0 ResultSet has already been closed
it's always error JZ0R0 if I run the stored procedure in
ISQL
CALL dba.get_sale()
but if I copy and paste the code into ISQL it's ok it's
return the result

---Stored procedure
ALTER procedure DBA.get_sale() /* parameter, ... */
result(company_name varchar(50),total_price integer)
begin
declare local temporary table mytable(
orderid integer null,
totalprice integer null,
) on commit preserve rows;
insert into mytable
select a.id,sum(a.quantity*b.unit_price) from
sales_order_items as a,product as b where a.prod_id =
b.id
group by a.id order by a.id asc;
select a.company_name as company_name,c.totalprice as
total_price from customer as a,sales_order as b,mytable as c
where
c.orderid = b.id and b.cust_id = a.id
end
---copy and paste code
declare local temporary table mytable(
orderid integer null,
totalprice integer null,
) on commit preserve rows;
insert into mytable
select a.id,sum(a.quantity*b.unit_price) from
sales_order_items as a,product as b where a.prod_id =
b.id
group by a.id order by a.id asc;
select a.company_name as company_name,c.totalprice as
total_price from customer as a,sales_order as b,mytable as c
where
c.orderid = b.id and b.cust_id = a.id

TIA
Sen


sen Posted on 2004-02-24 07:49:57.0Z
Sender: 3384.403b0127.1804289383@sybase.com
From: sen
Newsgroups: ianywhere.public.general
Subject: Re: error JZ0R0 ResultSet has already been closed
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <403b0225.3388.846930886@sybase.com>
References: <403ae5bb.24f3.846930886@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 23 Feb 2004 23:49:57 -0800
X-Trace: forums-1-dub 1077608997 10.22.241.41 (23 Feb 2004 23:49:57 -0800)
X-Original-Trace: 23 Feb 2004 23:49:57 -0800, 10.22.241.41
Lines: 57
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2606
Article PK: 5744

1 more thing if I add more constrain(where) it's ok
select a.company_name as company_name,c.totalprice as
total_price from customer as a,sales_order as b,mytable as
c where c.orderid = b.id and b.cust_id = a.id where
total_price > 1000 -->OK, return result
select a.company_name as company_name,c.totalprice as
total_price from customer as a,sales_order as b,mytable as
c where c.orderid = b.id and b.cust_id = a.id where
total_price > 0 -->Error JZ0R0

I'm very confuse here
pls help
Sen

> error JZ0R0 ResultSet has already been closed
> it's always error JZ0R0 if I run the stored procedure in
> ISQL
> CALL dba.get_sale()
> but if I copy and paste the code into ISQL it's ok it's
> return the result
>
> ---Stored procedure
> ALTER procedure DBA.get_sale() /* parameter, ... */
> result(company_name varchar(50),total_price integer)
> begin
> declare local temporary table mytable(
> orderid integer null,
> totalprice integer null,
> ) on commit preserve rows;
> insert into mytable
> select a.id,sum(a.quantity*b.unit_price) from
> sales_order_items as a,product as b where a.prod_id
> = b.id
> group by a.id order by a.id asc;
> select a.company_name as company_name,c.totalprice as
> total_price from customer as a,sales_order as b,mytable as
> c where
> c.orderid = b.id and b.cust_id = a.id
> end
> ---copy and paste code
> declare local temporary table mytable(
> orderid integer null,
> totalprice integer null,
> ) on commit preserve rows;
> insert into mytable
> select a.id,sum(a.quantity*b.unit_price) from
> sales_order_items as a,product as b where a.prod_id
> = b.id
> group by a.id order by a.id asc;
> select a.company_name as company_name,c.totalprice as
> total_price from customer as a,sales_order as b,mytable as
> c where
> c.orderid = b.id and b.cust_id = a.id
>
> TIA
> Sen