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

Similar Messages

  • 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;

  • 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

  • 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?

  • Created Table space datafile  with out .dbf Extenstion

    Hi all,
    by mistake I added a datafile to a table space with out .dbf extension..
    ALTER TABLESPACE "MEDIA" ADD DATAFILE 'L:\ORACLE\ORADATA\MEDIAGATA02' SIZE 100M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE 32767M
    I could not rename it unless I set this table space off line . But this is a production server so I could set as off-line.
    1. Will my database function normally or would crash!!!..
    2. with out .dbf extension will the table space function ?
    3. will the data store can be retried in any case of database crash?
    regards
    S.K

    Check the size of the tablespace, if there aren't any data then drop the tablespace and create a new one.
    Regards
    Asif Kabir

  • Create Table from XMLTable (with hierarchy)

    Hi,
    I've following XML File Structure:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <MenuSystem>
    <Definition>
    <Menue label="Main">
    <File label="A">
    <File label="B">
    <File label="C">
    <File label="D">
    <Prog label="first"/>
    <Prog label="second"/>
    <Prog label="third"/>
    </File>
    <File label="E">
    <Prog label="1"/>
    <Prog label="2"/>
    <Prog label="3"/>
    </File>
    </File>
    <File label="F">
    <File label="G">
    <Prog label="AA"/>
    <Prog label="BB"/>
    </File>
    <File label="H">
    <Prog label="CC"/>
    </File>
    File label="I">
    <Prog label="DD"/>
    <Prog label="EE"/>
    </File>
    </File>
    </File>
    </File>
    </Menue>
    </Definition>
    </MenuSystem>
    what I need is a sql query to get following columns:
    ID Parent_ID Tag Value
    1 0 Menue Main
    2 1 File A
    3 2 File B
    4 3 File C
    5 4 File D
    6 5 Prog first
    7 5 Prog second

    You mean instead of "1", "1.1", "1.2" etc. ?
    The XSLT solution described in the link does that (pretty much), you just have to remove the leading "K".
    Using XQuery, it's feasible too, but retrieving the node ID adds a little complexity :
    SQL> SELECT x.*
      2  FROM temp_xml t
      3     , XMLTable(
      4       'declare function local:getChildren($e as node(), $pID as xs:integer?) as element()*
      5        {
      6          for $i in $e/child::*
      7          let $ID := (for $j at $p in $d/MenuSystem/Definition/descendant::* where $j is $i return $p)
      8          return element r
      9          {
    10            element node_id {$ID}
    11          , element parent_node_id {$pID}
    12          , element node_name {name($i)}
    13          , element node_value {data($i/@label)}
    14          }
    15          | local:getChildren($i,$ID)
    16        }; (: :)
    17        local:getChildren($d/MenuSystem/Definition,())'
    18        passing t.doc as "d"
    19        columns node_id         number        path 'node_id'
    20              , node_name       varchar2(15)  path 'node_name'
    21              , node_value      varchar2(30)  path 'node_value'
    22              , parent_node_id  number        path 'parent_node_id'
    23       ) x
    24  ;
       NODE_ID NODE_NAME       NODE_VALUE                     PARENT_NODE_ID
             1 Menue           Main                          
             2 File            A                                           1
             3 File            B                                           2
             4 File            C                                           3
             5 File            D                                           4
             6 Prog            first                                       5
             7 Prog            second                                      5
             8 Prog            third                                       5
             9 File            E                                           4
            10 Prog            1                                           9
            11 Prog            2                                           9
            12 Prog            3                                           9
            13 File            F                                           3
            14 File            G                                          13
            15 Prog            AA                                         14
            16 Prog            BB                                         14
            17 File            H                                          13
            18 Prog            CC                                         17
            19 File            I                                          13
            20 Prog            DD                                         19
            21 Prog            EE                                         19
    21 rows selected

  • OID users ( EUS) problem with grant create table with admin

    Hi,
    We activated enterprise users in the OID.
    There is a role APP_ADMIN that has the following grants:
    create user
    drop user
    create table with admin option
    this is for an application that creates BI schemas, so it needs to be able to create other users.
    I have granted these to a local role, and the user has access to the local role, thanks to the OID setup.
    The create and drop user work.
    however, the grant create table to another user does not work.
    Is there an issue with 'with admin option' grants in Enterprise user security?
    Regards,
    Peter

    If I grant
    grant create table to test_role with admin option;
    it does not work
    if I grant
    GRANT GRANT ANY PRIVILEGE to test_role WITH ADMIN OPTION;
    it does work.
    The test command as user with test_role is:
    grant create table to test_usr;
    very strange!
    If the user is a standard user and I create role test_role
    and grant create table to test_role with admin option it works.
    but if I convert the user to an EUS user and the same privilege is given to the role ( role is granted to a global role to an enterprise role)
    it doesnt work
    Edited by: Peter on Dec 7, 2012 2:36 PM

  • BOX Command in Smartforms

    Guyz,
    My situation is i have main window which is having 2 columns ...
    1st - invoice line item text
    2nd - invoice line item value
    requriement is i'll have to print a vertical line after the 1st column (inv line itemtext) which should draw through out the main window.
    Firstly - I tried with BOX Command (BOX XPOS 3.00 CM WIDTH 5.00 CM FRAME 10 TW) inside the MAIN Widnow and inside a text element which is not working to my surprise.  MAIN WINDOW  height = 11,80 cm width = 18,16 cm ...SO I'M SURE ABOVE BOX COMMAND SHOULD FIT INTO THIS WINDOW DIMENSIONS but nothing is being printed ?
    Secondly -- As i'm using internal table for priting whole MAIN Window i tried using patterns (framed pattern having one line after first column)... initial look at this pattern made me happier but to my disappointment it didn't work i.e., though it's pritning vertical line it's not printing through out the main window. Say if we have just one row to print vertical line just spans the first row but I WANT VERTICAL LINE TO BE PRINTED THROUGH OUT THE MAIN WINDOW.
    Any suggestions pls ?
    Thanks in advance
    SK

    Sreedhar,
    In SMART Forms you cannot have a line / box unless there is a element.
    What you can do is CREATE a TEMPLATE object and select the pattern. But with template and TABLE inside that formatting of the data will be difficult.
    This link might be useful for you.
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    See the demo programs and smartforms SF_EXAMPLE_*
    Regards,
    Ravi
    Note : PLease mark the helpful answers

  • Insert, select and create table as give different results

    Hi all
    I have a strange situation with this three cases:
    1) select statement: SELECT (...)
    2) insert statement with that same select as above: INSERT INTO SELECT (...)
    3) create table statement again with that same select: CREATE TABLE AS SELECT (...)
    Each of these cases produce different number of rows (first one 24, second 108 and third 58). What's more the data for second and third case doesn't have any sense with what they should return. The first case returns good results.
    One interesting thing is that select uses "UNION ALL" between 2 queries. When simple UNION is used, everything works fine and all three cases return 24 rows. Also if each query is run seaprately, they work fine.
    Anyone encountered something like this? (before i create an SR :)
    Database is 10.2.0.2 on AIX 5.3. It's a data warehouse.
    Edited by: dsmoljanovic on Dec 10, 2008 3:57 PM

    I understand UNION vs UNION ALL. But that doesn't change the fact that same SELECT should return same set of rows wether in INSERT, CREATE TABLE AS or a simple SELECT.
    DB version is 10.2.0.2.
    Here is the SQL:
    INSERT INTO TMP_TRADING_PROM_BM_OSTALO
    select
    5 AS VRSTA_PLANIRANJA_KLJUC, u1.UNOS_KLJUC, t1.TRADING_TIP_KLJUC, i1.IZVOR_KLJUC, m1.ITEMNAME AS MJESEC,
    l1.PLAN AS IZNOS, l1.TEKUA AS TEKUCA, l1.PROLA AS PROSLA, l1.PLANTEKUA_ AS IZNOS_TEKUCA, l1.PLANPROLA_ AS IZNOS_PROSLA, l1.TEKUAPROLA_ AS TEKUCA_PROSLA, l1.DATUM_UCITAVANJA
    from
    HR_SP_PLAN.L_12_ET_PROMETI_I_BRUTO_MARZA l1,
    select
    m1.ITEMIID, m1.ITEMNAME
    from
    HR_SP_PLAN.L_12_IT_4_MJESECI m1
    where
    UPPER (m1.ITEMNAME) NOT LIKE '%KVARTAL%' AND UPPER (m1.ITEMNAME) NOT LIKE '%GODINA%' AND UPPER (m1.ITEMNAME) NOT LIKE '%PROC%' and
    m1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy')
    union all
    select -99, null from dual
    ) m1,
    HR_SP_PLAN.L_12_IT_5_SEKTORI l2,
    HR_SP_PLAN.L_12_IT_2_TIPOVI_OSTALO l3, HR_SP_PLAN.D_UNOS u1, HR_SP_PLAN.D_TRADING_TIP t1, HR_SP_PLAN.L_12_IT_1_PROMET_I_BM_OSTALO p1, HR_SP_PLAN.D_IZVOR i1
    where
    l1.ELIST = l2.ITEMIID and
    l2.ITEMNAME = u1.UNOS_NAZIV and u1.USER_KLJUC = 12 and l2.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DIMENSION_1_PROMET = p1.ITEMIID and
    p1.ITEMNAME = i1.IZVOR_NAZIV and i1.USER_KLJUC = 12 and p1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    nvl(l1.DIMENSION_4_MJESEC , -99) = m1.ITEMIID and
    l1.DIMENSION_2_TIPOVI = l3.ITEMIID and
    l3.ITEMNAME = t1.TRADING_TIP_NAZIV and l3.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    'PROC' = 'PLAN'
    union all
    select
    4 AS VRSTA_PLANIRANJA_KLJUC, u1.UNOS_KLJUC, t1.TRADING_TIP_KLJUC, i1.IZVOR_KLJUC, m1.ITEMNAME AS MJESEC,
    l1.PROCJENA AS IZNOS, l1.TEKUA AS TEKUCA, l1.PROLA AS PROSLA, l1.PROCJENATEKUA_ AS IZNOS_TEKUCA, l1.PROCJENAPROLA_ AS IZNOS_PROSLA, l1.TEKUAPROLA_ AS TEKUCA_PROSLA, l1.DATUM_UCITAVANJA
    from
    HR_SP_PLAN.L_13_ET_PROMETI_I_BRUTO_MARZA l1,
    select
    m1.ITEMIID, m1.ITEMNAME
    from
    HR_SP_PLAN.L_13_IT_4_MJESECI m1
    where
    UPPER (m1.ITEMNAME) NOT LIKE '%KVARTAL%' AND UPPER (m1.ITEMNAME) NOT LIKE '%GODINA%' AND UPPER (m1.ITEMNAME) NOT LIKE '%PROC%' and
    nvl(ceil(to_number(m1.ITEMNAME)/3), mod(4, 5)) = mod(4, 5) and m1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy')
    union all
    select -99, null from dual
    ) m1,
    HR_SP_PLAN.L_13_IT_5_SEKTORI l2, HR_SP_PLAN.L_13_IT_2_TIPOVI_OSTALO l3,
    HR_SP_PLAN.D_UNOS u1, HR_SP_PLAN.D_TRADING_TIP t1,
    HR_SP_PLAN.L_13_IT_1_PROMET_I_BM_OSTALO p1, HR_SP_PLAN.D_IZVOR i1
    where
    l1.ELIST = l2.ITEMIID and
    l2.ITEMNAME = u1.UNOS_NAZIV and u1.USER_KLJUC = 13 and l2.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DIMENSION_1_PROMET = p1.ITEMIID and
    p1.ITEMNAME = i1.IZVOR_NAZIV and i1.USER_KLJUC = 13 and p1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    nvl(l1.DIMENSION_4_MJESEC , -99) = m1.ITEMIID and
    l1.DIMENSION_2_TIPOVI = l3.ITEMIID and
    l3.ITEMNAME = t1.TRADING_TIP_NAZIV and l3.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    l1.DATUM_UCITAVANJA = to_date('24.11.2008','dd.mm.yyyy') and
    'PROC' = 'PROC';

  • I don't see the table I had create with the command line

    hi ,
    I just install sql developer, and connect to mydatabase, but I see a lot of tables who are not mine, but I don't see the one I have created. so could you tell me haow t make my tables to appear. or if I have to recreate them with wich command in sql developer? thanks

    Stranger.
    You do not need to recreate tables in the SQL Developer.
    The tables that you created and that they are in the database must be visualized, in accordance with the permissions.
    You are connected to the SQL Developer with the same user that created the table (owner)?
    The table that you desire to see appears below in the result of the command?
    select * from user_tables;

  • 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....

  • Using EXECUTE IMMEDIATE with Create Table SQL Statement not working

    Hi ,
    I am all the privileges given from the SYSTEM user , but still i am not able to create a table under procedure . Please see these and advice.
    create or replace procedure sp_dummy as
    begin
    Execute Immediate 'Create table Dummy99_99 (Dummy_Field number)';
    end;
    even i tried this way also
    create or replace PROCEDURE clearing_Practise(p_file_id in varchar2, p_country in VARCHAR2,p_mapId in VARCHAR2)
    AUTHID CURRENT_USER AS
    strStatusCode VARCHAR2(6);
    BEGIN
    EXECUTE IMMEDIATE 'create table bonus(name varchar2(50))';
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR Creating Table');
    END ;

    William Robertson wrote:
    Since the syntax is correct, my guess is you do not have CREATE TABLE system privilege granted directly to your account. A common scenario is that you have this privilege granted indirectly via a role, allowing you to create tables on the command line, but stored PL/SQL is stricter and requires a direct grant and therefore the procedure fails with 'insufficient privileges'.A bit like he's already been told on his first thread...
    Using of Execute Immediate in Oracle PLSQL
    Generally you would not create tables from stored PL/SQL. Also as you have found out, it's best not to hide exceptions with 'WHEN OTHERS THEN [some message which gives less detail than the one generated by Oracle]'.Again like he was told on the other thread.
    There's just no telling some people eh! :)

  • ORA-00942 when creating external table under 10g with AQ

    I have an application that runs with AQ. The front-end queues up batch-type
    tasks in a queue. When one particular kind of message is dequeued, it
    initiates a data load. That load requires the creation of an external
    table.
    The schema in question is owned by user BL (bulkload). The queue
    is owned by BLB (bulkload batch), primarily to simplify some of the
    rules needed by the resource manager in order to limit the total CPU
    a batch process can consume. The BLB user has full access to the
    BL schema, along with the following rights:
    CREATE TYPE
    CREATE TABLE
    CREATE SEQUENCE
    CREATE PROCEDURE
    CREATE VIEW
    CREATE SYNONYM
    CREATE SEQUENCE
    ALTER SESSION
    CREATE SESSION
    QUERY REWRITE
    CREATE ANY CONTEXT
    EXECUTE_CATALOG_ROLE
    CREATE MATERIALIZED VIEW
    CREATE ANY DIRECTORY
    DROP ANY DIRECTORY
    The table creation works fine under 9.2.0.8 (our current required
    version). However the application generates an ORA-00942 table or view does
    not exist when run under 10g (10.2.0.1 and 10.2.0.3).
    The following statement is the problem:
    CREATE TABLE bulkload33 (
              field1 VARCHAR2(2000),field2 VARCHAR2(2000),field3 VARCHAR2(2000))
              ORGANIZATION EXTERNAL (
              TYPE oracle_loader DEFAULT DIRECTORY EXT_100
              ACCESS PARAMETERS ( RECORDS DELIMITED BY "\r\n"
              CHARACTERSET 'WE8ISO8859P1'
              BADFILE EXT_100:'bulkload_bad.csv'
              LOGFILE EXT_100:'bulkload_log.csv'
              FIELDS TERMINATED BY ','
              OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (
              field1 CHAR(2000),field2 CHAR(2000),field3 CHAR(2000),field4 CHAR(2000)))
              LOCATION ('bulkload.csv')
              ) REJECT LIMIT UNLIMITED PARALLEL;
    To clarify, the preceding statement, when handled by the process
    for a queue message, failes with an ORA-00942.
    Note that I can issue the command directly, as BLB or SYS, against
    the BL schema with no problems. Further, as user BLB or SYS, I can do
    the following:
    CREATE OR REPLACE PROCEDURE dotest
    IS
         l_sql varchar2(2000);
    BEGIN
         l_sql := 'CREATE TABLE bulkload33 (
              field1 VARCHAR2(2000),field2 VARCHAR2(2000),field3 VARCHAR2(2000))
              ORGANIZATION EXTERNAL (
              TYPE oracle_loader DEFAULT DIRECTORY EXT_100
              ACCESS PARAMETERS ( RECORDS DELIMITED BY "\r\n"
              CHARACTERSET ''WE8ISO8859P1''
              BADFILE EXT_100:''bulkload_bad.csv''
              LOGFILE EXT_100:''bulkload_log.csv''
              FIELDS TERMINATED BY '',''
              OPTIONALLY ENCLOSED BY ''"'' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (
              field1 CHAR(2000),field2 CHAR(2000),field3 CHAR(2000),field4 CHAR(2000)))
              LOCATION (''bulkload.csv'')
              ) REJECT LIMIT UNLIMITED PARALLEL';
         EXECUTE IMMEDIATE l_sql;
    END;
    show errors
    EXEC dotest
    Does anyone have any ideas of why this doesn't work under 10g? Metalink
    has yielded no clues so far.
    Thanks.

    Define "has full access to the BL schema" given that it is impossible to grant access rights, in Oracle, by schema. What was done and how was it done?
    My guess is that the privs were granted in a role, rather than explicitly, as is required for PL/SQL.

  • Error ORA-01426: numeric overflow when Creating table with double data type

    Hi,
    I am using ODP.NET to create a table with data from SQL to Oracle. The problem is with double data type fields that is equivalent to FLOAT(49) in Oracle. My syntax is:
    CREATE TABLE SCOTT.ALLTYPES
    F1 NUMBER(10),
    F10 DATE,
    F2 NUMBER(10),
    F3 NUMBER(5),
    F4 NUMBER(3),
    F5 FLOAT(23),
    F6 FLOAT(49),
    F7 NUMBER (38,5),
    F8 NVARCHAR2(500),
    F9 NVARCHAR2(500)
    Th error is with field F6 but I am not sure what is the correct type equivalent to double in SQL.
    I woul appreciate if anyone can help me with this problem.
    Sunny

    Does this simple test work for you?
    In database:
    create table float_test
      f1 float(49)
    );C# code:
    using System;
    using System.Data;
    using System.Text;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace FloatTest
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      class Class1
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
          // connect to local db using o/s authenticated account
          OracleConnection con = new OracleConnection("User Id=/");
          con.Open();
          // will hold the value to insert
          StringBuilder sbValue = new StringBuilder();
          // create a string of 49 number 9's
          for (int i = 0; i < 49; i++)
            sbValue.Append("9");
          // command object to perform the insert
          OracleCommand cmd = con.CreateCommand();
          cmd.CommandText = "insert into float_test values (:1)";
          // bind variable for the value to be inserted
          OracleParameter p_value = new OracleParameter();
          p_value.OracleDbType = OracleDbType.Double;
          p_value.Value = Convert.ToDouble(sbValue.ToString());
          // add parameter to collection
          cmd.Parameters.Add(p_value);
          // execute the insert operation
          cmd.ExecuteNonQuery();
          // clean up
          p_value.Dispose();
          cmd.Dispose();
          con.Dispose();
    }SQL*Plus after executing above code:
    SQL> select * from float_test;
            F1
    1.0000E+49
    1 row selected.- Mark

  • How to create table with variable

    hi,
    i m to create many table with same starting name but last name would be vary like
    i m to create table test121 and test122 and so on
    i want to set name test then any given number by variable so i can create many table.
    so how to add it in create table command.
    i tried create table test||:var (column names) but it didnt work.
    so plz suggest me how to do it ?
    thxs

    Actually this is good.
    It has nothing to do with database design. A database is not a garbage bin.
    You need to do several things
    a) make sure your design is normalized so you don't have identical tables.
    b) In future posts specify a platform and a version and the tool you are using to create the table
    c) if the tool is sql*plus learn about substitution variables aka DEFINEs.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for