dbTalk Databases Forums  

Weird problem with results from stored procedure

comp.databases.sybase comp.databases.sybase


Discuss Weird problem with results from stored procedure in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Raj
 
Posts: n/a

Default Weird problem with results from stored procedure - 06-28-2004 , 09:09 AM






Hi, I hope someone out there can help.

I have a web application that uses stored procedures extensively. Up
until today, I never had a problem with returning result sets to the
browser.

However, a stored procedure I wrote today fails to return results,
even though when I run it on the server (using isql) it works fine.

The stored procedure uses temp tables, and is returning data from a
temp table.

Strangely, if a return data from a permanent table, the stored proc
returns data to the web application without any problems.

I am using sybase 11.92 on linux. There are no errors in the sybase
log, or odbc errors in the web application logs.

Any ideas as to why this is happening, and how it can be fixed, will
be gratefully received.

thanks
Raj

Reply With Quote
  #2  
Old   
Michael Peppler
 
Posts: n/a

Default Re: Weird problem with results from stored procedure - 06-28-2004 , 10:09 AM






On Mon, 28 Jun 2004 07:09:00 -0700, Raj wrote:

Quote:
However, a stored procedure I wrote today fails to return results, even
though when I run it on the server (using isql) it works fine.

The stored procedure uses temp tables, and is returning data from a temp
table.

Strangely, if a return data from a permanent table, the stored proc
returns data to the web application without any problems.
Off-hand I don't see any reason why this wouldn't work. Could you post the
sproc code (or, ideally, a minimal implementation that illustrates the
problem)?

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html



Reply With Quote
  #3  
Old   
Sara Law
 
Posts: n/a

Default Re: Weird problem with results from stored procedure - 06-28-2004 , 06:26 PM



Hi Raj,

No great words of wisdom but as I was reading your post I was
wondering if you had confirmed that the Web environment is calling the
SP and passing the parameters to it in EXACTLY the same way that you
do when you execute it in an isql session?? Sort of a long shot but
you never know.

Cheers,

Sara ...

r.randhawa (AT) centrio (DOT) co.uk (Raj) wrote in message news:<ba55ec3e.0406280608.4159930c (AT) posting (DOT) google.com>...
Quote:
Hi, I hope someone out there can help.

I have a web application that uses stored procedures extensively. Up
until today, I never had a problem with returning result sets to the
browser.

However, a stored procedure I wrote today fails to return results,
even though when I run it on the server (using isql) it works fine.

The stored procedure uses temp tables, and is returning data from a
temp table.

Strangely, if a return data from a permanent table, the stored proc
returns data to the web application without any problems.

I am using sybase 11.92 on linux. There are no errors in the sybase
log, or odbc errors in the web application logs.

Any ideas as to why this is happening, and how it can be fixed, will
be gratefully received.

thanks
Raj

Reply With Quote
  #4  
Old   
Minoru Aoki
 
Posts: n/a

Default Re: Weird problem with results from stored procedure - 06-29-2004 , 05:44 AM



Hi, I have ever seen similar situation before, (slightly different, but
anyway),

as for my case, that is defferent behavier b/w asp stored proc and isql.

This was caused by null treatment, before starting the stored procedure,
odbc (silently) issued the command, "set ANSINULL on".
You can see this if you use audit database. If you are using asp, then
I believe same kind of things should happen to the asp.

Try to use this command from isql before using your original procedure,
and if you reproduce your original problem there, then I suspect some null
values
should be in your data, and it caused the problem.

Quote:
Strangely, if a return data from a permanent table, the stored proc
returns data to the web application without any problems.
if your permanent table data are created by isql without the above command,
this is slightly different environment, because the data itself might be
different.

Thanks

Aoki



Reply With Quote
  #5  
Old   
Simon Andrew
 
Posts: n/a

Default Re: Weird problem with results from stored procedure - 08-01-2004 , 05:27 AM



One possibility is that it is an issue with using temp tables in
transactions.

By default, you can't create temp tables during a transaction because to do
so would put locks all over the sysobjects in tempdb and block everyone else
until you were done.

So if, perhaps before you weren't in a transaction, and now for some reason
you are, that could be your problem. What did you change? If it works OK in
isql, then perhaps it was a setting on the connection between the web server
and the database?

If it is the 'no temp table creation in a transaction' problem then you need
to somehow move the creation of the temp tables out of the transaction.

Regards,
Simon.

"Raj" <r.randhawa (AT) centrio (DOT) co.uk> wrote

Quote:
Hi, I hope someone out there can help.

I have a web application that uses stored procedures extensively. Up
until today, I never had a problem with returning result sets to the
browser.

However, a stored procedure I wrote today fails to return results,
even though when I run it on the server (using isql) it works fine.

The stored procedure uses temp tables, and is returning data from a
temp table.

Strangely, if a return data from a permanent table, the stored proc
returns data to the web application without any problems.

I am using sybase 11.92 on linux. There are no errors in the sybase
log, or odbc errors in the web application logs.

Any ideas as to why this is happening, and how it can be fixed, will
be gratefully received.

thanks
Raj



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.