If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > temporay table issue.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-10, 09:47
alirulez999 alirulez999 is offline
Registered User
 
Join Date: Jan 2010
Posts: 25
temporay table issue.

In sybase 12.5, when a temporary table is created it does not exist even for the same session.

eg.

CREATE TABLE #people
(
id INT,
name VARCHAR(32)
) ;


msg : Table created successful.

select *
from
#people

msg #people not found.

Is their any specific setting we need to do using sp_configure.
Reply With Quote
  #2 (permalink)  
Old 02-10-10, 10:16
MCrowley MCrowley is offline
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 4,899
Are you issuing both queries from the same connection?
Reply With Quote
  #3 (permalink)  
Old 02-10-10, 23:35
erovij erovij is offline
Registered User
 
Join Date: Jun 2009
Posts: 19
Hi,

If the temp table created and selected from the same session defnitely it will work.
Reply With Quote
  #4 (permalink)  
Old 02-11-10, 00:17
alirulez999 alirulez999 is offline
Registered User
 
Join Date: Jan 2010
Posts: 25
For MCrowley:

yes both the queries was fired from the same session.

For erovij:

That is what even I believe. But this is not the case over here in sybase 12.5.
Was shocked !!!. I Strongly feels that there is some settings which needs to be done using sp_configure.

Last edited by alirulez999; 02-11-10 at 00:21.
Reply With Quote
  #5 (permalink)  
Old 02-11-10, 04:47
jannovak jannovak is offline
Registered User
 
Join Date: Feb 2009
Location: Prague
Posts: 17
Are you doing it in isql?
After creating the table #people, go to tempdb and select * from sysobjects.
Check if the table exists. And provide the output if possible.
Reply With Quote
  #6 (permalink)  
Old 02-11-10, 13:37
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Quote:
Originally Posted by alirulez999 View Post
Was shocked !!!
I'd be stunned. I've been using Sybase for decades and have only found one issue in all that time (fixed in one of the very very early versions). Are you absolutely certain you're in the same session?
Reply With Quote
  #7 (permalink)  
Old 02-12-10, 08:53
alirulez999 alirulez999 is offline
Registered User
 
Join Date: Jan 2010
Posts: 25
CREATE TABLE #people
(
id INT,
name VARCHAR(32)
) ;

select *
from
sysobjects;

Both the above query was fired altogher, in a single run. I have got this #people______00000120009549451 table created.


But when both the queries was fired one by one, then even the sysobjects of tempdb does not contain entry for #people table.

Very weird.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On