Truncation words in SQL seperated by Pipe Symbol

Hi All,
I have a String like this: "6.362636.10|6.362636.10.00.100000|o123456789123|1122334455|PrepaidRecharge|30.00|CC|AMERICANEXPRESS".
I need to take each string seperated by pipe symbol and export to seperate columns using SQL. Kindly help me in doing this.
Regards,
Prabhu

Hi All,
Any hint for the above query?
Regards,
Prabhu

Similar Messages

  • How to include the Pipe symbol ("|") in the column heading.

    Hi ,
    Can somebody advice how to include the Pipe symbol ("|") in the column heading.
    Regards,
    Yagne

    Are you looking for this ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>set colsep '|'
    satyaki>
    satyaki>select * from emp;
         EMPNO|ENAME     |JOB      |       MGR|HIREDATE |       SAL|      COMM|    DEPTNO|JOB1     |DOB
    ----------|----------|---------|----------|---------|----------|----------|----------|---------|----
          7499|ALLEN     |SALESMAN |      7698|20-FEB-81|     211.2|       300|        30|SALESMAN |
          7521|WARD      |SALESMAN |      7698|22-FEB-81|      1650|       500|        30|SALESMAN |
          7654|MARTIN    |SALESMAN |      7698|28-SEP-81|      1650|      1400|        30|SALESMAN |
          7788|SCOTT     |ANALYST  |      7566|19-APR-87|      4356|          |        20|ANALYST  |
          7839|KING      |PRESIDENT|          |17-NOV-81|      6600|          |        10|PRESIDENT|
          7844|TURNER    |SALESMAN |      7698|08-SEP-81|      1980|         0|        30|SALESMAN |
          7876|ADAMS     |CLERK    |      7788|23-MAY-87|     145.2|          |        20|CLERK    |
          7900|JAMES     |CLERK    |      7698|03-DEC-81|      1254|          |        30|CLERK    |
          7902|FORD      |ANALYST  |      7566|03-DEC-81|    4791.6|          |        20|ANALYST  |
          7934|MILLER    |CLERK    |      7782|23-JAN-82|      1716|          |        10|CLERK    |
          7566|Smith     |Manager  |      7839|23-JAN-82|      1680|         0|        10|Manager  |23-JAN-89
         EMPNO|ENAME     |JOB      |       MGR|HIREDATE |       SAL|      COMM|    DEPTNO|JOB1     |DOB
    ----------|----------|---------|----------|---------|----------|----------|----------|---------|----
          7698|Glen      |Manager  |      7839|23-JAN-82|      1680|         0|        10|Manager  |23-JAN-89
          1111|Selen     |SALESMAN |      7499|20-FEB-81|      1920|         0|        20|SALESMAN |23-JAN-89
          1111|Selen     |SALESMAN |      7499|19-OCT-08|      3000|         0|        10|         |
          7499|ALLEN     |SALESMAN |      7499|19-OCT-08|      3000|         0|        30|         |
             1|boock     |         |          |         |          |          |          |         |
    16 rows selected.
    Elapsed: 00:00:01.03
    satyaki>Regards.
    Satyaki De.

  • Text file contains data separated by pipe symbol read the data and saved in

    Hi ,
    This is Sreedhar, i am new to java. my query is Report its in text file format it contains data like GLNO,name ,amount. All fields are separated by pipe(|) symbol. I would like to read that
    data and saved into the database. Please anyone can help me.

    thx Ottobonn.
    Scanner is very usefull with string operation like in my problem..but i want try to find java.util.Scanner in j2me, i can't found this class...:(
    so, may be i can't use this class in j2me...
    i new in java, so i try myself to code the simple method for my problem,
    may be anyone can make this class more simple than my coding....:)
    public StringPipe(String _msg){
            String message = _msg;
            int pipe = 0;
            int lengthmessage = message.length();
            int lengthMsgresult = 0;
            while(lengthMsgresult<=lengthmessage){
                String msg = null;
                int pipeX = message.indexOf("|");
                if(pipeX==-1){
                    msg = message;
                else{
                    msg = message.substring(pipe, pipeX);
                    message = message.substring(pipeX+1, message.length());
                    lengthMsgresult += msg.length();  
                // the string seperated by pipe
                System.out.println("msg = " + msg);
                if(pipeX==-1){
                   break;
    }thx...

  • Are Truncate and Trunc SQL ISO ANSI compliance ?

    Somebody has idea of
    which of the statements TRUNCATE and TRUNC are SQL ISO ANSI compliance ?
    is Truncate a function or a statement ?
    Thanks
    Nelson

    perhaps this answer has the potential to add some confusing, but maybe it shows a little problem with ANSI compliance:
    For Oracle a TRUNCATE TABLE is a DDL operation that includes an implicit commit preventing a rollback:
    -- Oracle 11.2.0.1
    SQL> create table t(a number);
    Tabelle wurde erstellt.
    SQL> insert into t(a) values(1);
    1 Zeile wurde erstellt.
    SQL> commit;
    Transaktion mit COMMIT abgeschlossen.
    SQL> truncate table t;
    Tabelle mit TRUNCATE geleert.
    SQL> rollback;
    Transaktion mit ROLLBACK rückgängig gemacht.
    SQL> select * from t;
    Es wurden keine Zeilen ausgewählt
    Sorry about the german sqlplus feedback - but I think the result is clear: the table is empty after the truncate and the data is gone.
    But for MS SQL Server a TRUNCATE can be rolled back:
    -- SQL Server 2008
    drop table t;
    create table t(a int);
    insert into t(a) values(1);
    begin transaction
    truncate table t;
    rollback;
    select * from t;
      a
      1
    Microsoft also defines TRUNCATE as DDL - http://msdn.microsoft.com/en-us/library/ff848799.aspx - but the behavior is quite different. So ANSI compliance does not mean that much (I have absolutly no idea which of the two solutions is more ANSI compliant in this case).
    Regards
    Martin

  • How to insert Pipe symbol

    Could anybody say me how to use the pipe symbol in BPC.I am not able to find pipe symbol in keyboard.
    Thanks
    ranjan

    hey,
    Copy it here 
    |
    And past it there.....
    Or you can use the asc code
    ALT + 124
    Use your numeric keyboard, if you are using a laptop, activate you NUM LOCK key.
    LMAO
    Leandro Brasil

  • SQL-Loader and Pipes

    I have to insert 300.000.000 datasets (generated dynamically by a seperate process) into an Oracle 8.1.6 database. I'd like to do this via SQL-Loader but since Linux (kernel 2.2 at least) supports only files up to 2Gigs and I don't have the necessary space on my machine to generate a large amount of ASCII files I'd like to ask whether there is a possibility to use an ordinary pipe in combination with SQL-Loader. I tried to use a named pipe but all my attempts failed.
    I don't like to use Perl and the DBI module since this would be far so slow (would take about one week I guess).
    Hans

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL*Loader and pipe on unix

    On unix is it possible to pipe the data to be loaded in to SQL*Loader instead of reading it from file? I have a program that generates data that is to be loaded, and it is a bit waste of time to first save it to file, just to read it back in.

    Yes, it's possible :
    TEST@db102 SQL> desc test1
    Name                                                  Null?    Type
    A                                                              VARCHAR2(20)
    B                                                              VARCHAR2(20)
    TEST@db102 SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    [ora102 work db102]$ cat test1.dat
    aaaaa,bbbbb
    ccccc,ddddd
    eeeee,fffff
    [ora102 work db102]$ cat test1.ctl
    load data
    replace
    INTO TABLE test1
    fields terminated by ','
    trailing nullcols
    a, b
    [ora102 work db102]$ cat test1.dat | sqlldr test/test control=test1.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon Sep 25 14:29:50 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 3
    [ora102 work db102]$ sqlplus test/test
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 25 14:29:58 2006
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    TEST@db102 SQL> select * from test1;
    A                    B
    aaaaa                bbbbb
    ccccc                ddddd
    eeeee                fffff
    TEST@db102 SQL>                                                                                        

  • String Truncation Exception in SQL Server

    I get an error when issuing an updateRow() after updateString("String Field", "Test"). My exception is:
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]String data
    , right truncation
    at sun.jdbc.odbc.JdbcOdbcResultSet.setPos(JdbcOdbcResultSet.java:5068)
    at sun.jdbc.odbc.JdbcOdbcResultSet.updateRow(JdbcOdbcResultSet.java:4053
    at exuberance.remote.JDBCClient.setFieldValue(JDBCClient.java:446)
    I believe this occurs because Java stores strings in Unicode (2 bytes), but I'm not positive. Any help would be much appreciated.

    You are passing a string that is too big.
    Possibilities:
    -String you are passing is bigger than field it is being inserted into.
    -Total length of SQL call exceeds the max len limit (8000?, 2174?)
    -The string is a actually a 'blob' type of string (greater than 8000 on MS SQL?) and you need to use the same sort of handling for blobs to pass it.

  • SQL*Loader Named Pipe Load Thread goes to 0

    Hi,
    Running SQL*Loader 10.2.0.1.0 on XP pro against 10g EE 10.2.0.2.0 Production, RAC.
    Control file:
    OPTIONS ( MULTITHREADING=TRUE, DIRECT=TRUE, ROWS=5000000, COLUMNARRAYROWS = 200000 )
    UNRECOVERABLE
    LOAD DATA
    --INFILE 'C:\Program Files\Delta Data Software, Inc\DDS Twenty Two C\SQL_LOADER\LDR.DAT' "fix 427"
    INFILE '\\.\pipe\testpipe' "fix 427"
    BADFILE 'C:\Program Files\Delta Data Software, Inc\DDS Twenty Two C\DataGen\S-INTERSP-DL.bad'
    DISCARDFILE 'C:\Program Files\Delta Data Software, Inc\DDS Twenty Two C\DataGen\S-INTERSP-DL.dsc'
    INSERT
    INTO TABLE "TDW999999"
    Data File is 1 million row text file, 427 byte per line
    Problem:
    When calling SqlLdr directly against the data file, the import runs in 1:47(min\secs).
    Total stream buffers loaded by SQL*Loader main thread: 408
    Total stream buffers loaded by SQL*Loader load thread: 2036
    However, when I pipe the same data to SqlLdr via a simple c# application with a named pipe, it takes 5:56(mins\secs).
    Pipe Base Load:
    Total stream buffers loaded by SQL*Loader main thread: 104249
    Total stream buffers loaded by SQL*Loader load thread: 0
    It looks like SqlLdr can not go parallel when input is from a named pipe.
    Any Ideas on how I can get my load thread count back up when using pipes ?
    Thanks

    Hi,
    According to http://www.mcse.ms/archive27-2006-1-2068094.html you can do the following (substitute your c# program for 'type load.dat'):
    >
    type load.dat|sqlldr control=load.ctl userid=user/password data=\"-\"
    Alternative (for both , unix and windows)- infile syntax:
    load data
    infile "-"
    into table...
    Metalink note 191043.1 may be interesting for you as well.
    Does the performance then improve?
    Cheers,
    Colin

  • Urgent!!!! - Problem in storing encrypte word into SQL Server database

    Hi,
    I want to encrypt a word using DES algorithm and store in the database.I am using Microsoft SQL Server 2000 database. I have tried giving the datatype as varchar,binary etc. but i am not able to store a byte array.Here is my code. Plz help me to store the encrypted word in the database.
    import javax.crypto.Cipher;
       import javax.crypto.BadPaddingException;
       import javax.crypto.IllegalBlockSizeException;
       import javax.crypto.KeyGenerator;
       import java.security.Key;
       import java.security.InvalidKeyException;
       import java.io.*;
       import java.sql.*;
       public class PwdEnc {
            private static String algorithm = "DESede";
            private static Key key = null;
            private static Cipher cipher = null;
            private static void setUp() throws Exception {
                key = KeyGenerator.getInstance(algorithm).generateKey();
                cipher = Cipher.getInstance(algorithm);
            public static void main(String[] args)
               throws Exception {
                setUp();
                byte[] encryptionBytes = null;
                String input = "akshatha34";
                encryptionBytes = encrypt(input);
                try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con=DriverManager.getConnection("jdbc:odbc:SQLDB1","sa","projguru");
                   Statement st=con.createStatement();
                   System.out.println(encryptionBytes);
              //     String s1="Insert into tblLogin values("+encryptionBytes+","+encryptionBytes+")";
                   String s1="Insert into tblLogin values("+encryptionBytes+")";
                   System.out.println(s1);
                   int rs=st.executeUpdate(s1);
                   if(rs>=1)
                   System.out.println("inserted");
                   else
                   System.out.println("failed");
              }catch(Exception e){
                   System.out.println(e);
                   for(int i=0;i<encryptionBytes.length;i++)
                        System.out.println(encryptionBytes);
                   System.out.println(encryptionBytes);
    private static byte[] encrypt(String input)
    throws InvalidKeyException,
    BadPaddingException,
    IllegalBlockSizeException {
    cipher.init(Cipher.ENCRYPT_MODE, key);
    byte[] inputBytes = input.getBytes();
    return cipher.doFinal(inputBytes);
    thanks,
    Akshatha

    Try using a Prepared statement and setBytes;
    PreparedStatment insert = con.prepareStatement("Insert into tblLogin values(?)");
    insert.setBytes(1, encryptionBytes);
    insert.executeUpdate();

  • Right Truncation, varchar in SQL Server, double-byte in Oracle

    Hi.
    We have a DB Link using DG4MSQL from Oracle 11.1.0.7.0 to a SQL Server 2005 database. The Oracle database is set up to use UTF-8 so all character fields are double-byte on the oracle side.
    On the SQL Server table we have a column defined as varchar(32). When doing a select * from this table (from Oracle, over the DB link), everything works fine if that column contains values with a length of 16 characters or less. When the column contains 17 - 32 characters we get the following error:
    Error report:
    SQL Error: ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Oracle][ODBC SQL Server Driver]String data, right truncation {01004}
    ORA-02063: preceding 2 lines from SQLUAT
    28500. 00000 - "connection from ORACLE to a non-Oracle system returned this message:"
    *Cause:    The cause is explained in the forwarded message.
    *Action:   See the non-Oracle system's documentation of the forwarded
    message.
    It looks like Oracle (or the ODBC driver) is bringing the data back as double-byte even though it is declared as varchar. If we change the column on the SQL server side to nvarchar, everything works fine.
    Is this a bug? Or is there a setting that can be specified for the gateway so that it recognizes SQL Server varchar columns as single-byte, to prevent them from coming over as double-byte and messing up the ODBC driver? Or is there anything else we should do to prevent this problem?
    Thanks

    Hi,
    I don't think it's a problem with the hs or the dblink (but I may be wrong):
    UTF-8 is double-bytes as you said. when you declare varchar2(32) it actually means you can insert up to 32 bytes --> 16 characters.
    even if you do a simple insert to the table with more than 16 characters - it will fail.
    In order to overcome this you should declare the table with varchar2(32 char) which will tell Oracle to allocate enough bytes to hold 32 chars - not bytes. In UTF-8 this means 64 bytes (2*n). If you'd be using AL32UTF-8 this would mean 4*n.
    BTW- why are you using UTF-8 and not AL32UTF8?
    Hope this helps.

  • N800 - How to get the pipe symbol AKA vertical bar...

    Hi... the N800 is one slick device. But I have Xterminal installed on it, and I just can't find the vertical bar needed to construct a UNIX command line with pipes. I've checked the screen keyboard, shifted, and also the extended symbol selection. It doesn't seem to show up anywhere. Has anybody found it?
    Thanks,
    Andy

    Michel Boissonneault wrote:
    Hi(Bonjour)!
    Try Option-G on english keyboard.
    Do you know this little widget:
    http://www.tacowidgets.com/widgets/characterpal/
    Very useful.
    Michel Boissonneault
    Thanks Michael, this is cool as it eliminated the need to remember short cut keys !!

  • Truncating Log file - SQL

    Hi All,
    We need some help in reducing the size of our log files.
    Our database has grown to 17gig and our log file is just over 12gig. Our database recovery model is "full".
    We are running complete backups once a night, and also doing an hourly transaction log backup. I have tried right clicking the database in EM->all tasks->shrink database and specifically selected the log file and clicked ok, as well as just clicking ok, but there seems to be no effect.
    Can anyone outline how to do this? From what I can tell, we are only using around 50Mb of the logfile and the rest is just empty space!
    Thanks
    Rajiv

    Ok, lets split this up into 2 issues to keep things simple:
    1. In our present situation (using the FULL recovery model), we are performing a full backup every night. We are also backing up the transaction log every hour during working hours. In this scenario, from what I understand the transaction log file should be truncated to the point of backup. This is not happening on my server, so I am asking for guidance as to the best way to investigate why this is happening, and then of course the best way of truncating the file manually (T-SQL?).
    2. In terms of the recovery model, in our business people phone in with orders, payments etc which are all input directly into B1. We physically wouldn't be able to recover back to the previous day/last full backup, as alot of the input data isn't on paper/email. I have done a test restore with backup + logs etc previously - it's not difficult per se, just lo-ong =).
    The change in hardware works 2 ways... yes, you're right in that hardware may be more reliable, but the basic business need for recovery in the event of failure remains unchanged (in our specific case). In contrast however, as the hardware gets faster and faster, our 17gig DB + logfile (note, this should be nowhere near 12gig) will not be as incumbent as perhaps one might expect on our file server. Now if we can do full backups semi-transparently using the simple model every hour on newer hardware... that's one less thing to worry about! =)

  • Truncated Word Docs

    When I convert from PDF to Word using the Adobe Export PDF it is truncating the top of my document?  Any ideas?

    Thanks but I searched and searched there.  Nothing listed that addresses this issue.  Am I the only person to upgrade to 10.6 and have a problem with seeing type in Word afterwards?  Does anyone understand what the error message means?

  • Adobe Flash CS5 - help needed animating a sentence so each word fades in seperately

    I am attempting to make a simple music video.
    My aim is to have lyrics to the piece of audio appear in synchronisation.
    There does not seem to be a simple way to fade in (and out) each word singularly allowing the alignment and sentence position to remain constant.
    Please help.

    Put the words on the stage as you want them to show when completed. Set that layer in the timeline as a masked layer. Add a new layer on top of that layer, set it to be a mask layer. In this new layer draw a rectangle that covers just the first word of your text. Move down a few frames and add a new keyframe to the mask layer. At this keyframe make the rectangle larger, to cover two words. Repeat as needed until all of the words are covered.
    Here is a link to a video that shows something similar: Flash Masking Tutorial - YouTube

Maybe you are looking for

  • Please help I keep on getting a failed message and can't find help anywhere

    I switched computers and could not switch songs on my iTunes, even after following instructions, so I did it on my own. I clicked the transfer and sync option, knowing it would replace all my iPod songs with whatever was on my iTunes. Now I can only

  • How to remove mouseover help in WDA?

    Hello Guys, I am getting mouse over kind of help whenever I am taking mouse cursor over inputfield or button. we are on ERP 6.0 EhP4 system. for e.g. button with name Process, the text is "Process - Button -  Process - To activate, press spacebar" In

  • Best Way To Update To Anna ?

    Hi All Just wondering what is the best way to do a clean install of Anna on the N8. Is it best to do a hard reset before you install Anna, after you install Anna, or not at all. I have never reset my N8 since I got it on release, and would like to ha

  • Pop Up windows -  Apache Beehive Vs Weblogic workshop

    Hi, I was going through this open source project called Beehive by apache. and they have a very much similar model of pageflows as weblogic workshop using struts and netui tag library. But, their netui tag library has more tags and options too. I was

  • OATS: trying to use switch statement.

    Hi All, I am trying to use the case statement in my functional script. I am inserting the value in text-box lets say 1 , 2 , 3 ,4. and have created the Databank as Value in text-box               Name 1                                      A 2