Sntax error when creating a temp table

Hi All,
I get a syntax error when I try to create a  temporary table using the below sql statement.
create global temporary column table prc as table precipitation;
The  table precipitation exists in the database under my ID.
Could anyone please let me know what is wrong with the above statement.
Thanks,
Goutham

Try:
create global temporary column table prc like precipitation;
or
create global temporary column table prc as (select * from precipitation);
Cheers,
Jody
(HANA SQL Reference Manual:  https://websmp201.sap-ag.de/~sapidb/011000358700000604922011)

Similar Messages

  • Error while creating Global temp table

    Hi,
    I am very new to PL/SQL so please excuse my question. I have the below query . I have to get a count between the source table and various target tables. I am creating a global temp table to store the counts. I am getting the below error for my following query :
    Thanks for the help,
    Petronas
    ----Query----
    set serveroutput on
    Declare
    nm1 varchar2(200);
    nm2 varchar2(200);
    cnt1 number;
    cnt2 number;
    diff number;
    totdiff number;
    Begin
    nm1 := null;
    nm2:= null;
    cnt1:= 0;
    cnt2 := 0;
    diff := 0;
    totdiff := 0;
    create GLOBAL TEMPORARY TABLE diff ( name1 varchar(200), name2 varchar2(200), diff number);
    select count(*) into cnt1
    from users_staging;
    select count(*) into cnt2
    from PROD.users;
    nm1 := 'users_staging';
    nm2 := 'PROD.users';
    diff := cnt1 - cnt2;
    insert into diff values (nm1,nm2,diff);
    select count(*) into totdiff
    from diff
    where diff> 0 ;
    dbms_output.enable(10000);
    dbms_output.put_line('# of tables where difference is > 0 ' ||totdiff);
    end;
    Encountered the symbol "CREATE" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-identifier>
    <a bind variable> << close current delete fetch lock insert
    open rollback savepoint set sql execute commit forall merge
    pipe

    Hi,
    "CREATE GLOBAL TEPORARY TABLE ..." is not a PL/SQL command; it is a SQL command only.
    Create the table, using that statement, before running the PL/SQL block.
    You can issue SQL statements from within PL/SQL using the EXECUTE IMMEDIATE command, but this is rarely a good idea.
    I assume the PL/SQL code is meant to create the table and then populate it.
    You should split those into two separate pieces of code. You'll only want to create the table once, no matter how many times you use it. I assume you'll want to populate it the same way many times. Remember, the "TEMPORARY" in "GLOBAL TEMPORARY TABLE" refers to the data, not the table. When you end a transaction (or a session, depending on whther you want "ON COMMIT DELETE ROWS" or "ON COMMIT PRESERVE ROWS"), the data disappears, but the now-empty stays, ready to be populated for the next transaction (or session).
    Edited by: Frank Kulash on Aug 4, 2010 2:25 PM

  • Error when creating index with parallel option on very large table

    I am getting a
    "7:15:52 AM ORA-00600: internal error code, arguments: [kxfqupp_bad_cvl], [7940], [6], [0], [], [], [], []"
    error when creating an index with parallel option. Which is strange because this has not been a problem until now. We just hit 60 million rows in a 45 column table, and I wonder if we've hit a bug.
    Version 10.2.0.4
    O/S Linux
    As a test I removed the parallel option and several of the indexes were created with no problem, but many still threw the same error... Strange. Do I need a patch update of some kind?

    This is most certainly a bug.
    From metalink it looks like bug 4695511 - fixed in 10.2.0.4.1

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • When analytical queries create implicit temp tables?

    Hi,
    We have a DSS project on Oracle 9i Release 2 running on HP-UX. The project includes lots of SQL Analytical queries which handle huge data set, and makes lots of hash/merge joins and sorts. When I look at execution plans of the queries, I see that some of them create implicit temp tables and execute on it, but some not (creating window(buffer) ). I wonder how the optimizer decides to create implicit temp table when executing analytical queries. And also is three a SQL hint to force to create implicit temp table?
    Regards

    Hi,
    We have a DSS project on Oracle 9i Release 2 running on HP-UX. The project includes lots of SQL Analytical queries which handle huge data set, and makes lots of hash/merge joins and sorts. When I look at execution plans of the queries, I see that some of them create implicit temp tables and execute on it, but some not (creating window(buffer) ). I wonder how the optimizer decides to create implicit temp table when executing analytical queries. And also is three a SQL hint to force to create implicit temp table?
    Regards

  • PL/SQL to create a temp table that will be dropped after session ends

    Is it possible in PL/SQL to create a temp table that will be dropped after the session ends? Please provide example if possible. I can create a global temp table in PL/SQL but I am not sure how (if possible) to have it 'drop' once the session ends.
    DB: 10g
    OS: Wiindoze 2003 Server
    :-)

    As others have mentioned (but probably not clearly explained), Oracle treats temporary tables differently to SQL Server.
    In SQL Server you create a temporary table and it gets dropped (automatically I assume, I dont do SQL Server) after the session finishes. This will obviously allow each session to "request" a temporary table to use, then use it, and not have to worry about cleaning up the database after the session has finished.
    Oracle takes a different approach...
    On the assumption that each session is likely to be creating a temporary table for the same purposes, with the same structure, Oracle let's you create a Global Temporary Table a.k.a. GTT (which you've already come across). You only have to create this table once and you leave it on the database. This then means that any code written to use that table doesn't have to be dynamic code and can be verified and checked at compile time, just like code written for any other table. The difference of a GTT from a regular table is that any data you put into that table can only be seen by that session and will not interfere with any data of other sessions and, when you either commit, or end the session (depending on the "on commit delete rows" or "on commit preserve rows" option used when creating the GTT), that data from your own session will automatically be removed and hence the table is cleaned up that way, whilst the actual table itself remains.
    Some people from SQL Server backgrounds try and create and drop tables dynamically in their PL/SQL code, but this leads to problems...
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2    execute immediate 'create table my_temp (x number)';
      3    insert into my_temp values (1);
      4    execute immediate 'drop table my_temp';
      5* end;
    SQL> /
      insert into my_temp values (1);
    ERROR at line 3:
    ORA-06550: line 3, column 15:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 3, column 3:
    PL/SQL: SQL Statement ignoredi.e. the code will not compile for direct DML statements trying to use that table.
    They then try and get around this issue by making their DML statements dynamic too...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure my_proc is
      2  begin
      3    execute immediate 'create table my_temp (x number)';
      4    execute immediate 'insert into my_temp values (''A'')';
      5    execute immediate 'drop table my_temp';
      6* end;
    SQL> /
    Procedure created.... which looks great and it compiles ok... but... when they try and run it...
    SQL> exec my_proc;
    BEGIN my_proc; END;
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at "SCOTT.MY_PROC", line 4
    ORA-06512: at line 1... oops the code has a bug in it. Our DML statement was invalid.
    This is really something that would have been caught at compile time, if the statement had been a direct DML statement rather than dynamic. And thus we see the problem with people trying to write all their code as dynamic SQL... it's more likely to contain bugs that won't be detected at compile time and only come to light at run time... sometimes only under certain conditions and sometimes once it's got into a production environment. Bad Idea!!!! ;)
    Far better to never create tables (or most other database objects) at run time. Just create them once as part of the database design/implementation and use them as required, allowing you to catch the most common coding errors up front before they get anywhere near a test environment or worse still, a production environment.

  • HOW TO create a temp table or a record group at run time

    i have a a tabular form and i dont want to allow the user entering duplicate
    records while he is in insert mode and the inserted records are new and not exsisting in the database.
    so i want to know how to create a temp table or a record group at run time to hold the inserted valuse and compare if they are exsiting in previous rows or no.
    please help!

    As was stated above, there are better ways to do it. But if you still wish to create a temporary block to hold the inserted records, then you can do this:
    Create a non-database block with items that have the same data types as the database table. When the user creates a new record, insert the record in the non-database block. Then, before the commit, compare the records in the non-database block with those in the database block, one at a time, item by item. If the record is not a duplicate, copy the record to the database block. Commit the records, and delete the records in the non-database block.

  • Error while creating publisher change tables in CDC

    Hi,
    I am implementing Change Data Capture. I got getting following error while creating publisher change tables in Staging database. My database version is 10.2.0.2.0 .
    I appreciate your help.
    ERROR at line 1:
    ORA-29540: class oracle/CDC/PublishApi does not exist
    ORA-06512: at "SYS.DBMS_CDC_PUBLISH", line 611
    ORA-06512: at line 2
    Thanks,
    Venkat.

    This problem got fixed when I ran below script!!
    @$ORACLE_HOME/rdbms/admin/initcdc.sql;

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • Procurement Coordinator received Authorization Error when creating Bid Inv

    Hi All,
            In SRM I have an issue Please help me in solving this. Please see below
                  Procurement Coordinator received Authorization Error when creating Bid Invitation from Sourcing Cockpit.  Message states u201CMissing Transaction BBP_BID_EXTSOu201D; however Bid # is still created. User requests that Authorization issue is resolved and Bid # appear for Procurement Coordinators.  This problem does not happen for Commodity Managers

    Hi
    Please do the following steps.
    When you are using the Internal ITS,you need not run the report W3_PUBLISH_SERVICES.(only SIAC_PUBLISH_ALL_INT )
    ALso pls check the foll:
    -->activate the services through SICF tcode.
    > Go to SICF transaction and activate the whole tree under the node Deafult host>sap>bc>gui>sap>its.
    >Also maintain the settings in SE80>utilities>settings>internet transactuon server-->test service/Publish.
    Table TWPURLSVR should have entries for the / SRM server line as well as gui and web server.
    Could you please review again the following steps ?
    Did you check that ICM was working correctly (TA SMICM) ?
    1-Activate the necessary ICF services
    With transaction SICF and locate the
    services by path
    /sap/public/bc/its/mimes
    /sap/bc/gui/sap/its/webgui
    2- Publish the IAC Services
    With Transaction SE80 locate from
    the menu Utilities -> Settings ->
    Internet Transaction Server (Tab) ->
    Publish (Tab) and set “On Selected
    Site” = INTERNAL.
    3- Locate the Internet Services SYSTEM and WEBGUI.
    Publish these services with the Context
    Menu -> Publish -> Complete Service
    4- Browse to http://<server>:<icmport>/sap/bc/gui/
    sap/its/webgui/! and login to the
    webgui.
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • Error when creating files for transport request SAPK-700BGINPLMWUI

    Hello experts,
    We're upgrading our 46c System to ERP 6.0 EHP4.
    In Phase  EHP_INCLUSION we get the following error Message: Disassembling package queue failed, rc = "2", reason = "Error when creating files for transport request SAPK-700BGINPLMWUI"
    We've already checked the SAINT version; Upgrade Fix, SAPCAR version. We've checked our TMS as well and everything seems  O.K.
    Any help would be really appreciated!!!
    Complete Error message:
    EhP component PLMWUI, 700                                                                               
    Looking for SAINT package for 'PLMWUI' ...                                                                               
    R3upReadNewPackages:                                                                               
    patchType='U', langVect='DEC'                                                                               
    RFC Login to: System="X05", Nr="00", GwHost="sxt ", GwService="sapgw00"                                                 
    RFC Login succeeded                                                                               
    Calling function module "spda_read_new_packages" by RFC                                                                     
      ismovesVersion='0'                                                                               
    R3upReadNewPackages: exit: rc=0                                                                               
    ... No matching package found.                                                                               
    R3upReadNewPackages:                                                                               
    patchType='I', langVect='DEC'                                                                               
    RFC Login to: System="X05", Nr="00", GwHost="sxt ", GwService="sapgw00"                                                 
    RFC Login succeeded                                                                               
    Calling function module "spda_read_new_packages" by RFC                                                                     
      ismovesVersion='0'                                                                               
    R3upReadNewPackages: exit: rc=0                                                                               
    Found: name = 'PLMWUI', release = '700', package = 'SAPK-700BGINPLMWUI', type = 'AOI'                                  
    ... Matching package found: 'PLMWUI','700','SAPK-700BGINPLMWUI'                                                             
    (trc) R3upPatchDisassembleQueue: 1 package queue entries                                                                    
    (trc) R3upPatchDisassembleQueue: force=YES                                                                               
    (trc) R3upPatchDisassembleQueue: 1 packages will be disassembled                                                            
    Starting disassembling package queue                                                                               
    Date & Time: 20100319133139                                                                               
    Starting RFC Login to: System = "X05", GwHost = "sxt ", GwService = "sapgw00"                                           
    RFC Login to: System="X05", Nr="00", GwHost="sxt ", GwService="sapgw00"                                                 
    RFC Login succeeded                                                                               
    Calling function module "SPDA_DISASSEMBLE_QUEUE" by RFC                                                                     
    Input table IT_PATQ:                                                                               
    "SAPK-700BGINPLMWUI","000","AOI","PLMWUI","700","SAP PLM Web UI","00"                                                       
    Call of function module "SPDA_DISASSEMBLE_QUEUE" by RFC succeeded                                                           
    Logging off from SAP system                                                                               
    Date & Time: 20100319133139                                                                               
    Disassembling package queue failed, rc = "2", reason = "Error when creating files for transport request SAPK-700BGINPLMWUI"

    Hello Anthes,
    Please Check the things in following sequence :
    1.Use latest SAPehpi, R3trans and tp versions.
    2. users/group authorization issue and/or ownersip limitations (set 777) .Reboot the server to make sure, that the authorisations are updated and there is no lock on a file in the EHPI dir.Repeat the phase.
    Folders where permissions should be 777 are Upgrade directory, Data Directory, Cofile directory and .../EPS/in.
    3. Source file corruption can be ruled out by execution
    R3trans -l /usr/sap/<SID>/..../abap/data/R-700BGINPLMWUI.SAP (The data file corresponding to the Package which is giving error). Check if this ends fine.
    Note 2050
    4. Confirm that your transport tool is 'healthy' by testing it in STMS. In SPAM in client 000 use the function Disassemble package and enter the package <Package name>.
    5. Try to update the kernel if it not helps.
    Best Regards
    Niraj

  • " Error when inserting in PSA table RSTSODSPART" when loading into PSA

    Hello,
    Did anyone encounter something similar, and found a solution ?
    BI 7.0 -  EnhP 1 - SP5
    When loading data from R/3 into PSA, we encounter following error message:
    " Error when inserting in PSA table RSTSODSPART"
    ===============================================================
    - the first datapackage is written successfully to PSA,
    but from the second datapackage onwards the error message pops-up
    " Error when inserting in PSA table RSTSODSPART"
    - The original dataselection in the infopackage is somewhere stored
    If the selection in the InfoPackage is reduced (e.g. only one document i.o. a period)
    it stil starts loading according the original selection (the month)
    - If we create a new InfoPackage and select very few data (only one datapackage)
    then we can load to PSA succesfully, but when we load to DSO we can't activate the DSO.
    - We remarked that:
    Two versions of the PSA exist for that datasource 0FI_GL_40:
    a Table(/BIC/B0000555000) in version 1 exists,
    a Table(/BIC/B0000555001) in version 2 exists
    Thanks in advance,
    Best regards

    Hello All,
    We had a problem similar to what Ilse Depoortere describes. The problem happens in our BW QA system a few days/weeks after it has been copied from Production. Data loads start failing with these two error messages:
    RSM2 851 - Error when writing in PSA (Caller 32)
    RSAR 130 - Error 7 when adding to PSA (Caller 70)
    We have just implemented the fix described in note 1340371 (replaced the LIB_DBSL with patch level 247), and the problem is gone. Failed data load process chains can be restarted and finish successfully.
    This has been a really useful discussion, thanks all! And thanks to my coworker Bob who found it.
    Vince Vajda

  • Error when creating billing / accounting document with VF01

    Hi All,
    When I use VF01 to create an invoice with reference to a LF D/N, I got the following error after saving.
    "An exchange rate type is not defined for country CN
    Message no. FF 802". And billing document is created but with no accounting document.
    I checked the exchange rate type is defined. but I can not find the place where I can assign to the specific country.
    Best Regards
    Jean

    Thanks for your help.
    Hi Dave,
    I checked in S_BCE_68000174, it has been already assigned.
    Hi Ferry,
    In FTXP, the tax code has been maintained.
    And you are right, when I maintain the field KURST in table T005, it is ok. But I am confused in 4.6C, the field KURST can be maintained by T-code OY01, but in 470, exchange rate type cannot be found in OY01. Where can I set in 470?  And why in 470, even field KURST is empty in table T005, but there is no such error when creating billing document?
    Many Thanks
    Jean

  • Error while creating the DWH tables using DAC

    Hi,
    I am getting error while creating the DWH tables using DAC. I have created a ODBC DSN using merant driver with DAC repository DB credentials and the test connection is successful. And while creating the tables i gave the olap dw credentials and the DSN name which i created earlier. But it throws the error as below:
    Please find the below mentioned error message
    =====================================
    STD OUTPUT
    =====================================
    CREATING SIEBEL DATABASE OBJECTS
    F:\DAC\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u infdomain /p ******* /c DB_DAC /G "SSE_ROLE" /f F:\DAC\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b "" /K "" /X "" /W N
    Error while importing Siebel database schema.
    =====================================
    ERROR OUTPUT
    =====================================
    Siebel Enterprise Applications ODBC DDL Import Utility, Version 7.7 [18030] ENU
    Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.
    This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
    San Mateo, CA 94404.
    User agrees that any use of this software is governed by: (1) the applicable
    user limitations and other terms and conditions of the license agreement which
    has been entered into with Siebel Systems or its authorized distributors; and
    (2) the proprietary and restricted rights notices included in this software.
    WARNING: THIS COMPUTER PROGRAM IS PROTECTED BY U.S. AND INTERNATIONAL LAW.
    UNAUTHORIZED REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PORTION
    OF IT, MAY RESULT IN SEVERE CIVIL AND CRIMINAL PENALTIES, AND WILL BE
    PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER THE LAW.
    If you have received this software in error, please notify Siebel Systems
    immediately at (650) 295-5000.
    F:\DAC\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u infdomain /p ***** /c DB_DAC /G SSE_ROLE /f F:\DAC\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b /K /X /W N
    Connecting to the database...
    28000: [DataDirect][ODBC Oracle driver][Oracle]ORA-01017: invalid username/password; logon denied
    Unable to connect to the database...
    any help is appreciated.
    Thanks,
    RM

    The fact that you are getting an "ORA-01017: invalid username/password; logon denied" message indicates that you are at least talking to the database.
    The log shows that username "infdomain" is being used. Can you double check the username and password you have in DAC in a SQL*Plus/SQL Developer session?
    Please mark if useful/helpful,
    Andy.

  • How to create a temp table in the memory, not in disk?

    in sql server, you can create a temp table in the memory instead of disk,
    then you can do the insert, delete,update and select on it.
    after finishing, just release it.
    in Oracle,
    I am wonderfing how to create a temp table in the memory, not in disk?
    thanks,

    Thanks for rectifying me Howard.
    I just read your full article on this too and its very well explained here:
    http://www.dizwell.com/prod/node/357
    Few lines from your article
    It is true, of course, that since Version 8.0 Oracle has provided the ability to create a Keep Pool in the Buffer Cache, which certainly sounds like it can do the job... especially since that word 'keep' is used again. But a keep pool is merely a segregated part of the buffer cache, into which you direct blocks from particular tables (by creating them, or altering them, with the BUFFER POOL KEEP clause). So you can tuck the blocks from such tables out of the way, into their own part of the buffer cache... but that is not the same thing as guaranteeing they'll stay there. If you over-populate the Keep Pool, then its LRU mechanism will kick in and age its contents out just as efficiently as an unsegregated buffer cache would.
    Functionally, therefore, there can be no guarantees. The best you can do is create a sufficiently large Keep Pool, and then choose the tables that will use it with care such that they don’t swamp themselves, and start causing each other to age out back to disk.
    Thanks and Regards

