Cannot create temporary table having identity column

Hi experts,
I saw the above error msg while running the following statement:
       create local temporary column table #tmp_table (c1 int GENERATED by default AS IDENTITY (start with 1 increment by 1), c2 int)
     Could not execute 'create local temporary column table #tmp_table(c1 int GENERATED by default AS IDENTITY (start with ...'
     SAP DBTech JDBC: [7]: feature not supported: cannot create temporary table having identity column: C1: line 1 col 48 (at pos 47)
I understand we can support normal column table creation with identity column, but don't know why cannot support temporary column tables with identity column. Is there any configuration that can enable it for temporary column table? Or what can I do to support it indirectly, like writing a trigger to support it or something else?
If not, then is there any future plan for this feature?
Regards,
Hubery

Hi Hubery,
I've heard this trail of arguments before...
Customer has a solution... they want it on HANA... but they don't want to change the solution.
Well, fair call, I'd say.
The problem here is: there's a mix-up of solution and implementation here.
It should be clear now, that changing DBMS systems (in any direction) will require some effort in changing the implementation. Every DBMS works a bit different than the others, given "standard" SQL or not.
So I don't agree with the notion of "we cannot change the implementation".
In fact, you will have to change the implementation anyhow.
Rather than imitating the existing solution implementation on ASE, implement it on SAP HANA.
Filling up tons of temporary tables is not a great idea in SAP HANA - you would rather try to create calculation views that present the data ad hoc in the desired way.
That's my 2 cts on that.
- Lars

