Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Temp tables in Sybase

Posted on 2010-11-28
6
Medium Priority
?
905 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Accepted Solution

by:
Jan Franek earned 252 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 248 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 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