Results 1 to 3 of 3

Thread: Table Structure

  1. #1
    Join Date
    Jan 2004
    Location
    Mumbai
    Posts
    1

    Talking Unanswered: Table Structure

    Hi All

    I want to create Temporary table structure in sybase using
    the below query, but it is giving error

    Create Global Temporary Table sa
    as (Select * from co_0_city where 1= 0) ;

    can one help me?

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Are you in ASA or ASE?

    In ASE, you use CREATE TABLE #foo( .. ) to be a temporary table.

    In ASA, you *do* use CREATE GLOBAL TEMPORARY table, however in ASE (I don't know about ASA) 'sa' is a user, and the create table statement takes a user.table syntax, so it might be dying on that.

    Try changing the table name.

    Also, from reading the ASA CREATE TABLE docs I'm not sure if you can create a table in that fashion.
    Thanks,

    Matt

  3. #3
    Join Date
    Jan 2004
    Location
    Shanghai,China
    Posts
    76
    Originally posted by MattR
    Are you in ASA or ASE?

    In ASE, you use CREATE TABLE #foo( .. ) to be a temporary table.

    In ASA, you *do* use CREATE GLOBAL TEMPORARY table, however in ASE (I don't know about ASA) 'sa' is a user, and the create table statement takes a user.table syntax, so it might be dying on that.

    Try changing the table name.

    Also, from reading the ASA CREATE TABLE docs I'm not sure if you can create a table in that fashion.
    I think in Sybase SQL Server,named table sa will not cause syntax problem.
    Because sa is a login name,in every database sa correspond user dbo.
    example:
    1> use dongsong_export
    2> go
    1> create table sa(c1 int)
    2> go
    1> select * from sa
    2> go
    c1
    -----------

    (0 rows affected)
    1> select * from dbo.sa
    2> go
    c1
    -----------

    (0 rows affected)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •