How to read data and load into a table

Hi,
I have a client requirement as below.
Client will send the xmlpayload, based on this xml I want to read the data and store it into a database table. Could you please let me know how to achieve this functionality.
sample xmlpayload:
<gesws:localeAndSend xmlns:gesws="https://services.gmail.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://services.gmail.com docs/xsd/localeandsend.xsd" schemaVersion="1.0">
<gesws:localer>
<gesws:divisionstate>localeD</gesws:divisionstate>
<gesws:division>Retail</gesws:division>
<gesws:attributes>
<gesws:attribute>
<gesws:name>email</gesws:name>
<gesws:value>[email protected]</gesws:value>
</gesws:attribute>
<gesws:attribute>
<gesws:name>firstName</gesws:name>
<gesws:value>Robin</gesws:value>
</gesws:attribute>
<gesws:attribute>
<gesws:name>lastName</gesws:name>
<gesws:value>Dan</gesws:value>
</gesws:attribute>
<gesws:attribute>
<gesws:name>postalCode</gesws:name>
<gesws:value>56302</gesws:value>
</gesws:attribute>
<gesws:attribute>
<gesws:name>Mobileapp</gesws:name>
<gesws:value>-6</gesws:value>
</gesws:attribute>
<gesws:attribute>
<gesws:name>CodedString</gesws:name>
<gesws:value>1550</gesws:value>
</gesws:attribute>
<gesws:attribute>
<gesws:name>CodedBoolean</gesws:name>
<gesws:value>true</gesws:value>
</gesws:attribute>
</gesws:attributes>
</gesws:localer>
<gesws:localerMessage>
<gesws:mId>120098</gesws:mId>
</gesws:localerMessage>
</gesws:localeAndSend>
Thanks in advance

