Substr and instr for long column

Plesae need support ,how can use instr and substr function for column with long datatype
select substr(rec,1,(instr(rec,'?',1))) from F_DE_O_HISTORY_QUEUE_PRE_TST2
rec column is long,When execute this select message displayed as ORA-00932: inconsistent datatypes: expected NUMBER got LONG

Try to create a global temporary table and work on this table using DBMS_LOB.INSTR and DBMS_LOB.SUBSTR:
SQL> desc t;
Name                                      Null?    Type
X                                                  NUMBER(38)
Y                                                  LONG
SQL> create global temporary table tmp on commit preserve rows as select x, to_lob(y) as y from t ;
Table created.
SQL> desc tmp;
Name                                      Null?    Type
X                                                  NUMBER(38)
Y                                                  CLOBEdited by: P. Forstmann on 19 janv. 2010 12:42

Similar Messages

  • Substr and instr for variables assginement in a csv file

    Hi gurus
    Belows is my input csv file like with no fixedl enght
    vinput_file:
    WESTERN SAHARA,Moroccan Dirham,MAD,504,2,
    YEMEN,Yemeni Rial,YER,886,2,
    ZAMBIA,Zambian Kwacha,ZMW,967,2,
    ZIMBABWE,Zimbabwe Dollar,ZWL,932,2,
    and i want to assign 3 letter alphabetical to DESC and the 3 digit numerical to CODE
    CODE := SUBSTR(vinput_rec,1,INSTR(vinput_file,',',1,1)-1);
    DESC := SUBSTR(vinput_rec, INSTR(vinput_file,',',1,1)+1);
    can anyone help me please with the above kindly

    Hi,
    Sorry, it's not clear what you want.
    975482 wrote:
    Hi gurus
    Belows is my input csv file like with no fixedl enghtIf you read the file as an external table, each comma-delimited substring will be a column. It should be easy to use SUBSTR on those columns
    vinput_file:
    WESTERN SAHARA,Moroccan Dirham,MAD,504,2,
    YEMEN,Yemeni Rial,YER,886,2,
    ZAMBIA,Zambian Kwacha,ZMW,967,2,
    ZIMBABWE,Zimbabwe Dollar,ZWL,932,2,
    and i want to assign 3 letter alphabetical to DESC and the 3 digit numerical to CODE
    CODE := SUBSTR(vinput_rec,1,INSTR(vinput_file,',',1,1)-1);
    DESC := SUBSTR(vinput_rec, INSTR(vinput_file,',',1,1)+1);
    can anyone help me please with the above kindlyIf str is a comma-delimited string, and you want to the first 3 characters after the N-th comma, then you can use
    SUBSTR ( str
           , 1 + INSTR (str, ',', 1, n)
           , 3
           )Do you need to worry about not having 3 characters between the N-th comma and the next one? What if there are fewer than N commas?
    I hope this answers your question.
    If no, what is your question?
    Does it involve reading a csv file that is not already in a table? Post a small sample file.
    Does your qestion involve parsing strings that are already in a table? Post CREATE TABLE and INSERT statements.
    In any case, post the exact results you want from the given data.
    See the forum FAQ {message"id=9360002}

  • How to Split the string using Substr and instr using loop condition

    Hi every body,
    I have below requirement.
    I need to split the string and append with single quotes('') followed by , (comma) and reassign entire values into another variable. so that i can use it where clause of update statement
    for example I am reciveing value as follows
    ALN varchar2(2000):=(12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434);
    Note: In the above variable i see 8 transactions, where as in real scenario i donot how many transaction i may recive.
    after modification i need above transactions should in below format
    ALTR Varchar2(2000):=('12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434');
    kindly help how to use substr and instr in normal loop or for loop or while loop while modifying the above transactions.
    Please help me to sort out this issue.
    Many Thanks.
    Edited by: user627525 on Dec 15, 2011 11:49 AM

    Try this - may not be the best way but...:
    create or replace type myTableType as table of varchar2(255)
    declare
    v_array mytabletype;
    v_new_str varchar2(4000);
    function str2tbl
             (p_str   in varchar2,
              p_delim in varchar2 default '.')
             return      myTableType
        as
            l_str        long default p_str || p_delim;
             l_n        number;
             l_data     myTableType := myTabletype();
        begin
            loop
                l_n := instr( l_str, p_delim );
                exit when (nvl(l_n,0) = 0);
                l_data.extend;
                l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
                l_str := substr( l_str, l_n+length(p_delim) );
            end loop;
            return l_data;
       end;
    begin
      v_array := str2tbl ('12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434', ',');
          FOR i IN 1 .. v_array.COUNT LOOP
             v_new_str := v_new_str || ''''||v_array(i)||'''' || ',';
          END LOOP;
       dbms_output.put_line(RTRIM(v_new_str, ','));
    end;  
    OUTPUT:
    =======
    '12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434'HTH
    Edited by: user130038 on Dec 15, 2011 12:11 PM

  • Substri and instr problem --Please help

    Hi ,
    I would like to get the find tablename starts with 'EXP' using substring and instring . I am using oracle 9i. Please help me out
    Example : 'Schema.explogtable'
    I will use table name ' EXP' in one of my procedure as input parameter to procedure
    If tablename= substr('schema.explogtable','instr('schema.explog','.',1,3) then
    Execute Procedure1('tablename')
    Else
    Execute procedure2('tablename')
    I would appreciate your help
    Regards,
    Clarkc

    ClarkC,
    Here just replace procedure1 and procedure2 with your procedure names;
    create table temp_table
    ( table_name varchar2(30)
    insert into temp_table values ('TESTME.MY_OBJECTS');
    insert into temp_table values ('TESTME.OBJECTS');
    insert into temp_table values ('ABC.ECFOBJECTLOG');
    insert into temp_table values ('XYZ.BDEOBJECTTABLE');
    insert into temp_table values ('ABC.ABCTABLE');
    insert into temp_table values ('ZYD.CLIENTTABLE');
    insert into temp_table values ('NMS.CLIENTLOGTABLE');
    COMMIT;
    pl/sql anonymous blocks  I defined 2 variables for readibility and understanding
    DECLARE
       CURSOR tcur
       IS
          SELECT table_name
          FROM temp_table;
       table_name   VARCHAR2 (40);
       my_table     VARCHAR2 (40);
    BEGIN
       FOR cur IN tcur
       LOOP
          my_table     := NULL;
          my_table     := cur.table_name;
          table_name   := SUBSTR (my_table, INSTR (my_table, '.') + 1);
          IF (table_name LIKE ('%OBJ%'))
          THEN
             DBMS_OUTPUT.put_line ('table_name containing OBJ=' || table_name);
             -- NOTE : CALL YOUR PROCEDURE1 HERE for tables containing OBJ;
            procedure1(table_name);
          ELSE
             DBMS_OUTPUT.put_line('table_name  not containing OBJ=' || table_name);
               -- NOTE : CALL YOUR PROCEDURE2 HERE for tables not containing OBJ;
            procedure2(table_name);
          END IF;
       END LOOP;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 300));
          RAISE;
    END;
    Here is the output of the above block
    table_name containing OBJ=MY_OBJECTS
    table_name containing OBJ=OBJECTS
    table_name containing OBJ=ECFOBJECTLOG
    table_name containing OBJ=BDEOBJECTTABLE
    table_name  not containing OBJ=ABCTABLE
    table_name  not containing OBJ=CLIENTTABLE
    table_name  not containing OBJ=CLIENTLOGTABLEHope this helps
    Regards
    Edited by: OrionNet on Jan 17, 2009 11:48 AM

  • SUBSTR and INSTR function

    Hi Gurus,
    I have the data as follows:
    data
    'BIDIE01H/TXT:ZUNE=HA011, CellIndex=144 /CAI:452-01-32201-47001/CAI:45201F7dc9b79a'
    'BIDIE01H/TXT:ZUNE=HA111, CellIndex=124 /CAI:452-01-32201-471/CAI:45201F7dc9b79b'
    and I am trying to write a SQL to get the results:
    CAI
    452-01-32201-47001
    452-01-32201-471
    Any idea to get it done? I did try around with SUBSTR and INSTR functions but not yet sucessed.
    Thanks,
    Alex

    select substr (str, instr (str, '/CAI:') + 5
                  , (instr (str, '/CAI:', -1) - instr (str, '/CAI:'))-5
      from dataas in
    SQL> with data
      2  as
      3  (select 'BIDIE01H/TXT:ZUNE=HA011, CellIndex=144 /CAI:452-01-32201-47001/CAI:45201F7dc9b79a' str from dual union all
      4  select 'BIDIE01H/TXT:ZUNE=HA111, CellIndex=124 /CAI:452-01-32201-471/CAI:45201F7dc9b79b' from dual
      5  )
      6  select substr (str, instr (str, '/CAI:') + 5
      7                , (instr (str, '/CAI:', -1) - instr (str, '/CAI:'))-5
      8                )
      9    from data
    10  /
    SUBSTR(STR,INSTR(STR,'/CAI:')+5,(INSTR(STR,'/CAI:',-1)-INSTR(STR,'/CAI:'))-5)
    452-01-32201-47001
    452-01-32201-471

  • Ora:view support for long columns

    Hi, i'm making a documentation tool of my database tables.
    I want to generate XML description of tables with Xquery.
    When i use this Xquery, gives me error,
    ORA-00932: tipos de dato inconsistentes: se esperaba NUMBER se ha obtenido LONG
    SELECT XMLQuery(
    'for $i in ora:view( "SYS", "ALL_TABLES")/ROW
    return <table id="{$i/TABLE_NAME}">
    {for $j in ora:view("SYS","ALL_TAB_COLUMNS")/ROW
                     where $j/TABLE_NAME eq $i/TABLE_NAME
                     return ($j/COLUMN_NAME)}
    </table>'
    RETURNING CONTENT) FROM DUAL;
    The view ALL_TAB_COLUMNS have a LONG column for DEFAULT value.
    Does ora:view have a workaround for LONG columns?
    The only solution that i have found is to create a new view, without the LONG column, but that will make my documentation tool less portable.
    Thanks.

    Hi,
    user625976 wrote:
    The only solution that i have found is to create a new view, without the LONG columnThat's the only workaround I can imagine too.
    But, what about using SQL/XML functions?
    For example :
    SELECT xmlelement("tables",
      xmlagg(
        xmlelement("table",
          xmlattributes(c.table_name as "id", c.owner as "owner"),
          xmlagg(
            xmlelement("column_name", c.column_name)
            order by c.column_id
        ) order by c.table_name
    FROM all_tab_columns c
    GROUP BY c.owner, c.table_name;

  • SUBSTR and INSTR query

    Hello all,
    I need help in simple query how can show only MCCODE
    SELECT SUBSTR('VMTOPIC=MCCODE', INSTR('VMTOPIC=MCODE', 'VMTOPIC=')+8,20) AS output  FROM DUAL;But also when i used
    SELECT SUBSTR('VMTOPIC=MCCODE', INSTR('VMTOPIC=MCODE', 'HHH')+8,20) AS output  FROM DUAL;show same results, what i need only if words begin with " VMTOPIC= " retrived characters after "VMTOPIC=".
    regards
    Dheya

    Hi, Dheya,
    Here's one way:
    SELECT  SUBSTR ( str
                , INSTR ( str || 'VMTOPIC='
                            , 'VMTOPIC='
                     ) + 8
                , 20    -- or omit this argument
                )       AS output 
    FROM    table_x
    ;where tabe_x.str is the string you need to test.
    You could also do this with REGEXP_SUBSTR or REGEXP_REPLACE, but you can do this easily enough without any slow regular expressions.
    973907 wrote:
    ... But also when i used
    SELECT SUBSTR('VMTOPIC=MCCODE', INSTR('VMTOPIC=MCODE', 'HHH')+8,20) AS output  FROM DUAL;show same results, what i need only if words begin with " VMTOPIC= " retrived characters after "VMTOPIC=".That's because 'HHH' wasn't found, and so INSTR returned 0. SUBSTR treats 0 like 1 in its 2nd argument, so, using that expresssion, not fnding the string is te same as finding it at position 1.
    Of couse, looking for 'HHH' in a string that cotains 'VMTOPIC=' isn't the problem here; the real problem is looking for 'VMTOPIC=' in a string that doesn't contain it.
    Making a special case when INSTR returns 0, as Solomon suggested, is one way to get around the problem. Another is what I posted above, which guarantees that INSTR will never return 0. If the 'VMTOPIC=' is not found in str, then lookng for it in str || 'VMTOPIC=' will cause INSTR to return a very high number; so high that SUBSTR will then return NULL.
    I hope this answers your question.
    If not, post CREATE TABLE and INSERT statements for a little sample data (maybe 5 rows), and the results you want from that data.
    Point out where the query above is producing the wrong results, and explain, using specific examples, how you get those results from the sample data in those places.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Differences between 7 and 8 for long books

    I am considering FM 7 and 8 for producing a long book.  The issue with 8 is that it requires SP2 on XP, and I can't put that on my writing system.
    So that would favour 7 unless its features are noticably lacking compared to 8.  Here are the book requirements, please read carefully --
    * There are 4 parallel columns spread across 2 facing pages -- each column has its own text, layout, font and size, different from texts in other columns.
    * All 4 columns in the spread (2 on even pages, 2 on odd pages) must retain their positions on the spread, no matter which page of the book you turn to.
    * There is absolutely no left to right wrapping of columns in a parallel column layout.  This means all columns flow down - even to even, and odd to odd.
    * This page flow must be automatic -- I am simply NOT going to draw frames for all pages and manually link them across a 400 page book, it is absurd.
    I need to know which one of 7 or 8 supports automatic wrapping of 2 columns on even pages to the next even page, and the two columns on the right odd pages to the next odd page (if you don't understand this requisite column flow, please leave it for other to reply who do -- thank you).  If both FM 7 and 8 are more or less the same, that would be very helpful information too.  Please give compative capabilities as it relates to parallel book columns.
    BTW, another really crucial feature is being able to manually set a FIXED line height in each column -- not in point size, like InDesign does (that does not work for precise alignment) -- I should be able to specify the line height in each column in decimals of an inch.  Which one can do this?
    Your help on these specific questions is much appreciated.  Please no discussion of FM 9.  I will not be getting that version.  Thanks

    ScratchyBoy wrote:
    Mike --
    That weird work-around is indecipherable to me (column less than a character width??) -- would you care to explain it in the context of this thread?
    I noticed that Arnis has already explained the reason for using a tiny frame in each thread to carry the flow across pages where you don't want to display that content.
    The reason Jay posted that is because he was on my question in InDesign, realized the serious failing of InDesign to handle a 2-page spread of parallel columns, and obviously wanted to see if FM could do it.  He did a book in FM with only 2 columns, hence the "entrenched" concept of even-to-odd page flow worked fine for him.
    You know, I have personally read 100+ books with 4 parallel texts like I am describing, and I am sure there are thousands of ones I haven't read with a similar layout.  It takes scarcely 2 seconds to realize, looking at the 2 page spread, that even page columns MUST wrap to even page columns, and odd to odd.  It's not an "unusual, special" request, it is a NECESSARY REQUIREMENT of 4 parallel columns spread across facing pages.  Surely you can see that?  But it seems that Adobe developers either never read any scholarly texts, or they just don't understand parallel texts -- period.
    Have you contacted the folks who created the books you're referring to, to learn what tools they used for the books? Just seeing the final print version, or even the PDF, can't reveal the underlying construction.
    Maybe the truth came out in that thread.  Framemaker, as it was originally conceived by the original developers, DID allow correct page flow for parallel columns -- but once Adobe got it, they killed that ability, dumbing it down to InDesign's level, which cannot do it.  Peter so much as admitted to that fact on that thread, that somewhere in the versions, this feature was killed.  Which confirms the above paragraph.
    Winfried Ring responded to my question about the feature not working in later FrameMaker releases, in that other thread, that the technique still works in later FrameMaker releases. The key, Winfried pointed out, is to begin the document with one body page, regardless of whether it's a single-page or facing-page layout. This keeps FrameMaker from getting confused about where the flows should go on the new pages it creates as any of the flows grows to the point that it creates a new page.
    I think you're trying to imagine how these techniques will work, rather than trying them out hands-on. I've done that myself; it's a good learning style for some things, but in this particular case, you need the empirical experience of seeing how the software's built-in mechanisms behave. Until and unless you do it and gain the experience, you can't imagine, project, empathize, conjure, or visualize how these things work. You do have a clear vision of what you want for the end result, however.
    In FrameMaker, as in InDesign, as in PageMaker, as in QuarkXpress, you draw text frames on document pages, or on master pages, using a text frame tool. It's named differently in each application.
    The tools are for users to apply their vision and creativity, so if you need a certain kind of layout, you need to lay it out yourself. If your particular layout were common, there would very likely be at least one template for available in each professional publishing tool's community.
    Why should I even consider FM 9 ??  Adobe wants $1000 bucks for it -- they brag on its "improved features for book production".  What a laugh!  They can't even conceive of scholarly comparative books across a HUGE gamut of subject areas -- so why should I consider it ??  I'd love for someone to tell me: "YES !!  I am proud to announce that FrameMaker can do this natively out of the box !! "  But I don't see it coming, do you?
    Professional tools cost huge money to develop. If you use them professionally, your work should bring in the revenue to pay for the tools.
    As has been said by many posters on many threads in regards to most software, especially the professional tools, it's very unlikely that you'll find a legitimate copy of a past version for sale. The older the version, the less likely there will be a legit copy on some dealer's shelf that pops up, and is put on eBay for a song. It's illegal to sell old versions that one uses to upgrade to a new version. You'll not be able to register the license; in recent versions of Adobe products, you won't be able to use the software at all after the trial period expires, without a valid license.
    Using a license cracking tool is also illegal.
    It sounds as if  your hardware and Windows version limitations are constraining your software choices. It's a tough set of choices.
    Oh, BTW, here's a link to a PDF of a FrameMaker example of what I think you're talking about:
    http://dl.dropbox.com/u/363247/fm%207X7%204-parallel%20flows%20across%20same-side%20pages. recover.pdf
    EDIT:
    In the PDF, the small fragments of text are the "pass-through" threaded frames that Arnis described. They're larger than a single character, so you can see the text flow through; in real use, they should be teensy.
    /EDIT
    It's trickier in InDesign because it's built-in ability to create new pages as stories grow is trick to accomplish the same behavior. The In-Tools plugin that was mentioned can do this.
    If you're persnickety about typographic control, InDesign is the better tool. FrameMaker isn't a slouch, it's just that InDesign's been bred for the task.
    Regarding lining up the text across columns, InDesign and FrameMaker both can control baseline alignment. You'll need to try out both tools to decide which works the way you need.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • UpdateCharacterStream for LONG column gives SQLException: Data size bigger than max

    I have a LONG column and when I call updateCharacterStream via the resultset I get the following error:
    SQLException: Data size bigger than max size for this type: 2391
    I am trying to update the column with a value that is 2391 in length. The column is defined as a LONG so it is plenty big enough.
    What gives?
    If I use a UTF-8 database it works OK. But if I use a db that is on the default character set I get the error. There are NO multibyte characters, I just happened to test it against my unicode db and it worked.

    This only happens with the thin driver. I am using 8i. It also works OK if the target db is in UTF8!
    D:\myjava>java OracleLongTest
    Registering the ORACLE JDBC drivers.
    Connecting to database
    Connection = oracle.jdbc.driver.OracleConnection@1616c7
    Insert via prepared statement with reader length = 2200
    Insert with prepared statement was successfull
    Updating via prepared statement with reader length = 2200
    Update with prepared statement was successfull
    ===========================================================================
    ticketDesc len = 2200 mod date = 970510081398
    Updating with reader length = 2200
    Updating C1 ts = 970510081608
    Updating the row...
    Exception 2 = java.sql.SQLException: Data size bigger than max size for this type: 2200
    java.sql.SQLException: Data size bigger than max size for this type: 2200
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:775)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:82)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:761)
    at oracle.jdbc.driver.OraclePreparedStatement.setDatum(OraclePreparedStatement.java:1464)
    at oracle.jdbc.driver.OraclePreparedStatement.setCHAR(OraclePreparedStatement.java:1397)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:1989)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2200)
    at oracle.jdbc.driver.OraclePreparedStatement.setOracleObject(OraclePreparedStatement.java:2216)
    at oracle.jdbc.driver.UpdatableResultSet.prepare_updateRow_binds(UpdatableResultSet.java:2070)
    at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1287)
    at OracleLongTest.run(OracleLongTest.java:146)
    at OracleLongTest.main(OracleLongTest.java:41)
    FINISHED!!
    StringBuffer sb = new StringBuffer("");
    for(int i = 0; i < 2200; i++)
    sb.append("X");
    Statement stmt = con.createStatement();
    try
    String insertSQL = "CREATE TABLE MYLONGTEST (C1 NUMBER(38), C2 LONG)";
    stmt.executeUpdate(insertSQL);
    catch( SQLException se) {}
    PreparedStatement insertPstmt = con.prepareStatement("INSERT INTO MYLONGTEST VALUES (?, ?)");
    PreparedStatement updatePstmt = con.prepareStatement("UPDATE MYLONGTEST SET C2 = ? WHERE C1 = ?");
    PreparedStatement selectPstmt = con.prepareStatement("SELECT C1,C2 FROM MYLONGTEST WHERE C1 = ?", 1004, 1008);
    long ts = System.currentTimeMillis();
    String value = sb.toString();
    Reader rdr = new StringReader(value);
    int len = value.length();
    try
    System.out.println("Insert via prepared statement with reader length = " + len);
    insertPstmt.setLong(1, ts);
    insertPstmt.setCharacterStream(2, rdr, len);
    insertPstmt.execute();
    System.out.println("Insert with prepared statement was successfull");
    catch( SQLException se )
    System.out.println("Caught exception = " + se.toString());
    try
    System.out.println("Updating via prepared statement with reader length = " + len);
    rdr = new StringReader(value);
    updatePstmt.setCharacterStream(1, rdr, len);
    updatePstmt.setLong(2, ts);
    int rowcount = updatePstmt.executeUpdate();
    System.out.println("Update with prepared statement was successfull");
    updatePstmt.close();
    catch( SQLException se )
    System.out.println("Caught exception = " + se.toString());
    System.out.println("===========================================================================");
    selectPstmt.setLong(1, ts);
    ResultSet rs = selectPstmt.executeQuery();
    rs.absolute(1);
    String c2 = rs.getString("C2");
    ts = rs.getLong("C1");
    System.out.println("c2 len = " + c2.length() + " mod date = " + ts);
    rs.absolute(1);
    ts = System.currentTimeMillis();
    System.out.println("Updating with reader length = " + len);
    rdr = new StringReader(value);
    rs.updateCharacterStream("C2", rdr, len);
    ts = System.currentTimeMillis();
    System.out.println("Updating C1 ts = " + ts);
    rs.updateLong("C1", ts);
    System.out.println("Updating the row...");
    rs.updateRow();
    null

  • Substring and instring

    Dear all,
    I am very new to oracle. I am learning oracle now. I have small doubt could any one can help me.
    I have a string like 'robert alias: 09-047 position now:     CLARK'
    now i need to store the word
    '09-047' in to a variable x
    and clark in to a variable y
    i.e in X i have to store from the word 'robert alias:' till before the word 'position now:' then my out put is ' 09-047 '.
    for this i tried as below
    select trim(substr('robert alias: 09-047 position now:     CLARK',
    instr('robert alias: 09-047 position now:     CLARK',':',1)+1)) from dual;
    I am getting the o/p as '09-047 position now::     CLARK'
    But i have to get '09-047' only. For that i need to give the 3rd parameter i.e length of the string.
    In my substring i used only 2parameter i.e string and position now i have to give the length.
    Could you please help me.
    Thanks & Regards
    Dilip

    test@ORA10G>
    test@ORA10G> with t as (
      2    select 'robert alias: 09-047 position now: CLARK' x from dual)
      3  --
      4  select x,
      5         substr(x,instr(x,':',1,1)+2,instr(x,' position now')-instr(x,':',1,1)-2) y,
      6         substr(x,instr(x,':',1,2)+2) z
      7    from t;
    X                                             Y          Z
    robert alias: 09-047 position now: CLARK      09-047     CLARK
    test@ORA10G>
    test@ORA10G>isotope

  • Sub-total and Total for a column having checkboxes in WD ABAP ALV

    Hello Experts,
    I have used ALV in We bdynpro ABAP to display my output. There are 2 columns that are checkboxes in Output. I want a sub-total and total for those two columns. I know tht total and sub-total functionality is available only for numeric fields .
    Is there any other indirect way by which i can achieve the same ?

    Hi Ragini,
    Please refer this thread: [alv total and subtotal|How to display graphs;.
    I hope it helps.
    Regards
    Arjun

  • Substr and instr in EQL

    Another EQL question. Is there an equivalent to substr or instr in EQL?
    Edited by: bewise on Jun 28, 2012 5:39 PM

    Not at this time. Check out the v2.3 EQL language reference guide here for more details.
    http://docs.oracle.com/cd/E29805_01/QueryLangRef.pdf

  • (MHDDK) How to realize the synchronization of read and write for long time by cart PCI6025E

       I've finished the programming of the process read and write for the PCI6025E, I can read and write the data now, I wanna synchronize both of the processes, writing the data into the card just after the reading from the card, and check the wave in the oscilloscope. when I use the SEC , it works, but when I changed to MSEC, the wave only come out for a few seconds, even if I bloc 60sec, and also the wave is not steady. why?
         so now the problem is how could I write the data immediately which just read and it's for a long time I asked?
    Thanks in advance!

    Hi Jack,
    aiex4.cpp doesn't exist, as far as I can tell. I believe that while the examples were being named, the developer mis-numbered them and just skipped 4 :-S
    At any rate, if you already have AI and AO working separately, and you have the I/O performance you application requires, then you may not need to add DMA to your driver. However, if you want to add DMA, it won't be very difficult. In essence, you would need mix code from the S and M Series examples. The S Series example aiex2.cpp shows two things: the few lines of code you need to add DMA objects (lines 70-78), and how to program the STC to use DMA (line 114). And aiex3.cpp from the M Series examples gives a clearer picture of how to control and read the DMA channel.
    Thanks, Rolf, for your time and help :-) I'm grateful for your contributions, and I'm glad to see active developers in the DDK forum.
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • Using multiple xdofx commands together. For eg: substr and instr

    Hi,
    I am working in developing an RTF where a situation is to use xdofx:sustr and xdofx:instr together.
    I tried but its not working properly.
    Is there any special commands to use in such a scenario.
    Thanks,
    Anand

    plz post what are you doing
    works for me
    as example
    <?xdofx:substr(substr(COLOR,5),instr(substr(COLOR,5),’;’)+1)?>for
    <ROWSET>
    <ROW>
    <COLOR>qwe qwe;rty</COLOR>
    </ROW>
    </ROWSET>gives
    rty

  • Convert varchar to date in BO Universe with Substring and instring function

    to_date(substr(xxxx_v.e_details,instr(xxxx_v.e_details,'|',1,2)+1,9),'DD-MM-YYYY') In the universe while defining the object as date i was facing probs can any body help me out. the column xxxx_e_details is having the datatype varchar in database and the third string is date while i was creating the date object in the universe with the above syntax it was getting the error
    The data in this obect is like this xxxx_v.e_details -> wwww|eeee|MM-DD-YY|
    Edited by: mohammed kashif on Mar 31, 2011 11:47 AM

    i am getting the data but  it is in the format 01-03-0201. The year format  for 2010 is populating as 0201. i am not able to think whether it is due to instring function which is reading data like this. Need suggestion from experts.............

Maybe you are looking for

  • How can I burn just a selected part of the project to DVD?

    Afternoon all, we downloaded a number of clips from our HDV that we wanted to use in making a short movie (1 hour's worth of clips will end up being a movie of about half that length). After doing that, we decided to do a 'preview' of 2 minutes worth

  • MBP to TV (What TV + adapter to get?)

    I'm in the market for a new TV (and DVD player) and thinking about using my MBP as the DVD player. There is a DVI to S-video adapter ($19) that would work but I don't know how good of quality that would be. Most TVs don't seem to have a DVI input...a

  • Java SE JDK Documentation

    The link to the Java SE JDK document (javadocs) does not seem to be working at present: see page Java SE 6 Documentation - http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs

  • How to mask values in the payload

    Hi  I have a requirement where I have to mask the values in the payload so that it does not appear in the Monitoring transactions. Example credit card numbers If anyone has an idea how to achieve it please let me know. Regards Nikhil

  • Problem with AVI files

    hello with JMF i try to load video files in my software, but some AVI sound can't be loaded, or others AVI i can't see any video. ex: Unable to handle format: LINEAR, 22050.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 88200.0 frame rate, FrameSize=32