Select statement to insert into a table using a loop

hi
create table uploadtab(
itema varchar2(3),
xtype varchar2(1),
salesa number,
margina number,
salesb number,
marginb number,
salesc number,
marginc number);
insert into uploadtab
  (itema, xtype, salesa, margina, salesb, marginb, salesc, marginc)
values
  ('abc', 'a', 100, .40, 300, .10, 450, .25);
create table testinsert(itema varchar2(3),
xtype varchar2(1),
sales number,
margin number);what i want to do is create 3 records based on that one in a loop
so my desired output for testinsert is as follows
abc  a 100  .40
abc  a 300  .10
abc  a 450  .25i don't want to use 3 insert tables if at all possible
any help would be greatly appreciated
thanks in advance
Edited by: DM on Jul 7, 2010 2:22 PM

Just a question on this
INSERT INTO testinsert
( itema
, xtype
, sales
, margin
SELECT  itema
,       xtype
,       DECODE
        ( RN
        , 1,salesa
        , 2,salesb
        , 3,salesc
,       DECODE
        ( RN
        , 1,margina
        , 2,marginb
        , 3,marginc
FROM            uploadtab
CROSS JOIN      (
                        SELECT ROWNUM RN
                        FROM   dual
                        CONNECT BY LEVEL <= 3
;when you put a WHERE before the CROSS JOIN, the error
ORA-00933:SQL command not properly ended. is displayed.

Similar Messages

  • Can select, but cannot insert into oracle tables using php.

    I am having trouble inserting data into a tables in oracle using PHP. I can insert into the tables using baninst1, but nothing else. I can't even insert using the tables' owner. Every time I try I get the ORA-00492 error of table or view does not exist. However, I can run a select statement just fine. So far, baninst1 is the only user that can actually do inserts. I've triple checked all the table grants and everything is fine. Also, I can copy/paste the exact insert statement into SQL*Plus and it works with the correct user. It doesn't have to be baninst1. I've tried everything I can think of. I've tried putting the table name in quotes, adding the schema name to the table, checking public synonyms, but everything appears to be ok. I would greatly appreciate any suggestions others may have.
    I'm using PHP 5.2.3 with an oracle 9i DB.

    Here is the code that doesn't work. It works only with baninst1, no other username will work and all I do is change the my_username/my_password to something different. This is one example function where I try to do an insert, but it doesn't work on any of the tables I try.
    Thanks for looking.
    class Oracle {
         private $oracleUser = "my_username";
         private $oraclePassword = "my_password";
         private $oracleDB = "MY_DB";
         private $c = null;
         function Connect() {
              if ( !($this->c = ocilogon( $this->oracleUser, $this->oraclePassword, $this->oracleDB ) ) )
                   return false;
              return true;
         function AddNewTest($testName, $course, $section, $term, $maxAttempts, $length, $startDate, $startTime, $endDate, $endTime)
              $result = "";
              if( $this->c == null )
                   $this->Connect();     
              $splitIndex = strpos($course, " ");
              $subjectCode = substr($course, 0, $splitIndex);
              $courseNumber = substr($course, $splitIndex + 1);
              $insertStatment = "insert into szbtestinfo(szbtestinfo_test_name,
                                                                szbtestinfo_course_numb,
                                                           szbtestinfo_section,
                                                                szbtestinfo_max_attempts,
                                                                szbtestinfo_length_minutes,
                                                                szbtestinfo_start,
                                                                szbtestinfo_end,
                                                                szbtestinfo_id,
                                                                szbtestinfo_subj_code,
                                                                szbtestinfo_eff_term)
                                                                values( '" . $testName .
                   "', '" . $courseNumber .
                   "', '" . $section .
                   "', " . $maxAttempts .
                   ", " . $length .
                   ", to_date('" . $startDate . " " . $startTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", to_date('" . $endDate . " " . $endTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", szsnexttest.nextval" .
                   ", '" . $subjectCode .
                   "', '" . $term . "')";
              //return $insertStatment;
              $s = OCIParse($this->c, $insertStatment);
              try
                   $result = OCIExecute($s);
              catch(exception $e)
              return $result;
         }

  • How to insert into two tables using a Single ADF creation form?

    Hi,
    I need to make a ADF Creation Form that will insert the data at same time in two tables... Like i have two tables Track (Track_id,Track_Name)
    and Module ( Module_id, Track_id, Module_name, Module_Short_name) and i have to insert the data in both the tables using Same Creation Form.
    can anybody help me out and gave me the solution,how to do that?
    Thanks

    if you want to insert different data into two different tables then you can drag the two data objects into creation form..
    If you want to duplicate the data inserted in the one table to another then you can follow two approach
    1. Drag and drop one table, When Save button is invoked then insert data into another table using callable statement.
    or
    2. Create on-insert trigger in Table1 where you can insert data into table2.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • HOW TO READ DATA FROM A FILE AND INSERT INTO A TABLE USING UTL_FILE

    Hi..
    I have a file.I want to read the data from file and load it into a table using utl_file.
    how can I do it?
    Any reply apreciated...

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • Insert into a table using select statement

    I have a table aa_table which alread has data for 3 columns now i need to insert
    the date for the 4th column C_id as shown below
    INSERT INTO aa_table s(s.c_id) values (select id from C_table c ,aa_table s
    where c.cin in( select s.cin from aa_table))
    Its says missing expression?
    Any one know what is wrong with this.
    Thanks

    yes this will update all the rows in the table
    UPDATE aa_table a
       SET c_id = (SELECT ID
                     FROM C_table c
                    WHERE c.cin = s.cin)this will update selected rows only
    UPDATE aa_table a
       SET c_id = (SELECT ID
                     FROM C_table c
                    WHERE c.cin = s.cin)
    WHERE EXISTS (SELECT 'c'
                     FROM C_table c
                    WHERE c.cin = s.cin)

  • Insert into another table using record

    Hi all, i am reading from TableA , need to sort the records and insert the sorted order in table B, and need some help with the coding, would appreciate if anyone can help.
    I am using records
    create or replace procedure ZZ AS
    DECLARE
    CURSOR GEN_CUR IS
         select *
         FROM TABLE_A;
            ORDER BY field_1 ASC;
         info_rec GEN_CUR%ROWTYPE;
         BEGIN
              open GEN_CUR;
              LOOP
                   FETCH gen_cur INTO info_rec;
                   EXIT WHEN gen_cur%NOTFOUND;
                   -- i need to insert the record into table_B. table_B's fields are identical to table_A, but am unsure of the code.
              END LOOP;
              CLOSE gen_cur;
         END;Message was edited by:
    learningoracle

    From Oracle 9.2 onwards we can do clever things with records:
    SQL> select * from tab1
      2  /
    K F
    Z X
    A X
    SQL> declare
      2     r tab1%ROWTYPE;
      3  begin
      4     for r in ( select * from tab1 order by key ) loop
      5       insert into tab12 values r;
      6     end loop;
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SQL> select * from tab12
      2  /
    K F
    A X
    Z X
    SQL> But as K Richards has pointed out you can do this with a straight INSERT ... SELECT statement...
    SQL> roll
    Rollback complete.
    SQL> insert into tab12
      2  select * from tab1 order by key
      3  /
    2 rows created.
    SQL> select * from tab12
      2  /
    K F
    A X
    Z X
    SQL> Note that sort order is only guaranteed when we use an ORDER BY clause.
    Cheers, APC

  • Insert into a table using UNIX

    i have file Summary.txt
    contants looks like this
    ./log_CS-185.lst:Error detected, rollbacking
    ./log_CS-13603.lst:Error detected, rollbacking
    ./log_CS-1002.lst:Error detected, rollbacking
    now i have to parse this file to get (CS-185,CS-13603,CS-1002)
    and insert these vlaues into a table... how do i do this using unix script ?..

    i have to parse this file to get (CS-185,CS-13603,CS-1002)
    and insert these vlaues into a table... how do i do this using unix script ?..Example :$ cat read_Sum.sh
    cat Summary.txt | while read LINE
    do
            VAR=`echo $LINE | awk -F_ '{print $2}' | awk -F. '{print $1}'`
            echo $VAR
            sqlplus -s test/test << EOF
            insert into summary values('$VAR');
            exit
    EOF
    done
    $ ./read_Sum.sh
    CS-185
    1 row created.
    CS-13603
    1 row created.
    CS-1002
    1 row created.
    $ sqlplus test/test
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu May 19 13:32:40 2011
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select * from summary;
    CODE
    CS-185
    CS-13603
    CS-1002
    SQL>

  • Looking for an insert statement to insert into a table around 500 rows

    Hi  Gurus,
    Your help is greatly appreciated !!,
    I need to have a query to insert into the mer_spec_feature table with the following , Please sugesst apart from the Utl_file ,input thing
    as the data is differnt in the regions and am lokking if it workes out with a insert and select query .
    1)I have to create a  script for inserting records into  mer_spec_feature where  on appl_id ‘VXRR’
    having feature ID 786 and have to Exclude TIDs which already have the 786 feature added for this appl_id like in the eblwo select query .
    2)There are 509 such TIDs where it doesnt have the 786 feature with appl_id -'VXRR' in the mer_spec_feature table
    3)
    select distinct terminal_id,  appl_id, from  mer_spec_feature
    where appl_id = 'VXRR'
    minus
    select distinct terminal_id, appl_id from mer_spec_feature
    where appl_id = 'VXRR'
    and terminal_feature_id = 786
    desc mer_spec_feature :
    Terminal_id  --varachr2(9)
    appl_id    --varcahr2(10 )
    terminal_feature-id --number(8)
    TERMINAL_FEATURE_ID
    TERMINAL_APPL_ID
    TERMINAL_ID
    299
    405T330a
    1004665
    786
    VXRR
    1004665

    @Frank Kulash !!
    Thanks always for your replys .!!
    i have tried with the above sql , and am having issue with the pk constraint after inserting  232 rows.
    And a Tertminal_id  will have 100 feature_id's for one  appl_id.
    becoz it has pk constraint on  -- TERMINAL_FEATURE_ID, APPL_ID, TERMINAL_ID
    TERMINAL_FEATURE_ID
    APPL_ID
    TERMINAL_ID
    299
    405T330a
    1004665
    786
    VXRR
    1004665
    can you please sugeest any other option.

  • How to insert into a table using a procedure in a trigger

    I have following trigger and based on the some condition, it should inser a row in to a table using the procedure:
    CREATE OR REPLACE TRIGGER RSSC.RR_SERV_ADD_ON_REQ_bu before update on RSSC.RR_SERV_ADD_ON_REQ
    for each row
    DECLARE
    lr_appr_trans_hdr APPR_TRANS_HDR%ROWTYPE;
    -- Inserting a row into APPR_TRANS_HDR table
              lr_appr_trans_hdr.apth_ref_system := 'RSAO';
              lr_appr_trans_hdr.apth_xref_col_name := 'RSAO_ADD_ON_REQ_NUM';
              lr_appr_trans_hdr.apth_xref_id := :NEW.RSAO_ADD_ON_REQ_NUM;
              lr_appr_trans_hdr.apth_trans_srce := 'I';
              lr_appr_trans_hdr.apth_balance_amt := :NEW.RSAO_TOT_AMT;
              lr_appr_trans_hdr.apth_is_finance_adj := 'N';
              SPI_APPR_TRANS_HDR (
              lr_appr_trans_hdr.apth_id
              ,lr_appr_trans_hdr.apth_create_dt
                   ,lr_appr_trans_hdr.apth_create_user_id
                   ,lr_appr_trans_hdr.apth_update_dt
                   ,lr_appr_trans_hdr.apth_update_user_id
              ,lr_appr_trans_hdr.apth_ref_system
                   ,lr_appr_trans_hdr.apth_xref_col_name
                   ,lr_appr_trans_hdr.apth_xref_id
                   ,lr_appr_trans_hdr.apth_trans_srce
                   ,lr_appr_trans_hdr.apth_udc_name_cd
                   ,lr_appr_trans_hdr.apth_udc_acct_num
                   ,lr_appr_trans_hdr.apth_level1_apprvl_stat
                   ,lr_appr_trans_hdr.apth_level1_apprvl_dt
                   ,lr_appr_trans_hdr.apth_level1_apprvr_id
                   ,lr_appr_trans_hdr.apth_level2_apprvl_stat
                   ,lr_appr_trans_hdr.apth_level2_apprvl_dt
                   ,lr_appr_trans_hdr.apth_level2_apprvr_id
                   ,lr_appr_trans_hdr.apth_received_dt
                   ,lr_appr_trans_hdr.apth_balance_amt
                   ,lr_appr_trans_hdr.apth_cust_name
                   ,lr_appr_trans_hdr.apth_sent_dt
                   ,lr_appr_trans_hdr.apth_wbs_element
                   ,lr_appr_trans_hdr.apth_gl_acct_num
                   ,lr_appr_trans_hdr.apth_is_finance_adj );
    When I use the above, it is saying wrong number of argument or type.
    When I use the following instead, I am getting :NEW.APTH_ID must be declared.
    SPI_APPR_TRANS_HDR('APPR_TRANS_HDR',to_char(:NEW.APTH_ID),'APTH_ID',:OLD.APTH_ID,:NEW.APTH_ID);
    How can use the procedure in a trigger.
    Following is the table structure:
    Column Name     Data Type     Column Comments
    APTH_ID     NUMBER(16) Computed unique identified per large table standards (yyyymmddnnnnnnnn)
    APTH_CREATE_DT     DATE     sysdate
    APTH_CREATE_USER_ID VARCHAR2(65)     ‘conv’
    APTH_UPDATE_DT     DATE     sysdate
    APTH_UPDATE_USER_ID     VARCHAR2(65)     ‘conv’
    APTH_REF_SYSTEM     VARCHAR2(4)     ‘RSAO’
    CPA_PREM_NUM     NUMBER(13,0)     NULL
    RSR_REQ_NUM     NUMBER(16)     NULL
    RSAO_ADD_ON_REQ_NUM     NUMBER(16)     rsao_add_on_req_num
    APTH_TRANS_SRCE     VARCHAR2(2)     ‘I’
    APTH_LDC_NAME_CD     VARCHAR2(4)     NULL
    APTH_LDC_ACCT_NUM     VARCHAR2(25)     NULL
    APTH_LEVEL1_APPROVAL_STAT     VARCHAR2(1)     NULL
    APTH_LEVEL1_APPROVAL_DT     DATE     NULL.
    APTH_LEVEL1_APPROVAL_ID     VARCHAR2(30)     NULL
    APTH_LEVEL2_APPROVAL_STAT     VARCHAR2(1)     NULL
    APTH_LEVEL2_APPROVAL_DT     DATE     NULL.
    APTH_LEVEL2_APPROVAL_ID     VARCHAR2(30)     NULL
    APTH_RECEIVED_DT     DATE     NULL
    APTH_BALANCE_AMT     NUMBER(11,2) RR_SERV_ADD_ON_REQ.rsao_tot_amt – amount previously extracted to sap
    APTH_CUST_NAME     VARCHAR2(65)     NULL
    APTH_SENT_DT     DATE     NULL
    APTH_WBS_ELEMENT     VARCHAR2(25)     NULL
    APTH_GL_ACCT_NUM     VARCHAR2(15) NULL
    APTH_IS_FINANC_ADJ     VARCHAR2(1)     ‘N’
    Edited by: user652807 on Sep 3, 2008 4:51 PM

    It appears you're missing the format mask in the TO_CHAR, ...
    TO_CHAR(:new.apth,'YYYYMMHR24MISS')
    The full code would help a bit more.

  • Insert into a table using DB trigger

    Hi,
    I want to create a trigger on mytableA during INSERT or UPDATE:
    When a record is created or updated in mytableA, I would like to insert a record into mytableB.
    Before inserting, I would like to check if the corresponding mytable data already exists in the mytableB.
    I was wondering if there's any better PLSQL code rather than using something like this.
    select count(1) from mytableB where...
    if count(1) <0 then
    insert into mytableB
    end if;
    OR
    use a no data found logic
    Note: I will not be doing an UPDATE to mytableB if the record already exists.
    Thanks in Advance.
    Anto

    Hi,
    I am using 10g.
    Could you give me an example on how to form a MERGE for DB trigger.
    I tried something like this:
    MERGE INTO mytableB
    USING (SELECT col1,col2,col3 FROM mytableA) A
    ON (A.col1=:new.col1)
    WHEN NOT MATCHED THEN INSERT (col1,col2,col3e)
    VALUES (:NEW.col1,:NEW.col2,:NEW.col3);
    But since I am write a trigger on mytableA , SELECT might cause trigger mutating.
    Please suggest.
    Thanks.
    Anto

  • Insert into multiple tables using a page variable

    Hi Guys,
    I was going to trawl the PL/SQL forum for this but as I need to use a page variable I thought I would try here first.
    I have 4 tables 2 live and 2 archive, company_table, company_table_arch, product, product_arch the tables are set up with a company Id as the join.
    you can have multiple products to a company.
    what I want to do is have an archive button on a form that will select the current record on the company table, and insert it into archive then select all records with that id in the product table and insert them into the product_arch table.
    I was thinking about doing this as a couple of page proccess, sound about right?
    the other option was using a package,
    is it possible to use page variables in a package? If so what is the sintax
    cheers
    Bjorn

    OK, I have got the basis of this working I press the archive button and the records update as per the code.
    I have one problem however.
    The button is on a form. and if the user updates the form then presses the archive button it copies the data before the table is updated (the table is updated using a save button).
    One way round this would be to jump to an "are you sure?" page
    Does anyone know a better way of doing this?
    cheers
    Bjorn

  • Inserting into two tables using JDBC Receiver Adapter

    I've defined following type for Receiver JDBC to save data in two different tables
    Name          Category     Type          Occurrence
    ReceiverDB_DT     Complex Type          
    STATEMENT     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table1_DT     1
    STATEMENT2     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table2_DT     1
    When I send data of two tables, it is showing data for both the two tables in MONI of PI System, but ultimately it shows only one table's data in message monitoring payload.
    what could be the problem?
    Thanks,
    -Haresh

    It solved!!!
    by just changing Occurrence only as rightly pointed by Ankesh
    Name          Category     Type          Occurrence
    ReceiverDB_DT     Complex Type          
    STATEMENT     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table1_DT     1
    STATEMENT2     Element                    1..unbounded
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table2_DT     1
    Name          Category     Type          Occurrence
    ReceiverDB_DT     Complex Type          
    STATEMENT     Element                    1
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table1_DT     1..unbounded
    STATEMENT2     Element                    1
    TABLE_NAME     Element                    1
    ACTION          Attribute     xsd:string     required
    TABLE          Element          xsd:string     1
    ACCESS          Element          Table2_DT     1..unbounded
    Thanks a lot ankesh

  • Does a temp table is reuired to insert into a table

    Hi ,
    I am using a stored procedure to check the availability of a record in a table and deleting the record if exists ,
    actually  if the user have multiple record i need to delete and store it in removed table  , so i used insert with select command to insert into the table , do i need to use a temp table to insert multiple record in removed table .
    Thank You
    Jeevan Vinay

    No, it doesn't need to be that complex.
    The records need to go to your deleted/history table, and they also need to be deleted from the main table. I would just insert the records into the history table and delete the records from your main table by joining back to it on the delete with the PK.
    You could try something like this:
    CREATE TABLE ##main_table (employee_id INT IDENTITY(1,1), employee_name VARCHAR(50))
    CREATE TABLE ##history_table (employee_id INT, employee_name VARCHAR(50))
    INSERT INTO ##main_table (employee_name)
    SELECT 'Alice'
    UNION ALL
    SELECT 'Bob'
    UNION ALL
    SELECT 'Charlie'
    --Bob is the user that will get deleted (employee_id = 2)
    --Insert record into history table
    INSERT INTO ##history_table
    SELECT *
    FROM ##main_table
    WHERE employee_id = 2
    --Delete record from main table
    DELETE m
    FROM ##main_table m
    JOIN ##history_table h
    ON m.employee_id = h.employee_id
    SELECT *
    FROM ##history_table
    SELECT *
    FROM ##main_table

  • Creating a button for inserting into a table

    What I can't do, because I've never needed to, is to create in a page (where I have a Interactive report) a button that when is clicked performs a simple sql (for example an insert into a table using some page item values).
    How can I do it?
    Thanks

    Here are some of the steps:
    1) Create the button.
    2) Then right click on the button name and select Create Dynamic Action
    3) Give the DA a name, click next
    4) On the "When" Step, Event should already be "Click" and the button name should be filled in
    5) For Condition, you would have a condition for when you want the button display.  Say, if your page items have a certain range of values then display this button.  No condition means the button is always displayed.
    6) For the "True Action" Step, for Action select "Execute PL/SQL Code"
        [There are other ways to do this, but this is straight-forward for me.]
    7) The in the PL/SQL Code block enter say:
    Begin
      INSERT INTO EMP (EMPNO, ENAME, HIREDATE)        
              VALUES (:P6_EMPNO, 'MARK1970', :P6_HIREDATE);
      COMMIT;
    END;   --- You would likely make them all page item variables
    8) Here the part I'm not 100% sure of.
        For "Page Items to Submit", name the page items used in YOUR QUERY -- in my example these are  P6_EMPNO,P6_HIREDATE   (Note no use of & or : or . here)
        Hmm.  Start by putting nothing in the "Page Items to Return".   If that fails, then try the same page items  P6_EMPNO,P6_HIREDATE there as well.
    [ I'm too lazy to go run this down at the moment.]
    9) I think that's it.
    Howard

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

