CREATE TABLE AS using WITH

I am converting a PostreSQL query to T-SQL but am running into a syntax error that I cannot understand.
My main query below works fine.
WITH itowner AS (
        SELECT itowner_1.comp1id AS businessserviceid,
            person.name AS itowner_name,
            person.username AS itowner_username,
            person.component_id AS itowner_id
           FROM dbo.rel_BusinessServiceHasITOwnerPerson itowner_1
      JOIN comp_Person person ON person.component_id = itowner_1.comp2id
busowner AS (
         SELECT bown.comp1id AS businessserviceid,
            person.name AS busown_name,
            person.username AS busown_username,
            person.component_id AS busown_id
           FROM dbo.rel_BusinessServiceHasBusinessOwnerPerson bown
      JOIN comp_Person person ON person.component_id = bown.comp2id
cat AS (
        SELECT biz.component_id businessserviceid, biz.bsname AS Business_Service, 
c.name AS Category
FROM dbo.comp_BusinessService biz
left outer join rel_BusinessServiceHasCategory a on biz.component_id = a.comp1id
join comp_ApoCategory c on a.comp2id = c.component_id
LEFT OUTER JOIN comp_ApoCategory c1 ON c.parent = c1.objectuuid
 SELECT 
    cat.Category,
    biz.component_id AS businessservice_id,
    biz.bsname as businessservice_name,
    biz.description,
    itowner.itowner_name,
    busowner.busown_name
   FROM comp_BusinessService biz
   LEFT JOIN itowner  ON itowner.businessserviceid  = biz.component_id
   LEFT JOIN busowner ON busowner.businessserviceid = biz.component_id
   LEFT JOIN cat      ON cat.businessserviceid      = biz.component_id;
However, as soon as I wrap it in a CREATE TABLE AS I get an syntax error at the first WITH.
   Incorrect syntax near 'WITH'.  Expecting ID.
Below is the full statement.
CREATE TABLE "dm_amd_business_services" AS
WITH itowner AS (
        SELECT itowner_1.comp1id AS businessserviceid,
            person.name AS itowner_name,
            person.username AS itowner_username,
            person.component_id AS itowner_id
           FROM dbo.rel_BusinessServiceHasITOwnerPerson itowner_1
      JOIN comp_Person person ON person.component_id = itowner_1.comp2id
busowner AS (
         SELECT bown.comp1id AS businessserviceid,
            person.name AS busown_name,
            person.username AS busown_username,
            person.component_id AS busown_id
           FROM dbo.rel_BusinessServiceHasBusinessOwnerPerson bown
      JOIN comp_Person person ON person.component_id = bown.comp2id
cat AS (
        SELECT biz.component_id businessserviceid, biz.bsname AS Business_Service, 
c.name AS Category
FROM dbo.comp_BusinessService biz
left outer join rel_BusinessServiceHasCategory a on biz.component_id = a.comp1id
join comp_ApoCategory c on a.comp2id = c.component_id
LEFT OUTER JOIN comp_ApoCategory c1 ON c.parent = c1.objectuuid
 SELECT 
    cat.Category,
    biz.component_id AS businessservice_id,
    biz.bsname as businessservice_name,
    biz.description,
    itowner.itowner_name,
    busowner.busown_name
   FROM comp_BusinessService biz
   LEFT JOIN itowner  ON itowner.businessserviceid  = biz.component_id
   LEFT JOIN busowner ON busowner.businessserviceid = biz.component_id
   LEFT JOIN cat      ON cat.businessserviceid      = biz.component_id;
Any advice on getting the correct syntax?
Thanks, Bruce...

;WITH itowner AS (
SELECT itowner_1.comp1id AS businessserviceid,
person.name AS itowner_name,
person.username AS itowner_username,
person.component_id AS itowner_id
FROM dbo.rel_BusinessServiceHasITOwnerPerson itowner_1
JOIN comp_Person person ON person.component_id = itowner_1.comp2id
busowner AS (
SELECT bown.comp1id AS businessserviceid,
person.name AS busown_name,
person.username AS busown_username,
person.component_id AS busown_id
FROM dbo.rel_BusinessServiceHasBusinessOwnerPerson bown
JOIN comp_Person person ON person.component_id = bown.comp2id
cat AS (
SELECT biz.component_id businessserviceid, biz.bsname AS Business_Service,
c.name AS Category
FROM dbo.comp_BusinessService biz
left outer join rel_BusinessServiceHasCategory a on biz.component_id = a.comp1id
join comp_ApoCategory c on a.comp2id = c.component_id
LEFT OUTER JOIN comp_ApoCategory c1 ON c.parent = c1.objectuuid
SELECT
cat.Category,
biz.component_id AS businessservice_id,
biz.bsname as businessservice_name,
biz.description,
itowner.itowner_name,
busowner.busown_name
INTO dm_amd_business_services --New table
FROM comp_BusinessService biz
LEFT JOIN itowner ON itowner.businessserviceid = biz.component_id
LEFT JOIN busowner ON busowner.businessserviceid = biz.component_id
LEFT JOIN cat ON cat.businessserviceid = biz.component_id;

Similar Messages

  • Create table problem using Dynamic Query

    Hi all,
    I want to create a temporary table within a stored procedure so I decided to do it using a dynamic query:
    create or replace procedure p1
    as
    begin
    execute immediate 'CREATE GLOBAL TEMPORARY TABLE tt(id number(2))';
    end;
    / It created successfuly but when I execute that procedure I got:SQL> exec p1;
    BEGIN p1; END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SCOTT.P1", line 4
    ORA-06512: at line 1 While I can create that table using the same user without any problem!
    My question is:What privilege should I grant to user(minimum of privileges please! ) to execute that procedure successfuly?
    -Thanks

    Hi,
    To say a little bit more about Nicolas' answer:
    SQL> grant create table to scott;
    This is the right answer, but you might wonder why you have to do so if you usually can create tables with this user..
    11:59:19 TEST.SQL>CREATE USER UTEST
    11:59:28   2  IDENTIFIED BY UTEST;
    User created.
    11:59:35 TEST.SQL>CREATE ROLE RTEST;
    Role created.
    11:59:40 TEST.SQL>GRANT RTEST TO UTEST;
    Grant succeeded.
    11:59:45 TEST.SQL>GRANT CREATE SESSION TO RTEST;
    Grant succeeded.
    11:59:54 TEST.SQL>GRANT CREATE TABLE TO RTEST;
    Grant succeeded.
    12:00:03 TEST.SQL>GRANT UNLIMITED TABLESPACE TO UTEST;
    Grant succeeded.
    12:00:17 TEST.SQL>CREATE PROCEDURE UTEST.CT_TEST
    12:00:32   2  IS
    12:00:33   3  BEGIN
    12:00:35   4  EXECUTE IMMEDIATE 'CREATE TABLE UTEST.TTEST (A NUMBER)';
    12:00:56   5  END;
    12:00:58   6  /
    Procedure created.
    12:00:59 TEST.SQL>EXEC UTEST.CT_TEST;
    BEGIN UTEST.CT_TEST; END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "UTEST.CT_TEST", line 4
    ORA-06512: at line 1
    12:01:06 TEST.SQL>GRANT CREATE TABLE TO UTEST;
    Grant succeeded.
    12:01:15 TEST.SQL>EXEC UTEST.CT_TEST;
    PL/SQL procedure successfully completed.Don't forget that when you're using PL/SQL, privileges granted via roles are ignored!
    Regards,
    Yoann.

  • Create table dinamically using java sql types?

    Hi! I've an application that reads an XML file. This file contains de definitions of some tables, using java sql types. For example:
    <dbtable>
      <dbtablename>Name of table</dbtablename>
      <dbtablefield>
        <name>Name of table field</name>
        <type>java.sql.Types.VARCHAR</type>
        <length>10</lenght>
        <canNull>0</canNull>
        <isPK>1</isPK>
      </dbtablefield>
    </dbtable>That's a little example of one table, with one field. Is a java.sql.Types.VARCHAR (or is equivalent in int), which has a size of 10, it cannot be null and is a primary key for the table.
    Now, the lenght, null, and primary keys are not problem at all. What I want to know, is how do I create de table using the java.sql.Types. I mean, I don't want to hard code:
    String s = "CREATE TABLE name (COLUMN VARCHAR(10)...";Instead, I want to use some "wild cards", as are used in PreparedStatement. The idea of this is that no matter what DB I'm using, I must always be capable of creating the tables not worrying for the DB. I mean, I must be able to create the table in Oracle, SQL Server, DB2, etc., using the same XML and the same java class.
    Something like:
    String s = "CREATE TABLE name (COLUMN ? (10)...";
    someobject.setObject(1,java.sql.Types.VARCHAR);
    someobject.execute(); //create tableIs this possible? Or do I have to make a map for each DB?
    Thanks a lot for your help! Dukes available!

    you can provide some fields at runtime..
    for example
    "CREATE TABLE name (COLUMN" + arg[1] +"(10)..."
    here arg is the string array passed into the main.

  • Create Table Control using Dynamic Internal Table.

    Hi,
       I have requirement in which I will create a Dynamic Internal Table and then I need to create a Table Control Using that Internal Table. Now this can't be done using Screen Editor as it requires a pre-defined internal table or a DDIC Object.
      Please Help.

    This should be correct answer(I am not author of code below):
    REPORT ztablemaintace NO STANDARD PAGE HEADING.
    TYPE-POOLS: rsds.
    DATA: is_x030l TYPE x030l,
    it_dfies TYPE TABLE OF dfies,
    is_dfies TYPE dfies,
    it_fdiff TYPE TABLE OF field_dif,
    is_fdiff TYPE field_dif.
    DATA: w_selid TYPE rsdynsel-selid,
    it_tables TYPE TABLE OF rsdstabs,
    is_tables TYPE rsdstabs,
    it_fields TYPE TABLE OF rsdsfields,
    it_expr TYPE rsds_texpr,
    it_ranges TYPE rsds_trange,
    it_where TYPE rsds_twhere,
    is_where TYPE rsds_where,
    w_active TYPE i.
    DATA: it_content TYPE REF TO data,
    it_modif TYPE REF TO data,
    it_fcat TYPE lvc_t_fcat.
    DATA: w_okcode TYPE sy-ucomm.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
    <ntab> TYPE STANDARD TABLE.
    * Macros
    DEFINE table_error.
      message e398(00) with 'Table' p_table &1.
    END-OF-DEFINITION.
    DEFINE fixed_val.
      is_fdiff-fieldname = is_dfies-fieldname.
      is_fdiff-fixed_val = &1.
      is_fdiff-no_input = 'X'.
      append is_fdiff to it_fdiff.
    END-OF-DEFINITION.
    * Selection screen
    SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME.
    PARAMETERS: p_table TYPE tabname OBLIGATORY "table
    MEMORY ID dtb
    MATCHCODE OBJECT dd_dbtb_16.
    SELECTION-SCREEN: BEGIN OF LINE,
    PUSHBUTTON 33(20) selopt USER-COMMAND sel,
    COMMENT 55(15) selcnt,
    END OF LINE.
    SELECTION-SCREEN: SKIP.
    PARAMETERS: p_rows TYPE i. "rows
    SELECTION-SCREEN: END OF BLOCK b01,
    SKIP,
    BEGIN OF BLOCK b02 WITH FRAME.
    PARAMETERS: p_displ TYPE c AS CHECKBOX. "display
    SELECTION-SCREEN: END OF BLOCK b02.
    * Initialization
    INITIALIZATION.
      MOVE '@4G@ Filter records' TO selopt.
    * PBO
    AT SELECTION-SCREEN OUTPUT.
      IF w_active IS INITIAL.
        CLEAR: selcnt.
      ELSE.
        WRITE w_active TO selcnt LEFT-JUSTIFIED.
      ENDIF.
    * PAI
    AT SELECTION-SCREEN.
      IF p_table NE is_x030l-tabname.
        CALL FUNCTION 'DDIF_NAMETAB_GET'
          EXPORTING
            tabname   = p_table
          IMPORTING
            x030l_wa  = is_x030l
          TABLES
            dfies_tab = it_dfies
          EXCEPTIONS
            OTHERS    = 1.
        IF is_x030l IS INITIAL.
          table_error 'does not exist or is not active'.
        ELSEIF is_x030l-tabtype NE 'T'.
          table_error 'is not selectable'.
    *    ELSEIF is_x030l-align NE 0.
    *      table_error 'has alignment - cannot continue'.
        ENDIF.
    * Default values for system fields
        REFRESH: it_fdiff.
        is_fdiff-tabname = p_table.
        LOOP AT it_dfies INTO is_dfies.
          IF is_dfies-datatype = 'CLNT'.
            fixed_val sy-mandt.
          ELSEIF is_dfies-rollname = 'ERDAT'
          OR is_dfies-rollname = 'ERSDA'
          OR is_dfies-rollname = 'AEDAT'
          OR is_dfies-rollname = 'LAEDA'.
            fixed_val sy-datum.
          ELSEIF is_dfies-rollname = 'ERTIM'
          OR is_dfies-rollname = 'AETIM'.
            fixed_val sy-uzeit.
          ELSEIF is_dfies-rollname = 'ERNAM'
          OR is_dfies-rollname = 'AENAM'.
            fixed_val sy-uname.
          ENDIF.
          CALL FUNCTION '/SAPDMC/DATAELEMENT_GET_TEXTS'
            EXPORTING
              name        = is_dfies-rollname
            IMPORTING
              text_middle = is_dfies-reptext
            EXCEPTIONS
              not_found   = 1
              OTHERS      = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          MODIFY it_dfies FROM is_dfies.
      ENDLOOP.
    * Prepare free selection on table
      REFRESH it_tables.
      is_tables-prim_tab = p_table.
      APPEND is_tables TO it_tables.
      CLEAR: w_selid.
    ENDIF.
    IF sy-ucomm = 'SEL'.
      IF w_selid IS INITIAL.
    * Init free selection dialog
        CALL FUNCTION 'FREE_SELECTIONS_INIT'
          EXPORTING
            expressions  = it_expr
          IMPORTING
            selection_id = w_selid
            expressions  = it_expr
          TABLES
            tables_tab   = it_tables
          EXCEPTIONS
            OTHERS       = 1.
      ENDIF.
    * Display free selection dialog
      CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
        EXPORTING
          selection_id            = w_selid
          title                   = 'Selection'
          status                  = 1
          as_window               = 'X'
        IMPORTING
          expressions             = it_expr
          field_ranges            = it_ranges
          number_of_active_fields = w_active
        TABLES
          fields_tab              = it_fields
        EXCEPTIONS
          OTHERS                  = 1.
    ENDIF.
    * Start of processing
    START-OF-SELECTION.
      PERFORM f_create_table USING p_table.
      PERFORM f_select_table.
      PERFORM f_display_table.
    * FORM f_create_table *
    FORM f_create_table USING in_tabname.
      FIELD-SYMBOLS: <fcat> TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = in_tabname
        CHANGING
          ct_fieldcat      = it_fcat
        EXCEPTIONS
          OTHERS           = 1.
      IF sy-subrc = 0.
    *   Complete field catalog
        LOOP AT it_fcat ASSIGNING <fcat>.
          <fcat>-tabname = in_tabname.
        ENDLOOP.
        CALL FUNCTION 'LVC_FIELDCAT_COMPLETE'
          CHANGING
            ct_fieldcat = it_fcat
          EXCEPTIONS
            OTHERS      = 1.
      ELSE.
        WRITE: 'Error building field catalog'.
        STOP.
      ENDIF.
    * Create dynamic table for data
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    * Create dynamic table for modif
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_modif.
      IF sy-subrc = 0.
        ASSIGN it_modif->* TO <ntab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    ENDFORM.                    "f_create_table
    * FORM f_select_table *
    FORM f_select_table.
      IF w_active = 0.
        SELECT * FROM (p_table)
        INTO CORRESPONDING FIELDS OF TABLE <itab>
        UP TO p_rows ROWS.
      ELSE.
    * Selection with parameters
        CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_WHERE'
          EXPORTING
            field_ranges  = it_ranges
          IMPORTING
            where_clauses = it_where.
        READ TABLE it_where INTO is_where WITH KEY tablename = p_table.
        SELECT * FROM (p_table)
        INTO CORRESPONDING FIELDS OF TABLE <itab>
        UP TO p_rows ROWS
        WHERE (is_where-where_tab).
      ENDIF.
      IF sy-dbcnt = 0.
        WRITE: 'No record selected'.
        STOP.
      ENDIF.
    ENDFORM.                    "f_select_table
    * FORM f_display_table *
    FORM f_display_table.
      DATA: l_answer TYPE c,
      l_eflag TYPE c.
      CLEAR: w_okcode.
      REFRESH: <ntab>.
    * Display table contents
      CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
        EXPORTING
          header       = p_table
          tabname      = p_table
          display_only = p_displ
          endless      = 'X'
          no_button    = space
        IMPORTING
          okcode       = w_okcode
        TABLES
    *      nametab      = it_dfies
          table        = <itab>
    *      fielddif     = it_fdiff
          modif_table  = <ntab>
        EXCEPTIONS
          OTHERS       = 1.
      IF sy-subrc = 0.
        IF p_displ IS INITIAL AND w_okcode = 'SAVE'.
    * Confirm update
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar              = p_table
              text_question         = 'Do you want to update table ?'
              default_button        = '2'
              display_cancel_button = ' '
            IMPORTING
              answer                = l_answer
            EXCEPTIONS
              OTHERS                = 1.
          IF l_answer = '1'.
    * Apply modifications
            IF NOT <ntab>[] IS INITIAL.
              PERFORM f_add_system USING space.
              MODIFY (p_table) FROM TABLE <ntab>.
              IF sy-subrc NE 0.
                l_eflag = 'X'.
              ENDIF.
            ENDIF.
    * Apply deletions
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                TABLES
                  deleted_data = <ntab>
                EXCEPTIONS
                  OTHERS       = 1.
              IF NOT <ntab>[] IS INITIAL.
                DELETE (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
    * Apply creations
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                TABLES
                  new_data = <ntab>
                EXCEPTIONS
                  OTHERS   = 1.
              IF NOT <ntab>[] IS INITIAL.
                PERFORM f_add_system USING 'X'.
                INSERT (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
            IF l_eflag IS INITIAL.
              COMMIT WORK.
              MESSAGE s261(53).
            ELSE.
              MESSAGE s075(3i).
              PERFORM f_select_table.
            ENDIF.
          ENDIF.
    * Display table again
          PERFORM f_display_table.
        ENDIF.
      ENDIF.
    ENDFORM.                    "f_display_table
    * FORM f_add_system *
    FORM f_add_system USING new TYPE c.
      FIELD-SYMBOLS: <irec> TYPE ANY,
      <upd> TYPE ANY.
      LOOP AT it_fdiff INTO is_fdiff.
        READ TABLE it_dfies INTO is_dfies
        WITH KEY fieldname = is_fdiff-fieldname.
        LOOP AT <ntab> ASSIGNING <irec>.
          ASSIGN COMPONENT is_fdiff-fieldname OF STRUCTURE <irec> TO <upd>.
          IF is_dfies-datatype = 'CLNT'.
            <upd> = sy-mandt.
          ELSE.
            CASE is_dfies-rollname.
              WHEN 'AENAM'.
                <upd> = sy-uname.
              WHEN 'AEDAT' OR 'LAEDA'.
                <upd> = sy-datum.
              WHEN 'AETIM'.
                <upd> = sy-uzeit.
              WHEN OTHERS.
            ENDCASE.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    "f_add_system

  • Can oracle temporary tables be used with distributed transactions?

    Hello,
    Does anybody know if temporary tables are supported with distributed transactions?
    We use a temporary table to store query results and see no problems when the JDBC driver (Type 2 or Type 4) is used with local transactions. The temporary tables are set for transaction-level data persistence (delete rows on commit).
    When we switch to JDBC/XA driver we occasionally get ORA-14450 error (java.sql.SQLException: ORA-14450: attempt to access a transactional temp table already in use).
    Many thanks...

    I have been able to use temporary tables on remote databases, so I don't think that it is forbidden. Of course, I'm not using JDBC so that might be a problem.
    The other thing that occurs to me is that you are doing something other than DML with the table e.g. trying to drop it. If that is the case you should re-read the documentation and remind yourself of the purpose of temporary tables.
    Cheers, APC

  • Can we create table maintence generator with out key field

    Hi,
    I have created a ztable in that client is the primary key as I don't want any other field as primary key.
    For this  i have created table maintenace generator but when i open it in sm30 blnak screen is coming.
    Here my question is can we create a table maintenace generator with out key field other than MANDT.
    If it's possible please let me know.
    Regards
    hari

    >
    Mathews Joseph wrote:
    > I agree to the above points , but you can try one thing.
    >
    > When you create the table maintenance screen , from SE11 you assign a function group.
    >
    > Double click on the function group and you can go to the main program and open that in SE80, take screen generated and try manually adjusting the screen and putting the non key field details...
    >
    > Not sure this will work , but may be you can give it a try.
    >
    > Mathews
    But the table could hold at most a single record (per client). The design is lacking.
    Rob

  • Problem while creating table dynamically using stored procedure

    Hi all
    When i try to execute the following lines get insufficient privilege error.
    FYI: i m able to create table statically.(i.e without using stored procedure)
    CREATE OR REPLACE PROCEDURE pcalling IS
    str varchar2(60);
    BEGIN
    str:='create table t15(tno number,tname varchar2(5))';
    execute immediate str;
    END;
    Thanks in advance
    Satya

    hi
    SQL> CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
      2     AUTHID CURRENT_USER
      3  IS
      4  BEGIN
      5     EXECUTE IMMEDIATE ddl_in;
      6  END;
      7  .
    SQL> /
    Procedure created.AUTHID CURRENT_USER clause before the IS keyword which runddl executes, it should run under the authority of the invoker, or current user not the authority of the definer.
    if you omit it then it will no longer will be run if the creator doesnt have privelege to run this ddl regardless invoker has or not.
    i hope you got it
    Khurram Siddiqui
    [email protected]

  • Create table space command with no specification of data file path.

    I am using following command for creating table space in oracle 11g
    CREATE TABLESPACE testTbSpace DATAFILE 'dataFileName.dbf' SIZE 50M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE 32767M NOLOGGING"
    But it is creating datafile dataFileName.dbf at disk at following path
    echo $ORACLE_HOME/dbs
    I dont want to create datafile at this path and also dont want to specify data file path in 'create table space' command.
    Is there is any parameter,which i can set and above command start to create dataFileName.dbf at that path
    Edited by: user8680179 on May 15, 2012 1:54 AM

    user8680179 wrote:
    i issued following commands from 'SYS' user;
    1. show parameter db_create_file_dest;
    NAME TYPE VALUE
    db_create_file_dest string
    2.alter system set db_create_file_dest='dataFilePath';
    System altered.
    3.show parameter db_create_file_dest;
    NAME TYPE VALUE
    db_create_file_dest string dataFilePath
    4.CREATE TABLESPACE testTbSpace2 DATAFILE 'test1.dbf' SIZE 50M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE 32767M NOLOGGING;
    Tablespace created.
    But still my test1.dbf file is creating at old path($ORACLE_HOME/dbs)Is datafilepath a real location? I don't think so! Give a proper path like "d:\oracle\" and retry.
    Aman....

  • Creating bank account use with API

    Hi everyone, I'm trying to create internal bank accounts with the given oracle API's but I'm stuck at a point that has me tearing my hair out. It is at the point where I create a bank account use.
    I saw a reference for a metalink note 948993.1 but I am unable to view this in metalink for whatever reason. It says the document has been deleted or I do not have access to it. Very unsure why this is the case.
    My API portion for this is:
    -- first set bank account use record type
    v_acct_use_rec.bank_account_id := v_acct_id;
    v_acct_use_rec.primary_flag := 'Y';
    v_acct_use_rec.org_type := 'LE';
    v_acct_use_rec.org_id := v_org_id;
    --v_acct_use_rec.org_party_id := v_account_owner_party_id;
    v_acct_use_rec.legal_entity_id := v_account_owner_org_id;
    v_acct_use_rec.ap_use_enable_flag := 'Y';
    v_acct_use_rec.ar_use_enable_flag := 'Y';
    v_acct_use_rec.xtr_use_enable_flag := 'N';
    v_acct_use_rec.pay_use_enable_flag := 'N';
    v_acct_use_rec.authorized_flag := 'Y';
    v_acct_use_rec.bank_charges_ccid := v_bank_charges;
    v_acct_use_rec.asset_code_combination_id := v_cash_acct;
    v_acct_use_rec.cash_clearing_ccid := v_cash_clearing_acct;
    v_acct_use_rec.receipt_clearing_ccid := v_conf_recpt_acct;
    v_acct_use_rec.unapplied_ccid := v_unapp_acct;
    v_acct_use_rec.unidentified_ccid := v_unident_acct;
    v_acct_use_rec.on_account_ccid := v_on_acct;
    v_acct_use_rec.edisc_receivables_trx_id := v_earned_trx_id;
    v_acct_use_rec.unedisc_receivables_trx_id := v_unearned_trx_id;
    -- then run API
    CE_BANK_PUB.create_bank_acct_use
    p_init_msg_list => fnd_api.g_true,
    p_acct_use_rec => v_acct_use_rec,
    x_acct_use_id => v_acct_use_id,
    x_return_status => v_return_status,
    x_msg_count => v_msg_count,
    x_msg_data => v_msg_data
    But I keep getting this error:
    Select treasury account use only when the access organization is legal entity
    Even though I have explicitly stated that I do not want to use xtr.
    Any help will be most welcome.
    Many thanks

    Can you check and see if the following document helps:
    R12 - How to Create an Internal Bank Account Access to Payables, Receivables and Treasury? [ID 1163205.1]
    The doc is functional in nature, however it may be of use since the issue looks similar.
    Hope this helps.
    Thanks and Regards
    Manish Jain.

  • Setting up a remote with ir-tables for use with XBMC

    My main goal is to use a remote with xbmc, but I'm having issues.
    Issue #1 (main problem): The directional keys and enter will work but no other keys seem to register.
    Issue #2: Even the keys that work have this weird usage issue, where pressing any of the same key twice loses the second key press. For example clicking up arrow 4 times results in only two actual "up's" being done. (first up works, second fails, third works, forth fails, etc)
    I've spent about four hours getting to this point and there is a lot of conflicting information out there on this subject which has had me very confused, but at this point I assume I can ignore any mention of Lirc as it seems like its not needed and if ir-keytable is used correctly things should just work?
    Quote from www.lirc.org: "Recent linux kernels make it possible to use some IR remote controls as regular input devices"
    What I have got/done:
    Machine: Zotac Zbox Nano AD10 with remote.
    Linux: Manjaro Openbox Addition
    Testing in applications: XBMC, Leafpad, Terminal
    [david@zotac ~]$ dmesg | grep CIR
    [    4.444693] ite_cir: Auto-detected model: ITE8704 CIR transceiver
    [    4.444701] ite_cir: Using model: ITE8704 CIR transceiver
    [    4.478490] input: ITE8704 CIR transceiver as /devices/virtual/rc/rc0/input8
    [    4.478531] rc0: ITE8704 CIR transceiver as /devices/virtual/rc/rc0
    [david@zotac ~]$ ir-keytable
    Found /sys/class/rc/rc0/ (/dev/input/event6) with:
            Driver ite-cir, table rc-rc6-mce
            Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
            Enabled protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
            Name: ITE8704 CIR transceiver
            bus: 25, vendor/product: 1283:0000, version: 0x0000
            Repeat delay = 500 ms, repeat period = 500 ms
    #My keymaps file contains (I just put the keys that I would like to use with xmbc)
    0x8034045b KEY_RIGHT
    0x8034045a KEY_LEFT
    0x8034045c KEY_ENTER
    0x80348459 KEY_DOWN
    0x80340458 KEY_UP
    0x80348421 KEY_R
    0x80340420 KEY_F
    0x80348410 KEY_EQUAL
    0x80348483 KEY_ESC
    0x80348431 KEY_X
    0x8034842f KEY_T
    0x803404cb KEY_I
    0x8034845d KEY_M
    0x8034042c KEY_P
    0x80340411 KEY_MINUS
    I write my keymaps file: (I think /etc/keymaps/[file] would be a better location for this file but it shouldn't matter is that correct?)
    ir-keytable -c -w /home/david/Documents/keymaps --device=/dev/input/event6 --period=500 --delay=500
    I can verify the settings are registered:
    [david@zotac ~]$ ir-keytable --read --device=/dev/input/event6
    scancode 0x80340411 = KEY_MINUS (0x0c)
    scancode 0x80340420 = KEY_F (0x21)
    scancode 0x8034042c = KEY_P (0x19)
    scancode 0x80340458 = KEY_UP (0x67)
    scancode 0x8034045a = KEY_LEFT (0x69)
    scancode 0x8034045b = KEY_RIGHT (0x6a)
    scancode 0x8034045c = KEY_ENTER (0x1c)
    scancode 0x803404cb = KEY_I (0x17)
    scancode 0x80348410 = KEY_EQUAL (0x0d)
    scancode 0x80348421 = KEY_R (0x13)
    scancode 0x8034842f = KEY_T (0x14)
    scancode 0x80348431 = KEY_X (0x2d)
    scancode 0x80348459 = KEY_DOWN (0x6c)
    scancode 0x8034845d = KEY_M (0x32)
    scancode 0x80348483 = KEY_ESC (0x01)
    At this point is seems like everything is setup correctly but like I said only the direction keys and return work. If it did work my next step would be determining when to issue the ir-keytable write, and I'm assuming I can just do that in openbox's autostart file?
    Does anyone have any ideas as to what I might do to correct these issues?

    I also encountered davevallance's issue #1.  Directional and enter keys already work, as do volume keys.  If any other button is mapped to those working keys (using ir-keytable) then they also work, for example I can successfully map the useless "teletext" to "enter" and it produces a linefeed when pressed but I cannot get it to do the same with "space".  Interestingly it does produce a space keypress in a virtual terminal (Ctrl+Alt+F3), also "ir-keytable -t" shows the correct key event which proves the underlying OS is recognising the mapping.  The issue is somewhere in the X system instead.
    I refer now to HID Remotes which covers the situation well.  It explains that X does not process keycodes above 255 and at first that would seem to fit here.  All the keys which work (arrows, enter, volume) have keycodes less than 255.  So why don't other 'safe' keycodes work too?
    Xorg has it's own keycode map with "xmodmap" but I don't think that is responsible in this case.  From the Arch wiki it suggests exploring with:
    xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
    Unmapped keys should produce a "NoSymbol" message but for my non-working keys there is no response at all in X.  Is there another layer between kernal and GUI?

  • How do I create multiple libraries & use with multiple ipods?

    Hi All,
    My wife and I have different tastes in music. Currently we use different user log ons to seperate our libraries. It's a complete pain because there's no other reason to use seperate log ons.
    We'll soon be upgrading to a new iMac and I'm wondering if it's possible to have two libraries operating in the one itunes sesssion?
    So here are my questions:
    1) Can I have two libraries sourcing the same music files?
    2) We each have an iPod, can it be set to only update one of those libraries, but still automatically update when connected?
    3) If we create playlists, will they be associated with only one library, or both (my preference is one, of course)?
    4) I'm pretty sure iPods can be set so my iPod only updates my playlists, and my wife's iPod only updates her playlists - is that correct?
    5) If we have seperate libraries, can we have seperate ratings? (Our opinion of what a five star song is is different)!
    Of course, for the above questions, if the answer is 'yes' please let me know how to do this. I've had a look through the itunes manuals online, but they don't seem to have any information.
    Cheers, Chris

    Chris,
    I have the exact same situation, and I have tried Doug's iTunes Library Manager, but it doesn't work for me. The first workaround I tried was to set up two smart playlists to group together any music that only one of us liked, which could then be checked or un-checked (control-click) depending on which iPod is being synced. This is clumsy, and if you aren't careful the Recently Added playlist will still "contaminate" your iPod.
    Last night I just made a new library for my wife (hold down Option when starting iTunes), copied everything over using the Add to Library command, exported all the playlists using the Export Library command, deleted all the music and playlists she doesn't want, and synced her iPod. It took a while to erase and re-sync, but it is now synced to HER library, and she doesn't see any music she doesn't like.
    Tonight I will do the same for myself. I will have, then, three libraries which can be selected by holding down the option key when starting iTunes: Mine, My wife's, and the main one with everything (called Library) All the music files stay on an external Firewire Drive. There is no way to toggle libraries from within iTunes, you have to quit and start it again holding down the option key.
    Podcasts are another story, and I haven't quite figured them out yet.
    Marty

  • Creating tables in scrip with box command

    Hi,
    Can anyone plese explain how to create a table in sap scripts using box command.
    I need 3 coloumns in the main window.
    1.Description
    2.Currency
    3.Amount
    Thanks,
    Smriti

    hi
    this makes you clear about BOX
    [http://help.sap.com/saphelp_45b/helpdata/en/65/897415dc4ad111950d0060b03c6b76/content.htm|http://help.sap.com/saphelp_45b/helpdata/en/65/897415dc4ad111950d0060b03c6b76/content.htm]
    Regards
    Sajid

  • How to create tables for using in SQL/php website

    Sorry for asking basic question because I 'm knew.
    i was building a dw site for listing multiple products. i was following DW, the Missing Manual book tutorials. The tutorial offers downloadable data tabels in a folder with .sql extension. I just cannot find anywhere an instruction as how the .sql folder is created.
    Second question: if it can be created in Access 2007, please tell me how.
    thank you sooo much.

    Hi Walt,
    Thank you so much for spending the time trying to answer me.
    you are right, it is a .sql file, not a folder. However, once it is imported into MySQL server, it spits out 4 tables. Please see the following tutorial steps:
    "4. in phpMyAdmin's top navigation bar, click the Import button.
    Doing so takes you to a page that lets you type in an SQL query or load a test file that has SQL commands in it. You'll do the latter-load a text file that contains all the SQL necessary to create the tables and data for the database.
    5. Click the Browse button in XAMPP (application software for SQL server), In the File Upload window that appears, navigate to and select the file cosmofarmer.sql in the php_dynamic folder you downloaded with the tutorial files.
    6. Click the Go button.
    The MySQL server slurps down the SQL file, and executes the instructions found within it. The results? Four new talbes are created (see the list of talbles that just appeared on the left side of the phpMyAdmin window) and a bunch of data is added to them. "
    The book I am reading explains everything but how the cosmofarmer.sql file was made.

  • Creating a view using With causes ORA-00600 Error

    Hello Ladies and Gents,
    I've been trying to deploy a recursive query as a view in Oracle XE and Standard Edition, neither to much success.
    The query is located in this question here: http://stackoverflow.com/questions/17358109/how-to-retrieve-all-recursive-children-of-parent-row-in-oracle-sq
    with recursion_view(base, parent_id, child_id, qty) as (
       -- first step, get rows to start with
       select
      parent_id base,
      parent_id,
      child_id,
      qty
      from
      md_boms
      union all
      -- subsequent steps
      select
       -- retain base value from previous level
      previous_level.base,
       -- get information from current level
      current_level.parent_id,
      current_level.child_id,
       -- accumulate sum
       (previous_level.qty + current_level.qty) as qty
      from
      recursion_view previous_level,
      md_boms current_level
      where
      current_level.parent_id = previous_level.child_id
    select
      base, parent_id, child_id, qty
    from
      recursion_view
    order by
      base, parent_id, child_id
    The query itself works and returns results. However, when I try to create a view with that query, I receive errors.
    I've posted two screenshots: http://www.williverstravels.com/JDev/Forums/StackOverflow/17358109/ViewError.jpg and http://www.williverstravels.com/JDev/Forums/StackOverflow/17358109/InternalError.jpg The first one with the ! and * is when I am using JDeveloper 11g, using the Database Navigator, right-click on View and select "New View". I receive the error when I click OK. I can indeed create the view through a sql script, but when I attempt to view the data, I receive the ORA_00600 error.
    I've tried this on both my local machine for XE (version 11.2.0.2.0) and on 11g Standard Edition (11.2.0.2.v6) via Amazon Web Services. The result is the same.
    Does anyone know how to get around this?

    Not 5 minutes after I post this, I decide not to use JDev's graphical editor, and simply write
    SELECT * FROM BOMS_VIEW;
    And it works like a charm.  I just can't use data tab to view the records in the editor.  Wish I had known that 5 hours ago.

  • Creating Table View's with more than one table

    I have two custom tables. 
    Table A has 2 fields:  Code and Description
    Table B has 4 fields:  Code, Country, Emp Group and Personnel Area
    I would like to build a view which has:  Code, Description, County, Emp Group and Personnel Area.  This view should be able to pull in the Description from Table A when the user enters in the Code.
    I have created a view with SE11 and have put both Table A and B with joins as follows:  A Code = B Code.  Under the view fields I have put the fields B.Code, A. Description, B.Country, B.Emp Group and B.Personnel Area.
    When I generate this view (Utilities, Table Maintenance Generator) it only shows the Code and Description field.  It does pull in the Description automatically which is great.  The issue is 2 things 1) The Description can be changed and 2) The other fields I specified above are not included on the view (e.g., Country etc.)
    Any ideas?

    I have checked several times that it is against the view as it is so strange that not all of the fields are appearing.
    I go into SE11, Click on View, Type in the View Name and then Change.  I goto into Utilities, Table Maintenance Generator and select it as one Step and then click on the Create Button.  When I go into SM30 I only see the 2 fields?

Maybe you are looking for