Solved

Temp tables in Sybase

Posted on 2010-11-28
6
807 Views
Last Modified: 2012-08-13
Hi, what is the alternative for the problem of the temporal tables in sysbase, i have a lot of stored procedures nested, for that problem i can use transactions and that is not a solution, and why sybase supprot only 4 temp tables?, i ask the people of sybase and they told me that support more than 200, but if i create more than 3 temp tables in a stored the fourth one is missing.

Thank you
0
Comment
Question by:inferencia
6 Comments
 
LVL 14

Accepted Solution

by:
Jan_Franek earned 63 total points
Comment Utility
I use more than 4 temp tables regularly, so I believe, there no such low limit on number of temp tables.

I just dimly remember, that I have encountered some problem with temp tables naming. It was something with quite long names.

What names are you using for your temp tables ? And what version of Sybase database are you running ?
0
 
LVL 24

Assisted Solution

by:Joe Woodhouse
Joe Woodhouse earned 62 total points
Comment Utility
Every Sybase database product can handle more than 4 temp tables in a procedure!

Can you tell us exactly which product (Sybase has many database products) and version you are using?

Maybe also post your code...
0
 

Author Comment

by:inferencia
Comment Utility
thanks for your comments,  i found that the proble was from configuration..  a flag name "dll in tran" in Sybase, i changed that for true and that problem was solved.

For the another problem "temp tables in nested sp", the error ithat the transaction is missin.."error 266.. i think".. the only way for now i found for that problem is:
I needed to copmpile all the temp tables for the stored procedures before used it  then i open the transaction and create the temp tables (all) in the stored procedure father.

If you have another way because this is very difficult to support,please tell me. I send an example for the code that i used for that problem  ManejodeSpAnidados.sql ManejodeSpAnidados.sql
0
 
LVL 24

Expert Comment

by:Joe Woodhouse
Comment Utility
Experts Exchange prefers additional questions be raised in new posts. Since this is sorta related I'll answer it here but I think if you need to ask any further questions it's best to open one or more new top-level posts.

What is the exact version of Sybase ASE you're using? (It now seems obvious that it is ASE but we need to know more about versions.)

In most versions until very recently, objects must exist before they can be used. It's fine to create and then use a temp table in the same batch or stored procedure, but if you are creating a temp table in one place and then referring to it in another, it must exist at the time you're creating that second object...

... unless you're using the absolutely most recent version.

So yes, you have to do this:

-- manually create temp table
-- create proc B that uses the temp table
-- manually drop the temp table
-- create proc A that creates the temp table and then calls proc B

You must manually create the temp table because otherwise creating proc B will fail - proc B is trying to use an object that doesn't exist unless you manually create it first.

You must then manually drop the temp table after creating proc B, else creating proc A will fail - is it trying to create an object that already exists unless you manually drop it first.
0
 
LVL 29

Expert Comment

by:leonstryker
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now