Solved

Temp tables in Sybase

Posted on 2010-11-28
6
838 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
ID: 34228466
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
ID: 34229198
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
ID: 34236439
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
ID: 34247106
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
ID: 35510886
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Adding Computers to AD groups through an SCCM Task Sequence
In this increasingly digital world, security hacks are no longer just a threat, but a reality. As we've witnessed with Target's big identity hack 2013, Heartbleed in 2015, and now Cloudbleed, companies and their leaders need to prepare for the unthi…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 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