SLT - Splitting one source table into two tables in the destination

Hi,
I am wondering if we can split content of one source table into two different tables in the destination (HANA DB in my case) with SLT based on the codified mapping rules?
We have the VBAK table in ERP which has the header information about various business objects (quote, sales order, invoice, outbound delivery to name a few). I want this to be replicated into tables specific to business object (like VBAK_QUOT, VBAK_SO, VBAK_INV, etc) based on document type column.
There is one way to do it as far as i know - have multiple configurations and replicate to different schema. But we might have to be content with 4 different config at the max.
Any help here will be highly appreciated
Regards,
Sesh

Please take a look at these links related to your query.
http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers
http://stackoverflow.com/questions/7037228/joining-two-tables-together-in-one-database

Similar Messages

  • Split one salesorder item into two items in delivery

    We want to split one salesorder item into two different items in the same delivery.
    This is because we will pick the material from two different storage locations.
    Any user-exit to use for solving this?
    Best regards,
    Terje

    Hi,
    We are not using batch management.
    I have looked into the foreign trade/customs standard functionality in SAP, but I can not see that them difference in stock in SAP what is duty paid or not.
    We need to have documentation in the system for the custom goverement for what stock is duty paid and not.
    For the same material we can have stock which are duty paid and not duty paid. This is decided when we do the goods receipt.
    For stock coming from Asia, it is profitable to have this on not duty paid stock since we are exporting it back to Europe and Asia later.
    We will send import and export EDI messages to a third party custom application handling all the papers with the custom goverement.
    The only we need to make track on in SAP is the stock for what is duty paid and not.
    In some situations we need to take stock from both duty paid stock and not duty paid stock when we deliver the same material to a customer. Therefor I asked the question of splitting one delivery item into two items.
    Best regards,
    Terje

  • Stored Procedure - Split one Input Paramater into two Paramater

    What is expected from me
    1) I am getting a input parameter as a string (url+id)with two delimiters(, and |) i.e 'html\abc.com,http\efc.com|112'
    Logic: If ID is not in the table or if ID is not there in input parameter then return null
    else
    send ID and URL from the table
    The way I am tackling aforesaid as I am new in Oracle PL/SQL
    1) I have two separate split function one to tackle , (comma) other to tackle |(pipe) which i got from NET
    2) I am creating 2 table with 2 columns (ID(identity),val)
    3) I am splitting input parameter and pushing result in first table where ID will always be second record
    so if count(*) = 1
    then return nothing (as there is no ID to map in the table)
    else
    4) splitting first row and pushing result in second table and then mapping with the table if its there then returning the val back...
    Here is the code Please let me know where i am going wrong?? where i have to correct??
    CREATE OR REPLACE
    PROCEDURE ap_dbi_ps_PM_Search
    v_PAGE_CTX IN VARCHAR2,
    v_CTX_ID IN NUMBER DEFAULT NULL ,
    v_Count IN NUMBER DEFAULT NULL ,
    cv_1 IN OUT SYS_REFCURSOR )
    AS
    ---tblPM table 2 columns id (idendity) and val
    CREATE SEQUENCE tb1PM_id START WITH 1 INCREMENT BY 1;
    CREATE TABLE tb1PM
    ( id NUMBER(10,0) PRIMARY KEY, Val VARCHAR2(400)
    CREATE OR REPLACE TRIGGER tb1PM_id_TRG BEFORE
    INSERT ON tb1PM FOR EACH ROW BEGIN
    SELECT tb1PM_id.NEXTVAL INTO :NEW.id FROM DUAL;
    END;
    -- tblPM1 table 2 columns id (idendity) and val
    CREATE SEQUENCE tb1PM1_id START WITH 1 INCREMENT BY 1;
    CREATE TABLE tb1PM1
    ( id NUMBER(10,0) PRIMARY KEY, Val VARCHAR2(400)
    CREATE OR REPLACE TRIGGER tb1PM1_id_TRG BEFORE
    INSERT ON tb1PM1 FOR EACH ROW BEGIN
    SELECT tb1PM1_id.NEXTVAL INTO :NEW.id FROM DUAL;
    END;
    --Split the input paramater and push result in tblPM*
    INSERT
    INTO tb1PM
    val
    (SELECT * FROM TABLE ( CAST(split('v_PAGE_CTX') AS split_tbl))
    DECLARE
    v_Count NUMBER
    10,0
    DECLARE
    V_CTX_ID NUMBER
    10,0
    SET V_CTX_ID =
    (SELECT DISTINCT TO_NUMBER(val) FROM tb1PM WHERE id = 2
    SET v_Count =
    (SELECT COUNT(*) FROM tb1PM
    BEGIN
    IF v_Count = 2 THEN
    INSERT
    --Split URL's from tblPM*
    INTO tb1PM1
    val
    (SELECT *
    FROM TABLE(splitcomma(
    JOIN(CURSOR
    (SELECT val FROM tb1PM WHERE id =1
    OPEN cv_1 FOR SELECT PAGE_DISPLAY_URL,
    CTX_ID FROM portal_mapping WHERE CTX_ID = V_CTX_ID group by V_CTX_ID HAVING v_PAGE_DISPLAY_URL IN
    ( SELECT DISTINCT val FROM tb1PM1
    RETURN;
    DROP TABLE tb1PM;
    DROP TRIGGER tb1PM_id_TRG;
    DROP SEQUENCE tb1PM_id;
    DROP TABLE tb1PM1;
    DROP TRIGGER tb1PM1_id_TRG;
    DROP SEQUENCE tb1PM1_id;
    ELSE
    EXCEPTION
    WHEN OTHERS THEN
    -- NULL;
    END IF;
    END;
    show errors;
    ERROR which I am getting is
    Warning: execution completed with warning
    PROCEDURE ap_dbi_ps_PM_Search Compiled.
    24/1 PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
    begin function pragma procedure subtype type <an identifier>
    <a double-quoted delimited-identifier> current cursor delete
    exists prior external language

    You have to learn how to write the procedure before you could write one. I just corrected the syntax errors. I did not paid attention to your logical errors. This one compiled without errors other than the table does not exists. My doubt is If you are creating the tables in the procedure, how will the tables already have data?
    CREATE OR REPLACE PROCEDURE ap_dbi_ps_PM_Search ( v_PAGE_CTX IN VARCHAR2, v_CTX_ID IN NUMBER DEFAULT NULL , v_Count IN NUMBER DEFAULT NULL , cv_1 IN OUT SYS_REFCURSOR )
    AS
    BEGIN
    ---tblPM table 2 columns id (idendity) and val
    execute immediate 'CREATE SEQUENCE tb1PM_id START WITH 1 INCREMENT BY 1';
    execute immediate 'CREATE TABLE tb1PM ( id NUMBER(10,0) PRIMARY KEY, Val VARCHAR2(400) )';
    execute immediate ' CREATE OR REPLACE TRIGGER tb1PM_id_TRG BEFORE INSERT ON tb1PM FOR EACH ROW BEGIN  SELECT tb1PM_id.NEXTVAL INTO :NEW.id FROM DUAL; END';
    -- tblPM1 table 2 columns id (idendity) and val
    execute immediate 'CREATE SEQUENCE tb1PM1_id START WITH 1 INCREMENT BY 1';
    execute immediate 'CREATE TABLE tb1PM1 ( id NUMBER(10,0) PRIMARY KEY, Val VARCHAR2(400) )';
    execute immediate 'CREATE OR REPLACE TRIGGER tb1PM1_id_TRG BEFORE INSERT ON tb1PM1 FOR EACH ROW BEGIN SELECT tb1PM1_id.NEXTVAL INTO :NEW.id FROM DUAL; END';
    --Split the input paramater and push result in tblPM
    execute immediate 'INSERT INTO tb1PM ( val ) (SELECT * FROM TABLE ( CAST(split( ''v_PAGE_CTX '') AS split_tbl)) )';
    -- SET V_CTX_ID = (SELECT DISTINCT TO_NUMBER(val) FROM tb1PM WHERE id = 2 ) ;
    select distinct to_number(val)  into v_ctx_id from tb1PM where id = 2;
    -- SET v_Count = (SELECT COUNT(*) FROM tb1PM ) ;
    select count(*) into v_count from tb1PM;
    IF v_Count = 2 THEN
    INSERT INTO tb1PM1 ( val )
        (SELECT * FROM TABLE(splitcomma( JOIN(CURSOR (SELECT val FROM tb1PM WHERE id =1 ) ) ) ) );
    OPEN cv_1 FOR SELECT PAGE_DISPLAY_URL, CTX_ID FROM portal_mapping WHERE CTX_ID = V_CTX_ID group by V_CTX_ID HAVING v_PAGE_DISPLAY_URL IN
        ( SELECT DISTINCT val FROM tb1PM1 );
    RETURN;
    END IF;
    END;
    EXCEPTION
    WHEN OTHERS THEN
      DROP TABLE tb1PM;
      DROP TRIGGER tb1PM_id_TRG;
      DROP SEQUENCE tb1PM_id;
      DROP TABLE tb1PM1;
      DROP TRIGGER tb1PM1_id_TRG;
      DROP SEQUENCE tb1PM1_id;
    END;

  • Split one column value into two columns using t-sql

    Hi All,
    I have one varchar column in a table.
    Col1
    ABC-12C4
    BC-A345
    CD
    XYZ
    How to split this into two columns like this using t-sql
    Col1   Col2
    ABC    12C4
    BC      A345
    CD     
    XYZ
    Thanks,
    RH
    sql

    assuming a static delimiter, and the split will end up with a max of 2 columns, something like this would work.  basically you just need to determine where the delimiter is, and then use the left and right functions to find the 2 pieces.
    declare @t table(value varchar(10))
    insert into @t(value)
    values
    ('ABC-12C4'), ('BC-A345'), ('CD'), ('XYZ')
    select
    case
    when charindex('-', value) != 0 then left(value, charindex('-', value) - 1)
    else value
    end as col1,
    case
    when charindex('-', value) != 0 then right(value, len(value) - charindex('-', value))
    else ''
    end as col2
    from @t

  • How do I split one Apple account into two accounts?

    I have 2 iphones using one Apple ID.  The apps are completely different on the 2 phones (wife's stuff, my stuff).  I would like to split them into two Apple ID's so I can keep them completely separate.  Any ideas?

    Sorry, but there is no way to "move" an app from one iTunes Store account to another.
    Regards.

  • Splitting one photo book into two?

    Hi, I have prepared one photo book (project) with iPhoto using the maximum of 100 pages (3 weeks US!!). Now, a friend shared his pics with me that I'd like to add. Can I split the one book in two with say 50 pages and continue addingnew pages with the spliited ones?
    Plus: Can I move complete pages from one iPhoto book to another project (book)?
    Thx for your help!
    Frank

    Select the book in the left hand pane and type Command+D (duplicate).  You can then modify each of the copies as needed.
    OT

  • Split one PI System into two new PI systems

    Hello,
    I support one PI System from our company.
    My company would be splitted into 2 new companies.
    My Question about the PI system:
    Alternative 1:
    I will be crate 2 new PI Systems (one for company 1 and one for company 2)
    - I will be move the content from IR and ID to the new Systems (File Level Transport or CMS).
    - Is it possible, to move the messages and the payload of the processed messages (from the past) with the archive function ??
    Alternative 2:
    I use the existing PI system and dont create 2 new PI systems.
    - could I measure the PI traffic for the new company one and the new company two  separately ?? (I will be use differnt message interface names for any company)
    Whats the better way (alternative 1 or alternative 2) ?
    Thank you in advance
    Uwe

    Hi,
    We can create two PI systems for new companies but configure SLD centrally so that we can work/configure SLD objects easily for three systems. meanwhile configure IR/ID objects separately for each system for data flow variation. Meanwhile IR/ID objects we can import/export easily with IR/ID windows import/export option.

  • Possible to split one large pdf into multiple pages (in the same pdf?)

    I have some well logs that have been scanned - problem is they're coming is as one loooong page in the pdf.  Is it possible to split it up into several 8.5 x 11 pages within Acrobat, or do I need special software?

    Depends on what you have and the amount of length (a time issue). The simplest way is to use the crop tool to get a page worth and save it, then repeat for the next page, etc. Once all the pages are saved, you can put them back together. You should then use redax or such (print to a new PDF in a pinch) to remove the cropped portions. As I said, this is a bit time consuming, but can do the job. There are likely quicker ways and possibly some 3 party products that can do the job also.

  • Oracle rownum usage for splitting a Table into two equal parts.

    Hi All,
    I have a table which has like 1.2 billion records and i would have to split the table in two parts for my Archiving needs.Unfortunately that table does not have any unique key or primary key or data stamp which i can rely for.
    I would have to use the rownum concept to divide the table.
    I am using the below
    SELECT * FROM (SELECT ENAME, SAL FROM EMP ORDER BY SAL DESC) WHERE ROWNUM < 5000000;
    But the problem is that the table is taking forever to retrieve as it has to do a order by and then retrieve the data as per the where clause.
    The question i have is that instead of using a orderby clause to get the same rownum for the row every time, can i directly rely on the fact that the database is read only and the Rownum would remain same even without oder by clause....
    Thanks....

    WARNING! There is a bug in the code, see EDIT: at bottom of post for details
    Justin,
    It makes sense that Oracle could order over rowid without sorting, but I see a sort in the explain plan:
    SQL> create table t as select 1 as data
      2  from all_objects
      3  where rownum <= 100000;
    Table created.
    SQL> explain plan for select *
      2  from (select t.*, row_number() over (order by rowid) rn from t)
      3  where rn < 50000;
    Explained.
    SQL> select * from table(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 327232321
    | Id  | Operation                | Name | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |      | 99651 |  2530K|       |   489   (3)| 00:00:07 |
    |*  1 |  VIEW                    |      | 99651 |  2530K|       |   489   (3)| 00:00:07 |
    |*  2 |   WINDOW SORT PUSHED RANK|      | 99651 |  2432K|  7056K|   489   (3)| 00:00:07 |
    |   3 |    TABLE ACCESS FULL     | T    | 99651 |  2432K|       |    31   (7)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN"<50000)
       2 - filter(ROW_NUMBER() OVER ( ORDER BY ROWID)<50000)875820,
    What are you doing with the results of the select to archive the table in two pieces? If the archive is in the DB in two seperate tables, multi table insert would be an option:
    SQL> create table archive_1 (data number);
    Table created.
    SQL> create table archive_2 (data number);
    Table created.
    SQL> explain plan for insert when mod(rn, 2) = 0 then into archive_2 (data) values (data)
      2  else into archive_1 (data) values(data)
      3  select rownum as rn, data
      4  from t;
    Explained.
    SQL> select * from table(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 828723766
    | Id  | Operation             | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | INSERT STATEMENT      |           | 99651 |  2530K|    31   (7)| 00:00:01 |
    |   1 |  MULTI-TABLE INSERT   |           |       |       |            |          |
    |   2 |   INTO                | ARCHIVE_2 |       |       |            |          |
    |   3 |   INTO                | ARCHIVE_1 |       |       |            |          |
    |   4 |    VIEW               |           | 99651 |  2530K|    31   (7)| 00:00:01 |
    |   5 |     COUNT             |           |       |       |            |          |
    |   6 |      TABLE ACCESS FULL| T         | 99651 |  1265K|    31   (7)| 00:00:01 |
    SQL> insert when mod(rn, 2) = 0 then into archive_2 (data) values (data)
      2  else into archive_1 (data) values(data)
      3  select rownum as rn, data
      4  from t;
    100000 rows created.Another option would be to use the last digit of rowid to split the table into two groups, but they will not be equal sized.
    SQL> explain plan for select *
      2  from t
      3  where substr(rowid, length(rowid), 1) = upper(substr(rowid, length(rowid), 1))
      4  or substr(rowid, length(rowid), 1) in ('0', '1', '2', '3', '4');
    Explained.
    SQL> select * from table(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2153619298
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      | 59025 |  1441K|    98  (71)| 00:00:02 |
    |*  1 |  TABLE ACCESS FULL| T    | 59025 |  1441K|    98  (71)| 00:00:02 |
    Predicate Information (identified by operation id):
       1 - filter(SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='0
                  ' OR SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='1' OR
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='2' OR
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='3' OR
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)='4' OR
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)=UPPER(SUBSTR(ROW
                  IDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)))
    Note
       - dynamic sampling used for this statement
    23 rows selected.
    SQL> explain plan for select *
      2  from t
      3  where substr(rowid, length(rowid), 1) <> upper(substr(rowid, length(rowid), 1))
      4  and substr(rowid, length(rowid), 1) not in ('0', '1', '2', '3', '4');
    Explained.
    SQL> select * from table(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2153619298
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      | 40627 |   991K|    41  (30)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T    | 40627 |   991K|    41  (30)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter(SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'
                  0' AND SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'1' AND
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'2' AND
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'3' AND
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>'4' AND
                  SUBSTR(ROWIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)<>UPPER(SUBSTR(RO
                  WIDTOCHAR(ROWID),LENGTH(ROWIDTOCHAR(ROWID)),1)))
    Note
       - dynamic sampling used for this statement
    23 rows selected.
    SQL> select count(*)
      2  from t
      3  where substr(rowid, length(rowid), 1) = upper(substr(rowid, length(rowid), 1))
      4  or substr(rowid, length(rowid), 1) in ('0', '1', '2', '3', '4');
      COUNT(*)
         59242
    SQL> select count(*)
      2  from t
      3  where substr(rowid, length(rowid), 1) <> upper(substr(rowid, length(rowid), 1))
      4  and substr(rowid, length(rowid), 1) not in ('0', '1', '2', '3', '4');
      COUNT(*)
         40758
    EDIT:
    I realized that I screwed up above. In hind sight I don't know what I was thinking. I was attempting to use X = upper(X) to find the upper case characters A-Z. So the two queries to split rows based on the last character of rowid are not right. I don't have time to fix now, but wanted to leave a note of warning.
    Edited by: Shannon Severance on Jul 29, 2011 1:34 AM

  • How to split list of columns into 2 tables in SSIS 2012?

    Hi,
    I have 200 columns in Source. Now i want to split these columns, few into Destination A and few more columns into
    Destination B. Multi cast i tried to use, but it coping all the columns . Any help would be appreciated. Thanks in Advance.
    Lets assume  i have columns  A,B,C,D,E..
    i want to move Columns A,B,D into destination A and 
    columns A,C,D,E INTO Destination B. please help me to implement this logic?

    Hi vasu_479,
    Based on your description, you want to split columns in source table into two destination tables.
    After testing the scenario in my environment, we can use Multicast to achieve your requirement. Just as you said, the Multicast would return all columns. But we can use the method below to achieve the goal:
    If the destination tables are existing tables, we can just map column A, B and D as Input Columns to the corresponding Destination Columns in the Mapping tab for destination A. Then map column A, C, D and E in destination B.
    If the destination tables are created in the Destination component, we can modify the create table query to directly create A, B and D for destination table A, create A, C, D and E for destination table B. Then there columns would be automatically mapped
    in the Mappings pane.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to insert data from APEX form into two tables

    Hi,
    I'm running APEX 4.1 with Oracle XE 11g, having two tables CERTIFICATES and USER_FILES. Some of the (useless) fields are cut to reduce information:
    CREATE TABLE CERTIFICATES
    CERT_ID NUMBER NOT NULL ,
    CERT_OWNER NUMBER NOT NULL ,
    CERT_VENDOR NUMBER NOT NULL ,
    CERT_NAME VARCHAR2 (128) ,
    CERT_FILE NUMBER NOT NULL ,
    ) TABLESPACE CP_DATA
    LOGGING;
    ALTER TABLE CERTIFICATES
    ADD CONSTRAINT CERTIFICATES_PK PRIMARY KEY ( CERT_ID ) ;
    CREATE TABLE USER_FILES
    FILE_ID NUMBER NOT NULL ,
    FILENAME VARCHAR2 (128) ,
    BLOB_CONTENT BLOB ,
    MIMETYPE VARCHAR2 (32) ,
    LAST_UPDATE_DATE DATE
    ) TABLESPACE CP_FILES
    LOGGING
    LOB ( BLOB_CONTENT ) STORE AS SECUREFILE
    TABLESPACE CP_FILES
    STORAGE (
    PCTINCREASE 0
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    FREELISTS 1
    BUFFER_POOL DEFAULT
    RETENTION
    ENABLE STORAGE IN ROW
    NOCACHE
    ALTER TABLE USER_FILES
    ADD CONSTRAINT CERT_FILES_PK PRIMARY KEY ( FILE_ID ) ;
    ALTER TABLE CERTIFICATES
    ADD CONSTRAINT CERTIFICATES_USER_FILES_FK FOREIGN KEY
    CERT_FILE
    REFERENCES USER_FILES
    FILE_ID
    NOT DEFERRABLE
    What I'm trying to do is to allow users to fill out all the certificate data and upload a file in an APEX form. Once submitted the file should be uploaded in the USER_FILES table and all the fields along with CERT_ID, which is the foreign key pointing to the file in the USER_FILES table to be populated to the CERTIFICATES table. APEX wizard forms are based on one table and I'm unable to build form on both tables.
    That's why I've created a view (V_CERT_FILES) on both tables and using INSTEAD OF trigger to insert/update both tables. I've done this before and updating this kind of views works perfect. Here is where the problem comes, if I'm updating the view all the data is updated correctly, but if I'm inserting into the view all the fields are populated at CERTIFICATES table, but for USER_FILES only the fields FILE_ID and LAST_UPDATE_DATE are populated. The rest three regarding the LOB are missing: BLOB_CONTENT, FILENAME, MIMETYPE. There are no errors when running this from APEX, but If I try to insert into the view from SQLDeveloper, I got this error:
    ORA-22816: unsupported feature with RETURNING clause
    ORA-06512: at line 1
    As far as I know RETURNING clause in not supported in INSTEAD of triggers, although I didn't have any RETURNING clauses in my trigger (body is below).
    Now the interesting stuff, after long tracing I found why this is happening:
    First, insert is executed and the BLOB along with all its properties are uploaded to wwv_flow_file_objects$.
    Then the following insert is executed to populate all the fields except the BLOB and it's properties, rowid is RETURNED, but as we know RETURNING clause is not supported in INSTEAD OF triggers, that's why I got error:
    PARSE ERROR #1918608720:len=266 dep=3 uid=48 oct=2 lid=48 tim=1324569863593494 err=22816
    INSERT INTO "SVE". "V_CERT_FILES" ( "CERT_ID", "CERT_OWNER", "CERT_VENDOR", "CERT_NAME", "BLOB_CONTENT") VALUES (:B1 ,:B2 ,:B3 ,:B4, ,EMPTY_BLOB()) RETURNING ROWID INTO :O0
    CLOSE #1918608720:c=0,e=11,dep=3,type=0,tim=1324569863593909
    EXEC #1820672032:c=3000,e=3168,p=0,cr=2,cu=4,mis=0,r=0,dep=2,og=1,plh=0,tim=1324569863593969
    ERROR #43:err=22816 tim=1324569863593993
    CLOSE #1820672032:c=0,e=43,dep=2,type=1,tim=1324569863594167
    Next my trigger gets in action, sequences are generated, CERTIFICATES table is populated and then USER_FILES, but only the FILE_ID and LAST_UPDATE_DATE.
    Finally update is fired against my view (V_CERT_FILES), reading data from wwv_flow_files it populates BLOB_CONTENT, MIMETYPE and FILENAME fields at the specific rowid in V_CERT_FILES, the one returned from the insert at the beginning. Last, file is deleted from wwv_flow_files.
    I'm using sequences for the primary keys, this is only the body of the INSTEAD OF trigger:
    select user_files_seq.nextval into l_file_id from dual;
    select certificates_seq.nextval into l_cert_id from dual;
    insert into user_files (file_id, filename, blob_content, mimetype, last_update_date) values (l_file_id, :n.filename, :n.blob_content, :n.mimetype, sysdate);
    insert into certificates (cert_id, cert_owner, cert_vendor, cert_name, cert_file) values (l_cert_id, :n.cert_owner, :n.cert_vendor, :n.cert_name, l_file_id);
    I'm surprised that I wasn't able to find a valuable source of information regarding this problem, only MOS note about running SQLoader against view with CLOB column and INSTEAD OF trigger. The solution would be to ran it against base table, MOS ID 795956.1.
    Maybe I'm missing something and that's why I decided to share my problem here. So my question is how do you create this kind of architecture, insert into two tables with a relation between them in APEX ? I read a lot in the Internet, some advices were for creating custom form with APEX API, create a custom ARP, create two ARP or create a PL/SQL procedure for handing the DML?
    Thanks in advance.
    Regards,
    Sve

    Thank you however I was wondering if there was an example available which uses EJB and persistence.

  • Insert the data into two tables at a time.

    Hi ,
    i have these two tables
    create table [dbo].[test1](
    [test1_id] [int] identity(1,1) primary key,
    [test2_id] [int] not null
    create table [dbo].[test2](
    [test2_id] [int] identity(1,1) primary key,
    [test1_id] [int] not null
    alter table [dbo].[test1]
    add constraint [fk_test1_test2_id] foreign key([test2_id])
    references [dbo].[test2] ([test2_id])
    alter table [dbo].[test2] add constraint [fk_test2_test2_id] foreign key([test1_id])
    references [dbo].[test1] ([test1_id])
    I want to insert the data into two tables in one insert statement. How can i do this using T-SQL ?
    Thanks in advance.

    You can INSERT into both tables within one Transaction but not in one statement. By the way, you would need to alter your dbo.Test1 table to allow null for first INSERT test2_id column
    See sample code below:
    CREATE TABLE #test1(test1_ID INT IDENTITY(1,1),test2_id INT NULL)
    CREATE TABLE #test2(test2_ID INT IDENTITY(1,1),test1_ID INT)
    DECLARE @Test1dentity INT
    DECLARE @Test2dentity INT
    BEGIN TRAN
    -- Insert NULL as test2_ID value is unknown
    INSERT INTO #test1(test2_ID)
    SELECT NULL;
    -- get inserted identity value
    SET @Test1dentity = SCOPE_IDENTITY();
    INSERT INTO #test2(test1_ID)
    SELECT @Test1dentity;
    -- get inserted identity value
    SET @Test2dentity = SCOPE_IDENTITY();
    -- Update test1 table
    UPDATE #test1
    SET test2_ID = @Test2dentity
    WHERE test1_ID = @Test1dentity;
    COMMIT
    SELECT * FROM #test1;
    SELECT * FROM #test2;
    -- Drop temp tables
    IF OBJECT_ID('tempdb..#test1') IS NOT NULL
    BEGIN
    DROP TABLE #test1
    END
    IF OBJECT_ID('tempdb..#test2') IS NOT NULL
    BEGIN
    DROP TABLE #test2
    END
    web: www.ronnierahman.com

  • Insert into two tables, how to insert multiple slave records

    Hi, I have a problem with insert into two tables wizard.
    The wizard works fine and I can add my records, but I need to enter multiple slave table records.
    My database:
    table: paper
    `id_paper` INTEGER(11) NOT NULL AUTO_INCREMENT,
    `make` VARCHAR(20) COLLATE utf8_general_ci NOT NULL DEFAULT '',
    `model` VARCHAR(20) COLLATE utf8_general_ci NOT NULL DEFAULT '',
    `gsm` INTEGER(11) NOT NULL,
    PRIMARY KEY (`id_paper`)
    table: paper_data
    `id_paper_data` INTEGER(11) NOT NULL AUTO_INCREMENT,
    `id_paper` INTEGER(11) NOT NULL,
    `value` DOUBLE(15,3) NOT NULL,
    `nanometer` INTEGER(11) NOT NULL,
    PRIMARY KEY (`id_paper_data`)
    I need to add multiple fields "value" and "nanometer"
    Current form looks like this:
    Make:
    Model:
    Gsm:
    Value:
    nanometer:
    I need it to look like this:
    Make:
    Model:
    Gsm:
    Value:
    nanometer:
    Value:
    nanometer:
    Value:
    nanometer:
    Value:
    nanometer:
    and so on.
    The field "id_paper" in table paper_data needs to get same id for entire transaction. Also how do I set default values for each field "nanometer" on my form the must be different (370,380,390 etc)?
    Thanks.

    you can find an answer here: http://209.85.129.132/search?q=cache:PzQj57dsWmQJ:www.experts-exchange.com/Web_Development /Software/Macromedia_Dreamweaver/Q_23713792.html+Insert+Into+Two+Tables+Wizard&cd=3&hl=lt& ct=clnk&gl=lt
    This is a copy of the post:
    Hi experts,
    Im using ADDT to design a page that needs to insert one record into a master ALBUMS table, along with three records into a GENRES table, all linked by the primary, auto-incremented ALBUMS. ALBUM_ID.
    Ive tried many different ways of combining the Insert into Multiple Tables wizard and the insert record wizard with Link Transactions, all with no luck.  Either only the album info gets inserted, or a ALBUM_ID cannot be null error from MySQL.  Here is the structure of the tables
    ALBUMS
    ALBUM_ID, INT(11), Primary, Auto_Increment
    alb_name, varchar
    alb_release, YEAR
    USER_ID, int
    alb_image, varchar
    GENRES
    ALBUM_ID, int, NOT NULL
    GENRE_ID, int, NOT NULL
    ID, int, primary, auto-increment
    Many thanks in advance...
    ==========================================================================================
    //remove this line if you want to edit the code by hand
    function Trigger_LinkTransactions(&$tNG) {
      global $ins_genres;
      $linkObj = new tNG_LinkedTrans($tNG, $ins_genres);
      $linkObj->setLink("ALBUM_ID");
      return $linkObj->Execute();
    function Trigger_LinkTransactions2(&$tNG) {
      global $ins_genres2;
      $linkObj = new tNG_LinkedTrans($tNG, $ins_genres2);
      $linkObj->setLink("ALBUM_ID");
      return $linkObj->Execute();
    function Trigger_LinkTransactions3(&$tNG) {
      global $ins_genres3;
      $linkObj = new tNG_LinkedTrans($tNG, $ins_genres3);
      $linkObj->setLink("ALBUM_ID");
      return $linkObj->Execute();
    //end Trigger_LinkTransactions trigger
    //-----------------------Different Section---------------------//
    // Make an insert transaction instance
    //Add Record Genre 1
    $ins_genres = new tNG_insert($conn_MySQL);
    $tNGs->addTransaction($ins_genres);
    $ins_genres->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "VALUE", null);
    $ins_genres->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $detailValidation);
    $ins_genres->setTable("genres");
    $ins_genres->addColumn("GENRE_ID", "NUMERIC_TYPE", "POST", "GENRE_ID");
    $ins_genres->addColumn("ALBUM_ID", "NUMERIC_TYPE", "VALUE", "");
    $ins_genres->setPrimaryKey("ID", "NUMERIC_TYPE");
    // Add Record Genre 2
    $ins_genres2 = new tNG_insert($conn_MySQL);
    $tNGs->addTransaction($ins_genres2);
    $ins_genres2->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "VALUE", null);
    $ins_genres2->setTable("genres");
    $ins_genres2->addColumn("GENRE_ID", "NUMERIC_TYPE", "POST", "GENRE_ID2");
    $ins_genres2->addColumn("ALBUM_ID", "NUMERIC_TYPE", "VALUE", "");
    $ins_genres2->setPrimaryKey("ID", "NUMERIC_TYPE");
    // Add Record Genre 3
    $ins_genres3 = new tNG_insert($conn_MySQL);
    $tNGs->addTransaction($ins_genres3);
    $ins_genres3->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "VALUE", null);
    $ins_genres3->setTable("genres");
    $ins_genres3->addColumn("GENRE_ID", "NUMERIC_TYPE", "POST", "GENRE_ID3");
    $ins_genres3->addColumn("ALBUM_ID", "NUMERIC_TYPE", "VALUE", "");
    $ins_genres3->setPrimaryKey("ID", "NUMERIC_TYPE");
    =========================================================================================
    Hi Aaron,
    Nice job!!
    $ins_albums->registerTrigger("AFTER", "Trigger_LinkTransactions2", 98);
    $ins_albums->registerTrigger("AFTER", "Trigger_LinkTransactions3", 98);
    These lines, right? :-( Sorry I forgot to mention that
    Thanks a lot for the grading!

  • Insert into two tables

    I want to input a set of data into form text fields then
    insert that data into a table plus insert one of those fields into
    another table when the form button is clicked.
    I've played around with Recordsets etc but I can't work out
    how to define a server behaviour which will enable me to do what I
    want. I'm using DWMX 2004 by the way.
    Probably simple but I'm new to this and can't find an
    explanation anywhere in the help files. Perhaps one of the resident
    gurus could offer me some advice?
    TIA, Ken

    quote:
    Originally posted by:
    Newsgroup User
    old-celt wrote:
    > I want to input a set of data into form text fields then
    insert that data into
    > a table plus insert one of those fields into another
    table when the form button
    > is clicked.
    You can't insert data into two tables in a single operation.
    It requires
    two insert record queries to be run in succession.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/
    Can I make the two insert queries run from a single form
    button press? Shoould I have a recordset or write two separate
    queries, one for each table?

  • How to insert data into two tables at once using XSJS

    Hello Experts,
    My requirement is to insert data into two tables at once. I have a XS JS app and want to update these tables via xsjs. How can I do this ?
    Is there any mechanism like sql 'transactions' also in Hana ? If yes, how can I call it via xsjs ? If not, what are the ways to populate two different tables at once.
    Please advice. Any help is really appreciated.
    Thanks !

    There is nothing special about inserting into two tables at once in XSJS. Just issue two separate SQL Statements.  Don't execute the COMMIT until after both commands.  That way they are all one transaction.

Maybe you are looking for

  • Anyconnect VPN not prompting to accept Certificate (Windows 7)

    Hello, I have an issue with windows 7 and anyconnect.  When trying to connect to the VPN server the anyconnect client pops up a window saying that the server certificate cannot be verified. Doing the same in a windows XP machine just pops a window an

  • BlackBerry Bold Registration Notification - MAKE IT STOP

    Please help me before I throw this thing out the window. On my route to work my phone feels the need to re-register my blackberry 4 times.  I recently was forced to upgrade the software, and this is a new situation.  I can not find anywhere in the op

  • Provide Tooltip to a table control field

    Hi there, can anyone suggest me how do I provide tooltip to a field in a table control created thru screen painter? the field is of char4 type and it displays an ICON depending upon the business logic. Regards, Deb.

  • How to make a FULL backup of the MBP

    Hi, I have to sent the MBP in because I have some strange noises. The question is how can I backup my full computer like it is now, erase ( format) it and play the whole thing on it again, when I finaly get the repaired one back. I could use one of m

  • Change Default Import Settings

    This has bugged me for a while now. I have created an Import Preset to import my photos to my "F" drive. Works perfectly but sometimes...the import Preset reverts to the original Lightroom Import setting which imports to my "C".drive. If I right clic