0

What is the Difference between global temp table and local temp table SYBASE ASE 15 ?

And how both would behave when access multiple time from java with different thread/connection/db method invocation ?

Global temp table's starts with ## and local temp table.s name starts with #.

Did not find any good resource to study.

Can anybody clarify ?

barun
  • 393
  • 1
  • 5
  • 19

1 Answers1

0

From my recollection of temporary tables in Sybase ASE, there are two types though I don't recall them being referred to as "Global" and "Local".

Session specific temporary tables are the ones named with a "hash" or "pound sign", #. Such as #foo.

create table #foo (
    id    int  not null,
    value varchar(255) not null)
go

Permanent temporary tables created and remain in your temporary database until they are dropped or the Sybase ASE instance is restarted. The tables are stored in the model database, they will be created on restart as well, but they will also appear in a any newly created databases too.

Permanent temporary tables are named similarly to tables in any other user defined database. They do not have the leading #.

use tempdb
go
create table foo (
    id    int  not null,
    value varchar(255) not null)
go

Further documentation can be found here:

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1600/doc/html/san1390612248829.html

Richard Crossley
  • 576
  • 7
  • 15
  • when I use ## table , interaction with java is happening as the way i want but not with # table. – barun Jul 06 '15 at 12:12
  • Can you describe the problem you're seeing. Have you tried recreating the issue outside of Java. Is this being done through an ORM library, if so which one? – Richard Crossley Jul 06 '15 at 15:31
  • please see this [How to access temporary table(# table sybase ase 15) from java using mybatis](http://stackoverflow.com/questions/31181130/how-to-access-temporary-table-table-sybase-ase-15-from-java-using-mybatis) – barun Jul 07 '15 at 06:57