Similar Messages

  • Create Temporary Tables

    Hi, there.
    Can anybody tell me what's the syntax for the SQL statements to create temporary tables?
    I'm developing a shopping cart, and at the end of every purchase (checkout) I want to organize the items of the Session Bean Hash Table that contains them, and group them by category, brand, price and show the serial number of each item. I was thinking to do SQL-style operations like GROUP BY on the Hash Table itself, but I am having a hard time with it, so that's why I thought that filling a temporary database table with the Hash Table data could be the solution to the problem of grouping and ordering the items contained in the Shopping cart Bean.
    I saw the following code in this same forum:
    stmt = con.createStatement();
    stmt.executeUpdate("create table temp (slno integer, first_name varchar(32), middle_name varchar(1), last_name varchar(32))");
    But I don't understand how the temporary table has a fixed name, isn't that going to create conflict with another user that creates a temporary table with the same name but in a different session?
    I hope my approach makes sense. If so, what's the SQL syntax to create temporary-session-like tables so I can include it in my JDBC code?
    Thank you in advance for any information or alternative suggestion.

    But I don't understand how the temporary table has a
    fixed name, isn't that going to create conflict with
    another user that creates a temporary table with the
    same name but in a different session?Yes, it is. That's one reason why people try to avoid creating temporary tables, I suppose. There are other reasons.
    I hope my approach makes sense. If so, what's the SQL
    syntax to create temporary-session-like tables so I
    can include it in my JDBC code?You already know the syntax for creating a table. Your only problem is finding a unique name for the table, one that no other user will use. You could have a one-row one-column table with a number in it, which you read and increment, then use that number for your table name, for example. Unless your database happens to have this as a feature -- you would have to read its documentation to find that out.
    However as I implied before, you should try to avoid creating temporary tables. Creating a table is a time-consuming operation, and if your program ends abnormally without dropping the temporary table, your database slowly fills up with useless tables.

  • Is there a way to create "temporary" tables in SAP database?

    Hello,
    Is there a way to create temporary tables in ABAP?
    Here is our scenario:
    1. Invoke a custom RFC that creates a temporary table and returns the name of the table.
    2. Invoke another custom RFC and pass this table name as parameter. This RFC internally does some INNER JOIN with the temporary table.
    3. Invoke the third RFC to delete the temporary table.
    Note that the name of the table cannot be static. We have many users using our application simultaneously and connecting to the SAP server.
    I would appreciate it if you could point me in the right direction.
    Thank you in advance for your help.
    Peter

    I just ran into a similar issue.  While only calling the select statement 2 times, each time had so many entries in the 'for all entries' list, that the compiler converted this into about 700 calls to the select.  Now since the select joined three real tables on the database, the trace shows this one select as being the slowest item in this application.
    I think that happened because 'for all entries' gets converted to an 'IN' clause, and then the total number of characters in any SQL statement has an upper limit.   So the compiler must make the select statement over and over until it covers all entries in the 'for all entries' list.  Is that correct?
    Since every database I ever saw has the concept of db temporary tables, I have used db temp tables many times for this sort of thing.
    The ABAP compiler could determine that more than one IN statement will be need, then use an alternate: write all the FOR ALL ENTRIES to a db temp table, then join on the db temp table, then drop db temp table.  Since the compiler does this sort of thing, no application code needs change to get the speed boost.

  • Error creating temporary table

    I got this error when creating forms with ADDT. I checked MySQL reserved words and I'm sure that's not my problem :(. Any help with this?
    Many thanks
    Florencia
    Error:
    Error interno.
    Developer Details:
    tNG_fields.getFakeRecordset:
    SQL error: Error creating temporary table:
    Incorrect table name 'T'
    SQL:
    CREATE TEMPORARY TABLE KT_fakeRS_20071031 (fecha_ing TEXT, fecha_eg TEXT, seguro TEXT, compania TEXT, CC TEXT, T.T TEXT, chapa TEXT, pintura TEXT, mecanica TEXT, repuestos TEXT, TT TEXT, cerrado TEXT, patente TEXT, id_rep TEXT) (FIELDS_FAKE_RS_ERROR)
    tNG Execution Trace - VIEW

    Hi Florencia,
    a column name like "T.T" will always lead to such errors, because characters like a dot (.) are forbidden, so to speak -- MySQL table and column names may generally only contain alphanumeric characters (0-9, a-z, A-Z), and the only allowed separator would be an underscore (_)
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Create Temporary table

    Dear All
    Am using SAP B1 pl-40
    SQL Server 2005
    through Query manager if i create Temporary table it will make any
    problem?
    The following Example are am going to use
    create table ##baz
    CarIndex smallint,
    CarType varchar(20),
    cardcode varchar(20)
    insert into ##baz values('1','2','3')
    select * from ##baz
    drop table ##baz

    You'll not have any problems in Creating/ Inserting to your own created tables(without which you cannot develop an Add-on).
    You are not supposed to Insert or Delete into SAP tables using direct Insert/ Update/ Delete statements.
    Please Check this SAP Note: 896891     Support Scope for SAP Business One - DB Integrity
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

  • How create temporary table from list of values

    Can you anybody advise me how can I create temporary table from list of values? I have list of values and need create temporary table for next use with command JOIN etc.
    Thank you for help

    NO, you can not create temporary table in oracle on the fly ( Like #Tabels in SQl Server or Sybase ) , you will have to use the GTT i.e Global Temporary Tables
    check the following link GTT :
    to flush the tables after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT DELETE ROWS;In contrast, the ON COMMIT PRESERVE ROWS clause indicates that rows should be preserved until the end of the session.
    so to keep rows in Table after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT PRESERVE ROWS;

  • HOW TO CREATE A TABLE WITH 800 COLUMNS?

    I have to create a table with 800 columns.I know the create statement to create a table but it will take more time.
    So tell me the other method.

    If you really think that you have to store 800 values for a given entity, it would be a wise idea if you store you information in columnar fashion. Make a main table and a attribute table, keep the primary identifier in the  main table and store other attributes in the attribute table where you can keep the primary key of the first table as foreign key (not necessary) to maintain the relationship.
    eg.
    emp_id
    emp_name
    dob
    city
    state
    country
    pincode
    1
    Mr X
    01/01/1990
    ABC
    ZXC
    MMM
    12345
    Can be stored as
    Main Table
    emp_id
    emp_name
    1
    Mr X
    Attribute Table
    attr_id
    emp_id
    attr_nam
    attr_value
    1
    1
    dob
    01/01/1990
    2
    1
    city
    ABC
    3
    1
    state
    ZXC
    4
    1
    country
    MMM
    5
    1
    pincode
    12345
    Creating table with large number of columns is bad design as suggested by other Gurus.
    Thanks

  • How to create a table with editable column values.

    Hi everyone,
    I think this is very simple but i'm not able to find how to do this. This is my requirement. I need to create a table with n columns and 1 row initially. user should be able to enter data into this table and click of a button should insert data into the data base table. Also there should be a button at the bottom of the table to add 1 row to the table.
    I know how to do the insert to database, but can anyone please let me know how to create a table that allows user to enter data and how to create a add 1 row button?
    Thanks in Advance!

    Raghu,
    Go through the ToolBox tutorial Create Page & Advanced table section of OAF Guide.
    Step 1 - You require to create EO & a VO based on this EO. This EO will be of DataBase table where you want to insert the data.
    Step 2 - Create a Advanced table region. (Refer this Adavanced table section for more on this)
    Step 3 - Attach this VO in the BC4J component of Adavanced Table region.
    Regards,
    Gyan

  • Error inserting a row into a table with identity column using cfgrid on change

    I got an error on trying to insert a row into a table with identity column using cfgrid on change see below
    also i would like to use cfstoreproc instead of cfquery but which argument i need to pass and how to use it usually i use stored procedure
    update table (xxx,xxx,xxx)
    values (uu,uuu,uu)
         My component
    <!--- Edit a Media Type  --->
        <cffunction name="cfn_MediaType_Update" access="remote">
            <cfargument name="gridaction" type="string" required="yes">
            <cfargument name="gridrow" type="struct" required="yes">
            <cfargument name="gridchanged" type="struct" required="yes">
            <!--- Local variables --->
            <cfset var colname="">
            <cfset var value="">
            <!--- Process gridaction --->
            <cfswitch expression="#ARGUMENTS.gridaction#">
                <!--- Process updates --->
                <cfcase value="U">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                    <cfquery datasource="#application.dsn#">
                    UPDATE SP.MediaType
                    SET #colname# = '#value#'
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <!--- Process deletes --->
                <cfcase value="D">
                    <!--- Perform actual delete --->
                    <cfquery datasource="#application.dsn#">
                    update SP.MediaType
                    set Deleted=1
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <cfcase value="I">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                   <cfquery datasource="#application.dsn#">
                    insert into  SP.MediaType (#colname#)
                    Values ('#value#')              
                    </cfquery>
                </cfcase>
            </cfswitch>
        </cffunction>
    my table
    mediatype:
    mediatypeid primary key,identity
    mediatypename
    my code is
    <cfform method="post" name="GridExampleForm">
            <cfgrid format="html" name="grid_Tables2" pagesize="3"  selectmode="edit" width="800px" 
            delete="yes"
            insert="yes"
                  bind="cfc:sp3.testing.MediaType.cfn_MediaType_All
                                                                ({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
                  onchange="cfc:sp3.testing.MediaType.cfn_MediaType_Update({cfgridaction},
                                                {cfgridrow},
                                                {cfgridchanged})">
                <cfgridcolumn name="MediaTypeID" header="ID"  display="no"/>
                <cfgridcolumn name="MediaTypeName" header="Media Type" />
            </cfgrid>
    </cfform>
    on insert I get the following error message ajax logging error message
    http: Error invoking xxxxxxx/MediaType.cfc : Element '' is undefined in a CFML structure referenced as part of an expression.
    {"gridaction":"I","gridrow":{"MEDIATYPEID":"","MEDIATYPENAME":"uuuuuu","CFGRIDROWINDEX":4} ,"gridchanged":{}}
    Thanks

    Is this with the Travel database or another database?
    If it's another database then make sure your columns
    allow nulls. To check this in the Server Navigator, expand
    your DataSource down to the column.
    Select the column and view the Is Nullable property
    in the Property Sheet
    If still no luck, check out a tutorial, like Performing Inserts, ...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    John

  • Creating temporary tables with JSTL

    I need to create temporary tables in my DB (MySQL), and later call it in a query.
    I try this:
    <sql:update var="temp1" dataSource="${conn}">
    CREATE TEMPORARY TABLE temp1
    SELECT data1 FROM table1 WHERE condition = 1
    </sql:update>
    <sql:query var="query1" dataSource="${conn}">
    SELECT * FROM temp1
    </sql:query>

    I haven't done enough with MySQL recently to know.
    Break your problem up into two parts.
    First there's the query portion. Create a permanent table and make sure that your query works fine with taht.
    Next is the creation of the temporary table. Once you KNOW the query is working, then you can concentrate on that.
    I'll assume that you've already GRANTed table creation permission to the user that your JSP app uses to log into the database.
    Are there any messages written to the servlet/JSP engine log file that might help you figure out what's wrong? Do you have a JSP error page that's displayed if any exceptions are thrown? - MOD

  • How to create advance table region with columns by code

    hello friends
    i need to create advance table region and columns dynamically ... for that i want to know any code snippet do you have
    please share with me that would be really great help

    Hi ,
    It is not possible through code but
    1.) U can create a new custom OAAdvanced table under a custom region using JDeveloper.
    2.) Create stack layout bean using personalization on the page ,and in extend property of StackLayoutBean mention the complete path of above custom region .
    Thank
    Pratap

  • Create temporary Tables using SQL

    Hello,
    I'm wondering if SAP allows the creation of new Tables without SDK objects,
    I want to create temporary tables using SQL scripts an compile them when an specific addon is connected and erase them when the addon disconnects,
    Do you think this is allowed?.
    thanks,
    Gabriela

    You could always have a second DB to create your temp tables in.  This is the way I've done this, as well as created my own views and stored procedures in it.  No updating of the primary table necessary.  The way I named things was:
    Company_DB - Company Database
    Company_DB-Extern - My own stuff
    Then, in sap, you can just do [Company_DB-Extern]..Object to call it, or you do the same from withing your project.

  • Create temporary table as

    Hi every body!
    Can I use follow statement:
    "Create global temporary table AAA as select * from other table " to create temporary table ?
    Thank you very much.

    here it goes
    SQL> Select *
      2  From a1;
    N
    1
    3
    1
    SQL>
    SQL> create global temporary table temp_a3
      2  on commit preserve Rows
      3  As Select * From a1
      4  /
    Table created
    SQL> Select * From temp_a3;
    N
    1
    3
    1regards
    nic

  • Creating temporary tables

    Hi All ,
    I am new to oracle and i need to find out how can i create a temporary table in Oracle ?
    in MS SQL it's "select * into #tbl1 from tblABC"
    how can i do that in PL/SQL
    appreciate ur advise
    tks & rdgs

    the reason for wanting to create temp tables isonly for a particular session and also i'll
    get the columns definition directly from thesource table
    You are thinking like an MSSQL coder. Creating and
    dropping tables on the fly is A Bad Thing. It is
    slow - any DDL is. It is risky (what happens if the
    table cannot be created for any reason? what happens
    if it cannot be dropped?). It may complicate our
    transactional processing. It is also unnecssary,
    because Oracle provides us with a mechanism - global
    temporary tables - which doesn't exist in MSSQL.
    So please consider what actually benefit you derive
    from creating and dropping tables rather than using
    global temporary tables. Also whether you need any
    form of temporary table: Oracle has some nifty
    features, especially in the analytic functions, that
    may obviate the need for any intermediate data
    manipulation when generating reports.
    Cheers, APCHi ,
    yes it's true that i am still thinking from an MSSQL coder's pt of view , i thank you for your explanation and i yes shld start to learn to think as an Oracle coder so as to get the best out of Oracle

  • Creating temporary table in pl/sql block problem

    hello
    i have a problem in creating and using temporary table in pl/sql block
    please verify below block
    begin
    execute immediate 'create global temporary table alitemp1 (co_t varchar2(10),color varchar2(10))';
    insert into alitemp1 (co_t,color) values ('001','red');
    execute immediate 'DROP TABLE alitemp1';
    end;
    when i execute that block i will receive this error
    insert into alitemp1 (co_t,color) values ('001','red');
    ERROR at line 3:
    ORA-06550: line 3, column 14:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 3, column 2:
    PL/SQL: SQL Statement ignored
    i think it because that alitemp1 table don't create
    but two below block run fine
    begin
    execute immediate 'create global temporary table alitemp1 (co_t varchar2(10),color varchar2(10))';
    execute immediate 'DROP TABLE alitemp1';
    end;
    begin
    execute immediate 'create global temporary table alitemp1 (co_t varchar2(10),color varchar2(10))';
    end;
    select table_name from user_tables where table_name='ALITEMP1';
    TABLE_NAME
    ALITEMP1
    it means that problem is when the below line exists in block
    insert into alitemp1 (co_t,color) values ('001','red');
    if may please guide me

    In addition to the comments by Justin and 3360, you cannot do what you want the way you are doing it.
    All objects referred to in a PL/SQL block must exist at the time the block is compiled. In your case, since it is an anonomous block, that is run time. Since you are dynamically creating the temporary table you need to refer to it dynamically as well. More like:
    BEGIN
    EXECUTE IMMEDIATE 'create global temporary table alitemp1 (co_t varchar2(10),
                                                               color varchar2(10))';
    EXECUTE IMMEDIATE 'insert into alitemp1 (co_t,color) values (:b1,:b2)' USING '001', 'red';
    EXECUTE IMMEDIATE 'DROP TABLE alitemp1';
    END;However, don't do that it is a really bad idea. Just create the temporary table, if you really need it, once and use it in your processing.
    In most cases, things that SQL Server needs temporary tables for can be done easily in Oracle with a single SQL statement,
    John

Maybe you are looking for

  • InCopy CS5 Crashes Upon Exit

    Hello.  I am currently working with InCopy CS5 and have an issue with the software crashing when exiting the app. This error reads: Windows XP (32 bit) =>  "DDE Server Window:  InCopy.exe - Application Error  --  The instruction at "0x008f77f3" refer

  • My ipad front camera doesn't working,cannot take a picture this moment,how to fix this problem?

    My ipad front camera doesn't working,cannot take a picture this moment,how to fix this problem?

  • How to install the B1iP for 2007.

    Hi, all Does anyone know how to install the B1iP for 2007. I tried but this message was occured. "new: 127.0.0.1"\SBO_SHR\B1is\apps\PaymentEngine Neither share folder "B1_SHR" nor "SBO_SHR" exist!" Acctualy there is no such folder. Should I create th

  • Need Help with install of Final Cut Pro HD

    Hi I am tryting to install FCP Express HD on my G4 Ibook and I get a strange error message. It was able to instaLL fine but when I got to run the program I get this message Can't install unable to find easy setup file please reinstall and try again.

  • GIF file with transparent background (white spots)

    Hii. I've been having a problem. I was trying to make a signature earlier with gif on photoshop cs5. I tried making it with a transparent background and when I put it up on the forum, it gave me white spots. It's not noticeable with a white backgroun