Maybe you are looking for

  • REP: 3002 & 19200 - Character base report on n-tier application.

    Dear friends We are using ORACLE 8i as database server, IIS as Web server, Front-end is -Forms 6i and Reports 6i. We have developed Reports both in character and Bitmap as per client's requirement. Bitmap reports are working fine in 2- tier as well a

  • The documentation links are broken......

    This page contains installation, migration, and upgrade documentation as well as product and component release notes. For information on using Oracle Application Server, refer to the Oracle Application Server documentation library. The library is ava

  • Text nodes are colapsed to one string

    Hi, I am new to Oracle XML. i need to parse a xmltype table coulmn and load data to a diffrent table. XSD sample <xsd:element name="BrowserPluginList"> <xsd:complexType> <xsd:sequence> <xsd:element name="BrowserPlugin" type="xsd:string" maxOccurs="un

  • Multiple Excel Sheet not working

    Hi,       I have a requirement where I need to split the excel data and send it to my inbox as excel attachment. But the below is not working as expected. Do let me know if there is issue with the below code.   DATA : lv_start type i value '1',      

  • After a few seconds iTunes jumps to previous song.

    Since a couple of days I have a severe problem with iTunes. When playing music in the music library iTunes jumps back to the previous song after a few seconds of playing the current song. Sometimes this happens half way the song but most of the times