You can use XMLTABLE to extract data from your XMLTYPE datatype...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select xmltype('<gesws:localeAndSend xmlns:gesws="https://services.gmail.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2  xsi:schemaLocation="https://services.gmail.com docs/xsd/localeandsend.xsd" schemaVersion="1.0">
  3    <gesws:localer>
  4      <gesws:divisionstate>localeD</gesws:divisionstate>
  5      <gesws:division>Retail</gesws:division>
  6      <gesws:attributes>
  7        <gesws:attribute>
  8          <gesws:name>email</gesws:name>
  9          <gesws:value>[email protected]</gesws:value>
10        </gesws:attribute>
11        <gesws:attribute>
12          <gesws:name>firstName</gesws:name>
13          <gesws:value>Robin</gesws:value>
14        </gesws:attribute>
15        <gesws:attribute>
16          <gesws:name>lastName</gesws:name>
17          <gesws:value>Dan</gesws:value>
18        </gesws:attribute>
19        <gesws:attribute>
20          <gesws:name>postalCode</gesws:name>
21          <gesws:value>56302</gesws:value>
22        </gesws:attribute>
23        <gesws:attribute>
24          <gesws:name>Mobileapp</gesws:name>
25          <gesws:value>-6</gesws:value>
26        </gesws:attribute>
27        <gesws:attribute>
28          <gesws:name>CodedString</gesws:name>
29          <gesws:value>1550</gesws:value>
30        </gesws:attribute>
31        <gesws:attribute>
32          <gesws:name>CodedBoolean</gesws:name>
33          <gesws:value>true</gesws:value>
34        </gesws:attribute>
35      </gesws:attributes>
36    </gesws:localer>
37    <gesws:localerMessage>
38      <gesws:mId>120098</gesws:mId>
39    </gesws:localerMessage>
40  </gesws:localeAndSend>') as xml from dual)
41  --
42  -- end of test data
43  --
44  select x.mID, x.divisionstate, x.division
45        ,y.att_name, y.att_val
46  from   t
47        ,xmltable(xmlnamespaces('https://services.gmail.com' as "g")
48                 ,'g:localeAndSend'
49                 passing t.xml
50                 columns mID           number       path './g:localerMessage/g:mId'
51                        ,divisionstate varchar2(10) path './g:localer/g:divisionstate'
52                        ,division      varchar2(10) path './g:localer/g:division'
53                        ,atts          xmltype      path './g:localer/g:attributes'
54                 ) x
55        ,xmltable(xmlnamespaces('https://services.gmail.com' as "g")
56                 ,'g:attributes/g:attribute'
57                 passing x.atts
58                 columns att_name      varchar2(20) path './g:name'
59                        ,att_val       varchar2(20) path './g:value'
60*                ) y
SQL> /
       MID DIVISIONST DIVISION   ATT_NAME             ATT_VAL
    120098 localeD    Retail     email                [email protected]
    120098 localeD    Retail     firstName            Robin
    120098 localeD    Retail     lastName             Dan
    120098 localeD    Retail     postalCode           56302
    120098 localeD    Retail     Mobileapp            -6
    120098 localeD    Retail     CodedString          1550
    120098 localeD    Retail     CodedBoolean         true
7 rows selected.
SQL>Once you're getting the data out, you can do what you want with it, e.g. pivot it to a single row...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select xmltype('<gesws:localeAndSend xmlns:gesws="https://services.gmail.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2  xsi:schemaLocation="https://services.gmail.com docs/xsd/localeandsend.xsd" schemaVersion="1.0">
  3    <gesws:localer>
  4      <gesws:divisionstate>localeD</gesws:divisionstate>
  5      <gesws:division>Retail</gesws:division>
  6      <gesws:attributes>
  7        <gesws:attribute>
  8          <gesws:name>email</gesws:name>
  9          <gesws:value>[email protected]</gesws:value>
10        </gesws:attribute>
11        <gesws:attribute>
12          <gesws:name>firstName</gesws:name>
13          <gesws:value>Robin</gesws:value>
14        </gesws:attribute>
15        <gesws:attribute>
16          <gesws:name>lastName</gesws:name>
17          <gesws:value>Dan</gesws:value>
18        </gesws:attribute>
19        <gesws:attribute>
20          <gesws:name>postalCode</gesws:name>
21          <gesws:value>56302</gesws:value>
22        </gesws:attribute>
23        <gesws:attribute>
24          <gesws:name>Mobileapp</gesws:name>
25          <gesws:value>-6</gesws:value>
26        </gesws:attribute>
27        <gesws:attribute>
28          <gesws:name>CodedString</gesws:name>
29          <gesws:value>1550</gesws:value>
30        </gesws:attribute>
31        <gesws:attribute>
32          <gesws:name>CodedBoolean</gesws:name>
33          <gesws:value>true</gesws:value>
34        </gesws:attribute>
35      </gesws:attributes>
36    </gesws:localer>
37    <gesws:localerMessage>
38      <gesws:mId>120098</gesws:mId>
39    </gesws:localerMessage>
40  </gesws:localeAndSend>') as xml from dual)
41  --
42  -- end of test data
43  --
44  select mID, divisionstate, division
45        ,max(decode(att_name, 'email', att_val)) as email
46        ,max(decode(att_name, 'firstName', att_val)) as firstname
47        ,max(decode(att_name, 'lastName', att_val)) as lastname
48        ,max(decode(att_name, 'postalCode', att_val)) as postalcode
49        ,max(decode(att_name, 'CodedString', att_val)) as codedstring
50        ,max(decode(att_name, 'CodedBoolean', att_val)) as codedboolean
51  from (
52        select x.mID, x.divisionstate, x.division
53              ,y.att_name, y.att_val
54        from   t
55              ,xmltable(xmlnamespaces('https://services.gmail.com' as "g")
56                       ,'g:localeAndSend'
57                       passing t.xml
58                       columns mID           number       path './g:localerMessage/g:mId'
59                              ,divisionstate varchar2(10) path './g:localer/g:divisionstate'
60                              ,division      varchar2(10) path './g:localer/g:division'
61                              ,atts          xmltype      path './g:localer/g:attributes'
62                       ) x
63              ,xmltable(xmlnamespaces('https://services.gmail.com' as "g")
64                       ,'g:attributes/g:attribute'
65                       passing x.atts
66                       columns att_name      varchar2(20) path './g:name'
67                              ,att_val       varchar2(20) path './g:value'
68                       ) y
69       )
70  group by mID, divisionstate, division
71* order by 1
SQL> /
       MID DIVISIONST DIVISION   EMAIL                FIRSTNAME            LASTNAME             POSTALCODE           CODEDSTRING          CODEDBOOLEAN
    120098 localeD    Retail     [email protected]    Robin                Dan                  56302                1550                 true

Similar Messages

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • Remove all duplicate records and load into temp table

    Hi
    I have a table contains data like this.
    Emp No Designation location
    1111 SE CA
    1111 DE CT
    3456 WE NJ
    4523 TY GH
    We found that there are two duplicate records for emp no: 1111. I want to delete all duplicate records (in this case two records for emp no:1111) and load into the temp table.
    Please advice me how to do it.

    Oh look, you can search the forums...
    http://forums.oracle.com/forums/search.jspa?threadID=&q=delete+duplicates&objID=f75&dateRange=all&userID=&numResults=30

  • Extracting explanations from planning app and loading into Oracle table

    Hi All,
    I had a requirement where I had to extract data from a planning application through ODI 11g and load it into Oracle RDBMS.
    I used essbase as my source in technology (since planning data is stored on essbase side) and oracle as my target.
    Now the data is getting extracted from essbase side and is getting loaded into Oracle table through ODI.
    Now the client requires that they want to extract the explanations or text values also from planning application and load them into Oracle table.
    How this can be achieved?Is there a table on the sql side(since sql database is being used at back end for planning app) which stores the explanations,if yes please let me know which table it is.
    Kindly help me with this requirement.

    Hi,
    IKM SQL Control Append is perfect if you don't need incremental updates. If you need it, go for IKM Oracle Incremental Update (MERGE) or something like that.
    Regards,
    JeromeFr

  • Best Practice to fetch SQL Server data and Insert into Oracle Tables

    Hello,
    I want to read sqlserver data everry half an hour and write into oracle tables ( in two different databases). What is the best practice for doing this?
    We do not have any database dblinks from oracle to sqlserver and vice versa.
    Any help is highly appreciable?
    Thanks

    Well, that's easy:
    use a TimerTask to do the following every half an hour:
    - open a connection to sql server
    - open two connections to the oracle databases
    - for each row you read from the sql server, do the inserts into the oracle databases
    - commit
    - close all connections

  • How to read the CSV Files into Database Table

    Hi
    Friends i have a Table called tblstudent this has the following fields Student ID, StudentName ,Class,Father_Name, Mother_Name.
    Now i have a CSV File with 1500 records with all These Fields. Now in my Program there is a need for me to read all these Records into this Table tblstudent.
    Note: I have got already 2000 records in the Table tblstudent now i would like to read all these CSV File records into the Table tblstudent.
    Please give me some examples to do this
    Thank your for your service
    Cheers
    Jofin

    1) Read the CSV file line by line using BufferedReader.
    2) Convert each line (record) to a List and add it to a parent List. If you know the columns before, you might use a List of DTO's.
    3) Finally save the two-dimensional List or the List of DTO's into the datatable using plain JDBC or any kind of ORM (Hibernate and so on).
    This article contains some useful code snippets to parse a CSV: http://balusc.xs4all.nl/srv/dev-jep-csv.html

  • How to save data and load data from an arrayList ??

    i got a run time problem .....when i try to save my data to a file and load a data from a file....i got some kind of error like that
    Please enter your CD`s title : ivan
    Please enter your CD`s Artist/GroupName : diw
    Please enter your CD`s year of release : wid
    InputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) java.util.InputMismatchException
    Invaild value....Please enter the value between 1000 & 9999
    Please enter your CD`s MusicGenre(e.g.: Jazz, Blues, Funk, Classical, Rock, etc...) : w
    Please enter your CD`s comment : w
    Do you have another Cd ? (Y/N) : n
    Saving to file
    java.io.EOFException
         at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at Demo.loadDate(Demo.java:49)
         at Demo.readDataFromConsole(Demo.java:103)
         at Demo.main(Demo.java:173)
    Exit code: 0
    import java.util.ArrayList;
    import java.io.*;
    public class Demo{
         readOperation theRo = new readOperation();
         errorCheckingOperation theEco = new errorCheckingOperation();
         ArrayList<MusicCd> MusicCdList;
         public Demo()
         private void heading()
              System.out.println("\tTesting read data from console, save to file, reopen that file\t");
         private void saveDate()
              MusicCdList = new ArrayList<MusicCd>( ); 
              try
                   File f = new File("jessica.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   for( MusicCd s : MusicCdList)
                   oos.writeObject(s);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
         private void loadDate()
              MusicCdList = new ArrayList<MusicCd>( );  
              try
                   File g = new File("jessica.txt");
                   FileInputStream fis = new FileInputStream(g);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   ArrayList<String> stuff = (ArrayList<String>)ois.readObject();
                   for( String s : stuff ) System.out.println(s);
                   ois.close();
              } catch (Exception ioe)
                   ioe.printStackTrace();
         private void readDataFromConsole()
         //private void insertCd()
           ArrayList<MusicCd> MusicCdList = new ArrayList<MusicCd>( ); 
            readOperation theRo = new readOperation();
            errorCheckingOperation theEco = new errorCheckingOperation();
            MusicCd theCd;
            String muiseCdsTitle;
            String muiseCdsArtistOrGroupName;
            int muiseCdsYearOfRelease;
            int validMuiseCdsYearOfRelease;
            String muiseCdsMusicGenre;
            String muiseCdsAComment;
              while(true)
                    String continueInsertCd = "Y";
                   do
                        muiseCdsTitle = theRo.readString("Please enter your CD`s title : ");
                        muiseCdsArtistOrGroupName = theRo.readString("Please enter your CD`s Artist/GroupName : ");
                        muiseCdsYearOfRelease = theRo.readInt("Please enter your CD`s year of release : ");
                        validMuiseCdsYearOfRelease = theEco.errorCheckingInteger(muiseCdsYearOfRelease, 1000, 9999);
                        muiseCdsMusicGenre = theRo.readString("Please enter your CD`s MusicGenre(e.g.: Jazz, Blues, Funk, Classical, Rock, etc...) : ");
                        muiseCdsAComment  = theRo.readString("Please enter your CD`s comment : ");
                        MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsArtistOrGroupName, validMuiseCdsYearOfRelease ,
                        muiseCdsMusicGenre, muiseCdsAComment));
                        MusicCdList.trimToSize();
                        //saveToFile(MusicCdList);
                        continueInsertCd = theRo.readString("Do you have another Cd ? (Y/N) : ");
                   }while(continueInsertCd.equals("Y") || continueInsertCd.equals("y") );
                   if(continueInsertCd.equals("N") || continueInsertCd.equals("n"));
                                        System.out.println("Saving to file ");
                                                    //MusicCdList.add(new MusicCd(muiseCdsTitle, muiseCdsYearOfRelease));     
                                                    saveDate();
                                        loadDate();
                                  break;
         public static void main(String[] args)
              Demo one = new Demo();
              one.readDataFromConsole();
              how should i fix it if i want to reach the save to a file and load from a file purpose??
    thx all
    for much more understand of this program
    import java.io.Serializable;
    public class MusicCd implements Serializable
         private String musicCdsTitle;
         private String artistOrGroupName;
            private int yearOfRelease;
         private String musicGenre;
         private String aComment;
         public MusicCd()
              musicCdsTitle = "";
              artistOrGroupName = "";
              yearOfRelease = 1000;
              musicGenre = "";
              aComment = "";
         public MusicCd(String newMusicCdsTitle, String newArtistOrGroupName, int newYearOfRelease,
         String newMusicGenre, String aNewComment)
              musicCdsTitle = newMusicCdsTitle;
              artistOrGroupName = newArtistOrGroupName;
              yearOfRelease = newYearOfRelease;
              musicGenre = newMusicGenre;
              aComment = aNewComment;
         public String getTitle()
              return musicCdsTitle;
         public String getArtistOrGroupName()
              return artistOrGroupName;
         public int getYearOfRelease()
              return yearOfRelease;
         public String getMusicGenre()
              return musicGenre;
         public String getAComment()
              return aComment;
         public void setTitle(String newMusicCdsTitle)
              musicCdsTitle = newMusicCdsTitle;
         public void setArtistOrGroupName(String newArtistOrGroupName)
              artistOrGroupName = newArtistOrGroupName;
         public void setYearOfRelease(int newYearOfRelease)
              yearOfRelease = newYearOfRelease;
         public void setMusicGenre(String newMusicGenre)
              musicGenre = newMusicGenre;
         public void setAComment(String aNewComment)
               aComment = aNewComment;
         public boolean equalsName(MusicCd otherCd)
              if(otherCd == null)
                   return false;
              else
                   return (musicCdsTitle.equals(otherCd.musicCdsTitle));
         public String toString()
              return("Title: " + musicCdsTitle + "\t"
              + "Artist/GroupName: " + artistOrGroupName + "\t"
              + "Year of release: " + yearOfRelease + "\t"
              + "Music Genre: " + musicGenre + "\t"
              + "Comment: " + aComment + "\t" );
    }import java.util.*;
    public class readOperation{
         public String readString(String userInstruction)
              String aString = null;
              try
         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aString = scan.nextLine();
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aString;
         public char readTheFirstChar(String userInstruction)
              char aChar = ' ';
              String strSelection = null;
              try
                   //char charSelection;
         Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   strSelection = scan.next();
                   aChar = strSelection.charAt(0);
              catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aChar;
         public int readInt(String userInstruction) {
              int aInt = 0;
              try {
                   Scanner scan = new Scanner(System.in);
                   System.out.print(userInstruction);
                   aInt = scan.nextInt();
              } catch (InputMismatchException e) {
                   System.out.println("\nInputMismatchException error occurred (the next token does not match the Integer regular expression, or is out of range) " + e);
              } catch (NoSuchElementException e) {
                   System.out.println("\nNoSuchElementException error occurred (input is exhausted)" + e);
              } catch (IllegalStateException e) {
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return aInt;
    import java.util.Scanner;
    import java.util.InputMismatchException;
    import java.util.NoSuchElementException;
    public class errorCheckingOperation
         public int errorCheckingInteger(int checkThing, int lowerBound, int upperBound)
               int aInt = checkThing;
               try
                    while((checkThing < lowerBound ) || (checkThing > upperBound) )
                         throw new Exception("Invaild value....Please enter the value between  " +  lowerBound + " & " +  upperBound );
               catch (Exception e)
                 String message = e.getMessage();
                 System.out.println(message);
               return aInt;
           public int errorCheckingSelectionValue(String userInstruction)
                int validSelectionValue = 0;
                try
                     int selectionValue;
                     Scanner scan = new Scanner(System.in);
                     System.out.print(userInstruction);
                     selectionValue = scan.nextInt();
                     validSelectionValue = errorCheckingInteger(selectionValue , 1, 5);
               catch (NoSuchElementException e)
                   //if no line was found
                   System.out.println("\nNoSuchElementException error occurred (no line was found) " + e);
              catch (IllegalStateException e)
                   // if this scanner is closed
                   System.out.println("\nIllegalStateException error occurred (scanner is closed)" + e);
              return validSelectionValue;
    }Message was edited by:
    Ivan1238
    Message was edited by:
    Ivan1238

    You should thoroughly check you code. It's full of problems.
    For example in saveDate():
    You create a new empty ArrayList and then want so save it's contents. I guess, the file size is always 0.
    For example in loadDate():
    Since you read from an empty file you get an EOFException. This is ok and you should catch and treat the exception properly.
    You try to read the ArrayList instead of single MusicCd objects, although in saveDate you saved the single MusicCD objects. You can only read from the file what to saved in it before.
    I suggest to write the size of the ArrayList as first object in the file. Then you know how much you can expect to read when loading from the file.
    private void saveDate()
              try
                   File f = new File("jessica.txt");
                   FileOutputStream fos = new FileOutputStream(f);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                            oos.writeObject(new Integer(MusicCdList.size()));
                   for( MusicCd s : MusicCdList)
                   oos.writeObject(s);
                   oos.close();
              catch (IOException ioe)
                   ioe.printStackTrace();
         }

  • How to read date and time with Oracle_Loader (10g)

    ip pc username date time
    1.1.1.1 WS1 test 2000/01/01 01:01:01
    I am trying to read the date and time from data formatted as above from a .txt file.
    create TABLE test (IP char(20), OCID char(15), ID char(30), date_logon date, time_logon date)
    ORGANIZATION EXTERNAL (TYPE ORACLE_loader DEFAULT DIRECTORY phonebook
    ACCESS PARAMETERS (FIELDS TERMINATED BY WHITESPACE
    (IP char(20),
    OCID char(15),
    ID char(30),
    date_logon char(30) DATE_FORMAT DATE MASK "yyyy/mm/dd",
    time_logon char(30) date_FORMAT date MASK "hh24:mi:ss"))
    LOCATION ('test.log'));
    However, my external table returns a date (2007-05-01) AND the time for the time_logon column (e.g. 2007-05-01 01:01:01) . I just want the time (e.g. 01:01:01).
    What am I doing wrong?
    *I tried: date_logon char(30) DATE_FORMAT DATE MASK "yyyy/mm/dd hh24:mi:ss", reading both the date and time at the same time, but it doesn't work.
    Thanks.

    Justin, thank you so much for your help.
    When I try:
    SELECT a.ip, a.ocid, a.id, TO_CHAR( a.date_logon, 'DD-MON-YYYY HH24:MI:SS' )
    FROM test a
    date_logon entries are all dd-mon-yyyy and 00:00:00 (i.e. no time was stored).
    I don't have control over the text file, so I don't think I can make any changes to the formatting.
    I tried to declare the column as 'timestamp':
    date_logon char(60) DATE_FORMAT timestamp MASK "yyyy/mm/dd hh24:mi:ss",
    but time is still displayed as 00:00:00:000.... which leads me to suspect that the culprit is the space between date and time in the text file.
    Say if I have 2007/05/25 and 2007/05/01 16:19:23 in two separate date columns. Is it possible to grab the time from the second column and append it to the first column (while still retaining the DATE property, i.e. 2007/05/25 16:19:23).
    Thanks!

  • Read statement to read data and display in output table

    hi
    consider a scenerio as below
    int table in which data i already tehre gt_sagmeld (here primary key is guid_lclic)
    and matching field for next select is guid_mobj
    not corpar table is joined to butoo by  parno.
    and primary key of corpar is guid_corpar which has no link to gt_sagmeld
    and primary key of but00 is partner and it isjoined to corpar by but00-partner = corpar-parno
    adn i need to read but00-bpext
    pls see the below seelct statment for it
    gt_Saglemd has data...
    data: gt_sagmeld_temp like gt_sagmeld.
    gt_sagmeld_temp[] = gt_sagmeld[].
    delete adjacent duplicates from gt_sagmeld_temp[] comparing guid_mobj
    select       corpar~PAFCT 
                  corpar~parno     
                into table gt_corpar
        from    corpar
        for all entries in gt_sagmeld_temp
        where  /sapsll/corpar~guid_mobj = gt_sagmeld_temp-guid_mobj
        and    /sapsll/corpar~PAFCT = 'SH'.
    sort gt_corpar by parno.
    delete adjacent duplicates from gt_corpar comparing parno.
    select but000~partner
           but000~bpext
       from but000 into table gt_but001
    for all entries in gt_corpar
    where  but000~partner = gt_corpar-parno.
    now the table gt_but001 contans the required bpext
    and i want to read it to outtab
    reading...
    loop at gt_satmeld into wa_gt_sagmeld
    some field selection....
    now how to read the bpext in this loop from but001
    as there is table corpar also and then but001
    read table gt_but000 into wa_but000
      with key  partner = corpar-parno
    ...but this will not work as firs i need to read corpar also so how to use the loop or what is procedure to read ...
    pls suggest

    Hi,
    It is very much possible.
    1. You can create a new table in SE11/SE12 and u can create this table as a maintainable table( able to maintain entries). An ABAPer can help you to enable this table as maintainable one.
    2. If you know the name of the maintainable table, you can maintain entries directly in SM30. If you need a tcode for this, you can also do this by creating a tcode in SE91 for the table.
    3. If you know the tcode, you can directly view and download the entries using the tcode itself.

  • Doubt in inserting Date and time into the table

    Hi i have created a table with two columns "Order_ID" and "Order_date" as
    create table test
    order_id integer,
    order_date date default sysdate
    Now i insert one row as
    insert into test(order_id) values(1);
    now i get the output as
    ORDER_ID ORDER_DAT
    1 05-JUN-12
    But i need to insert the current system time also into the Order_date column.
    How can i achieve this ???

    it works OK for me!
    bcm@bcm-laptop:~$ sqlplus user2/user2
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 4 20:19:57 2012
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    20:19:58 SQL> @test1
    20:20:01 SQL> create table test1
    20:20:01   2  (
    20:20:01   3  order_id integer,
    20:20:01   4  order_date date default sysdate
    20:20:01   5  );
    Table created.
    20:20:01 SQL>
    20:20:01 SQL> insert into test1(order_id) values(1);
    1 row created.
    20:20:01 SQL> select * from test1;
      ORDER_ID ORDER_DATE
          1 2012-06-04 20:20:01
    20:20:01 SQL>

  • How to transfer data of RFC into Internal Table inside a WD4A program?

    Hi Experts,
    I have created WD4A program. This program calls RFC. The output of RFC has to populate  a UI table. THe different cells of the table should have different color based on data.
    I have gone through following link:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/707fb792-c181-2d10-61bd-ce15d58b5cf1
    The above link fetches data from directly from table. Then it passes the data into internal table.
    If I am using RFC, then how I can insert data of RFC into a internal table in WD4A program (se80 In drop down Web Dynpro Comp / Intf)
    My motto is to have table ouput whose different cells should have different color based on data.
    Please help.
    Regards,
    Gary
    Edited by: Jason Lax on Dec 28, 2011 2:52 PM (Fixed broken link)

    Hi Experts,
    I have resolved the issue. I have created WD4A program. This WD4A program calls the RFC.
    The RFC has a structure as export parameters called 'RESULT_FINAL'. I have altered the associated type of this table export parameter. I added Component 'Color' of component type 'WDUI_TABLE_CELL_DESIGN'.
    In the RFC I have added some code. The code is as below:
    loop  at it_t1.
          select pernr from pa0000 into table it_t2 where  pernr = it_t1-pernr  and stat2 ='3'
          and begda <= sy-datum AND endda >= sy-datum.
          if sy-subrc = 0.
            result_final-org_unit = result_objec-objid.
            result_final-pernr = it_t1-pernr.
            result_final-name = it_t1-name.
            result_final-color = '02'.       append result_final.
          endif.
        endloop.
    The line   result_final-color = '02'.   
    code returns Color.
    In the WD4A program, I have changed the Cell Design property of selected table coloumn to Color.
    This resolved the issue.
    Thanks every one for the reply.
    I have added above information for other SDN users.
    I am closing this thread,
    Regards,
    Gary

  • How to read data from idoc to internal table?

    Hi
    How to get data from idoc segments to internal table?

    Hi
    Check this ex
    The following coding sample, shows how you may read a MATMAS IDoc and extract the data for the MARA and MARC segments to some internal variables and tables.
    DATA: xmara LIKE mara.
    DATA: tmarc LIKE marc
                OCCURS 0
                WITH HEADER LINE.
    LOOP AT edidd.
       CASE edidd-segnam.
         WHEN 'E1MARAM'.
              MOVE edidd-sdata TO xmara.
         WHEN 'E1MARCM'.
           MOVE edidd-sdata TO tmarc.
              APPEND tmarc.
       ENDCASE.
    ENDLOOP.
    now do something with xmara and tmarc.
    hope this helps you...
    Reward points if useful..
    Regards
    Sreenivas

  • Oracle DB: How to read data from a corrupted database table.

    Hi All,
    Wanted to know if there is a way I could read data from a corrupted Oracle database table?
    Are there any tools that I can use? Or does Oracle provides any mechanism to do that?
    Any pointers in this regard would be helpful.
    Thanks in Advance.

    user10600611 wrote:
    Table shows inconsistent data.You are going to have to be more specific. Inconsistent in what sense? A correct data model should not allow for inconsistencies to crop up.
    However, you may be able to use one of the many FLASHBACK features of Oracle to look at the table at a prior point in time before the corruption.
    HTH!

  • Does anyone know how to read .data and/or .response files on/through Dreamweaver?

    Or any other safe program?
    I really need to get the code asap.  If you can help it would be much appreciated.

    Hi,
    I concur with Nancy in that you'll want to open/read the file in those suggested plain text editors if needing access to the code. 
    Kind regards,
    -Sidney

  • How to import Data (For Dummies) into a table

    I have a excel spreadsheet that is an export of an oracle database table. I want to now import that data into another Oracle Database (same table and format). What is the best way to do that. Someone told me t ouse SQL*Loader, but that is not as straightforward as I had hoped. I tried to use access, but I got an invalid argument on one attempt, and a Reserved Error (-2007) on another attempt.
    Any help would be appreciated.

    Now it seemed to run w/o the INSERT error this time, but now when I look at the log, i see the following errors:
    SQL*Loader: Release 9.2.0.1.0 - Production on Tue Jun 27 10:29:01 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Control File: sqlloader-ctrl.ctl
    Data File: import.txt
    Bad File: import.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table INQUIRIES, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    INQUIRYID FIRST * WHT O(") CHARACTER
    PERSONID NEXT * WHT O(") CHARACTER
    FIRSTNAME NEXT * WHT O(") CHARACTER
    LASTNAME NEXT * WHT O(") CHARACTER
    ADDRESS1 NEXT * WHT O(") CHARACTER
    ADDRESS2 NEXT * WHT O(") CHARACTER
    ADDRESS3 NEXT * WHT O(") CHARACTER
    CITY NEXT * WHT O(") CHARACTER
    STATE NEXT * WHT O(") CHARACTER
    ZIPCODE NEXT * WHT O(") CHARACTER
    COUNTRY NEXT * WHT O(") CHARACTER
    SEX NEXT * WHT O(") CHARACTER
    MATRICDATE NEXT * WHT O(") CHARACTER
    DEGREEPROGRAM NEXT * WHT O(") CHARACTER
    PACKETCODE NEXT * WHT O(") CHARACTER
    SOURCECODE NEXT * WHT O(") CHARACTER
    NONUS NEXT * WHT O(") CHARACTER
    DUPLICATE NEXT * WHT O(") CHARACTER
    EMAIL NEXT * WHT O(") CHARACTER
    INQUIRYDATE NEXT * WHT O(") CHARACTER
    NOTES NEXT * WHT O(") CHARACTER
    GOODCANDIDATE NEXT * WHT O(") CHARACTER
    POSTED NEXT * WHT O(") CHARACTER
    LABELPRINTED NEXT * WHT O(") CHARACTER
    PHONE NEXT * WHT O(") CHARACTER
    PERMANENTRESIDENCE NEXT * WHT O(") CHARACTER
    LABELPRINTDATE NEXT * WHT O(") CHARACTER
    LASTMODIFIED NEXT * WHT O(") CHARACTER
    MODIFYINGUSER NEXT * WHT O(") CHARACTER
    APPRECEIVED NEXT * WHT O(") CHARACTER
    INTERVIEWED NEXT * WHT O(") CHARACTER
    INTERVIEWEDDATESCHEDULED NEXT * WHT O(") CHARACTER
    INTERVIEWEDDATE NEXT * WHT O(") CHARACTER
    INTERVIEWEDBY NEXT * WHT O(") CHARACTER
    INTERVIEWEDRATING NEXT * WHT O(") CHARACTER
    DUALDEGREE NEXT * WHT O(") CHARACTER
    Record 1: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 3: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 4: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 5: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 6: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 7: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 8: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 9: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 10: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 11: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 12: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 13: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 14: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 15: Rejected - Error on table INQUIRIES, column PERMANENTRESIDENCE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 16: Rejected - Error on table INQUIRIES, column PHONE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 17: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 18: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 19: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 20: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 21: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 22: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 23: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 24: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 25: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 26: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 27: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 28: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 29: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 30: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 31: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 32: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 33: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 34: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 35: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 36: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 37: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 38: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 39: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 40: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 41: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 42: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 43: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 44: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 45: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 46: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 47: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 48: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 49: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 50: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 51: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
    Table INQUIRIES:
    0 Rows successfully loaded.
    51 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 250776 bytes(27 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 51
    Total logical records rejected: 51
    Total logical records discarded: 0
    Run began on Tue Jun 27 10:29:01 2006
    Run ended on Tue Jun 27 10:29:01 2006
    Elapsed time was: 00:00:00.21
    CPU time was: 00:00:00.05
    So now i need to do some google searching to see what those erros mean...... ahh the life of IT... ya gotta love it

Maybe you are looking for

  • Can an aftermarket display tax the USB bus?

    I just had a very weird issue, I purchased a 22" samsung DVI display I got pretty cheap off of Ebay, I originally was using a 20" Cinema Display and love it, but I want like most of us I guess ,more real estate. The Samsung has no USB ports as the Ap

  • Using fragments as an alternative to copy/paste

    Not really a question, but I thought I would toss this out there in case it helps anyone else. I have been working to implement a new feature on an audit form. I have learned to test on small, easy to piece together sample documents and once it's wor

  • Why am I unable to sign in to app store or iTunes store?

    I am unable to sign into my apple ID to use app store because it says the ID hasn't been used in ITunes store. But it won't let me do that either.

  • How to find missing music

    I backed-up my iTunes on an external drive and then did a system restore on my computer. The 'restore' didn't take iTunes out but left it empty. Transfered everything from the external back to the computer and plugged in the iPod ...... AAARRRRRGGGGH

  • Determine Which Library to Install when ClassDefNotFound

    Hi Experts, I'm deploying an app which utilizes ADF and Webcenter features when hit below error: <ADF: Adding the following JSF error message: oracle/fodemo/storefront/store/service/common/StoreServiceAM java.lang.NoClassDefFoundError: oracle/fodemo/