Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 921
  • Last Modified:

Temp tables in Sybase

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
inferencia
Asked:
inferencia
2 Solutions
 
Jan FranekCommented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
inferenciaAuthor Commented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
leonstrykerCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now