Maybe you are looking for

  • Assigning a login module to a single WebDynpro to authenticate against LDAP

    Hi there, we are running the J2EE Engine 7.0 within XI on SAP NetWeaver 2004s / Linux x86_64. Basically, i want to Authenticate a Java WebDynpro against an LDAP (Active Directory). With the XI Usage installed, I can not customize the UME to authentic

  • 5800 really slow after v40 plus can't install apps

    Greetings fellow chaps. I updated my 5800 just yesterday to v40 and after that ican't install anything. When I try to install an app I receive an error message saying "Cannot install,Installation application already running"(roughly translated from G

  • My iMac G5 crashed when backing up. Don't know what to do!

    I was making a back-up of my hard drive using Super Duper and my computer crashed during the back-up. Now my computer won't boot from the regular start up disc. I always get that flashing finder icon that flashes between the finder icon and a questio

  • Problem with the cfg-wizard - Service Registry and SLD Client

    Hi, I try to complete the initial activity for configuring the Registering Services Registry instance in SLD (http: localhost:port\nwa\cfg-wizard)  but when i start the wizard i found this error: Error: Getting WBEMClient failed: com.sap.sldserv.exce

  • Hide statement

    hi friends, can we use a hide statement in  internal table  in interactive reports is there any problem. regards, malleswari.