How to use substr to search and show as an ouput in oracle 11g

Hi all

Suppose I have oracle.india.com1.1234 in my value line so I need not to show the India as output. I need to display in the .csv (Excel)

Thank you

You can use SUBSTR + INSTR:

with t as)

Select 'oracle.india.com1.1234' union str double all the

Select "oracle.England.com1.1234" from double

)

Select str,

substr (STR, InStr(STR,'.') + 1, instr(str,'.',1,2) - instr(str,'.') - 1) new_str

t

/

STR NEW_STR
------------------------ ------------------------
Oracle.India.COM1.1234 India
oracle.England.com1.1234 England

SQL >

Or use regular expressions:

with t as)

Select 'oracle.india.com1.1234' union str double all the

Select "oracle.England.com1.1234" from double

)

Select str,

regexp_substr (str,'[^.] +', 1, 2) new_str

t

/

STR NEW_STR
------------------------ ---------------------
Oracle.India.COM1.1234 India
oracle.England.com1.1234 England

SQL >

SY.

Tags: Database

Similar Questions

  • Portege R500-11Z: how to use the external mic and hear the internal speakers

    We have a Portege R500-11Z running XP and want to use Skype with an external table microphone and the internal speakers.

    When connect us the microphone to the Jack MIC the Portege, built-in speakers cut out!

    How to use an external mic and still hear the internal speakers?

    Hello

    > When connect us the microphone on the Portege, built-in speaker MIC Jack cut!
    Are you sure you used the microphone port and no headphone port?

    Have you checked your settings Audio from Skype?
    There is an option called ring through the speaker too or something like that.

    Please also check the Realtek HD audio Manager in Control Panel.
    There is a tab called Audio i/o.

    Usually, you can change the connector settings, by clicking on the small key-tool icon.
    Disable the option called Mute rear output when plugged headphones before

    As you can see is called headset and not so I m confused a little bit why the speakers are turned off when you connect an external microphone.

    By the way; There is also a tab called micro.
    Check if the two options that reduce the echo and noise are OFF

  • In general, is it better to use java.sql.Date and java.sql.Timestamp instead of oracle.jbo.domain.Date?

    Hello world

    During playback of Oracle ADF Real World Developer's Guide, I noticed the dates match occurring in JDeveloper is different from what is the list in the book. JDeveloper is failing to oracle.jbo.domain.Date, but according to the book:

    DATEjava.sql.DateDATE type is mapped to java.sql.Date if the column in the table is a no time didn't need information zone.
    DATEjava.sql.TimestampDATE type is mapped to java.sql.Timestamp if the column in the table has a component "time" and that the client needs to zone information.
    TIMESTAMPjava.sql.TimestampThe TIMESTAMP type is mapped to java.sql.Timestamp if nanosecond precision is used in the database.

    In general, is it better to use java.sql.Date and java.sql.Timestamp instead of oracle.jbo.domain.Date? Using java.sql.Date and java.sql.Timestamp could save me some headaches conversion date. And, is there a place in JDeveloper to display these maps? I looked around and didn't see anything.

    Thank you.

    James

    User, what version of jdev we are talking about?

    In GR 11, 1 material versions db types date and timestamp are mapped to types of domain data that represents a wrapper for the native data types. The reason was that the framework can work with the domain types regardless of the underlying data type.

    Since Oracle 11 GR 2 maps the types DB to java types (default selection, you can change it when you create a model project, you can set the Data Type Mapping). Once the pilot has business components define you cannot change this setting it would break existing components such as eo or vo.

    So if you are working wit 11 GR 1 subject, you must use the domain types, if you work with GR 11, 2 or 12 c, you can use the domain types, but it is recommended to use the java type mapping.

    Timo

  • How to use substr and instr, where the line of input Multi text

    Hi all

    with

    data in the form of)

    Select ' Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234..' double val

    Union of all the

    Select 'Bill Johnson.Apartment 3 b. Sterling.VA.20166.3 Plaza Falke' of the double

    )

    Select

    regexp_substr (shipping_instructions, "[^ #] +' 1, 1") name

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 2") address

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 3") city

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 4") State

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 5") zip

    , regexp_substr (shipping_instructions, "[^ #] +' 1, 6") County

    FROM (select REGEXP_REPLACE (val, ' \.)) () [^.])', ' #\1 ") data shipping_instructions)

    (1)'Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234..'

    (2)'Bill Johnson.Apartment 3 b. Sterling.VA.20166.3 Falke Plaza. »

    "Mary America. 1234 Southridge Park Dr. Samna Lorie. MO.31234..'

    NAME ADDRESS CITY ZIP County SATE

    ---------                  --------                                ------------           ------           -------    -- -----

    Married America 1234 Southridge Park Dr.    Samna Lorie MO 31234  NULL VALUE

    "Bill Johnson. Apartment 3B. Sterling. VA. 20166. Falke Plaza 3... "

    NAME ADDRESS CITY ZIP County SATE

    ----------------      -----------------        -------       -----        ---         --------

    Bill Johnson apartment 3B Sterling, WILL 20166 3 Falke Plaza.

    Problem

    ---------

    (1) if the value, if the County (if null) value then it shows the ZIP with dot's (.) value, in the 31234 above..,.

    How to solve this problem?

    (2) another possible to fix the code, I want to use substr and InStr.

    (3) who is the best approach?

    Conditions:

    --------------

    (1) shipping_instructions column has the value with "Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234... »

    This means it combined all the similar name, address, city, State, zip

    (2) we insreted in the table separately.

    =========================

    / * Use Substr and Instr * /.

    =========================

    I used substr and instr, but I'm getting the money results (no point in the address).

    "America Mary. 1234 Southridge Park Dr. Samna Lorie.MO.31234..'


    NAME ADDRESS CITY ZIP County SATE

    ---------                  --------                                ------------           ------           -------    -- -----

    Mary America 1234 Southridge Park Dr. Samna Lorie MO 31234  NULL VALUE

    But I need the results (no point in the address)

    NAME ADDRESS CITY ZIP County SATE

    ---------                  --------                                ------------           ------           -------    -- -----

    Mary America 1234 Southridge Park Dr.    Samna Lorie MO 31234  NULL VALUE

    Hello

    994122 wrote:

    Hello

    (1) how do to do this, use the substr and instr functions?

    Thank you

    You can't do all the work with SUBSTR and INSTR; you need regular expressions to obtain a string delimited by a #.

    Once you have such a string, then you can use SUBSTR and INSTR (instead of REGEXP_SUBSTR) to get the separate secondary strings:

    WITH got_delimited_string AS

    (

    SELECT REGEXP_REPLACE (val

    , '\. ([^ .]| $)'

    , '#\1'

    ) AS delimited_string

    FROM the data

    )

    got_pos AS

    (

    SELECT delimited_string

    , INSTR (delimited_string, "#", 1, 1) AS pos_1

    , INSTR (delimited_string, "#", 1, 2), pos_2

    , INSTR (delimited_string, "#", 1, 3) AS pos_3

    , INSTR (delimited_string, "#", 1, 4) AS pos_4

    , INSTR (delimited_string, "#", 1, 5) AS pos_5

    , INSTR (delimited_string, "#", 1, 6) AS pos_6

    OF got_delimited_string

    )

    SELECT SUBSTR (delimited_string, 1, pos_1 - 1) AS the name

    SUBSTR (delimited_string, pos_1 + 1, pos_2 - (pos_1 + 1)) AS address

    SUBSTR (delimited_string, pos_2 + 1, pos_3 - (pos_2 + 1)) AS city

    SUBSTR (delimited_string, pos_3 + 1, pos_4 - (pos_3 + 1)) AS State

    REPLACE (SUBSTR (delimited_string, pos_4 + 1, pos_5 - (pos_4 + 1))

    , '.'

    )                                                           AS zip

    SUBSTR (delimited_string, pos_5 + 1, pos_6 - (pos_5 + 1)) AS the County

    OF got_pos

    ORDER BY delimited_string

    ;

  • How to force the Explorer search to show ONLY the files that match the search target?

    I frequently need to search for files with brackets in the name of the file.    However, a bug in the Search Explorer means that search results will fill up with a lot of waste that does not match my search target.

    Example:

    At a command prompt "dir/s * (abc) *.» ' * ' usually works: the name of each file found will contain "(abc)".   (The only time that a search for the command line fails is when the version 8.3 of the name of the file matches the search target, but the name of the actual file does not work.)

    However, in Solution Explorer, look for "* (abc) *.» "*" returns all files with 'abc' in the name, and provides no way to filter the results so that I only see files with '(abc)' in the name of the file.

    This search bug means that you want "* (de) *.» ' * ' at the command prompt returns 72 hits, while searching with Explorer returns 7381 hits!

    Cancellation: Another inconvenience of Windows is when I work at a command prompt I get often unexpected results because the wildcard matching is done against both the full name of the file or folder and the name of 8.3.   Is there a way to force cmd.exe to restrict the wildcard matches only the complete names of the files and folders?  That is to say, is there a way to force cmd.exe to never, ever, use the 8.3 names?

    Hi Rob,

    In order to quickly provide a solution, please answer this question:

    Did you do changes on the computer before the show?

    Follow the steps below to solve the problem:

    Method 1: If you have problems of location of the files, folders, or other items on your computer, try using the search and indexing of troubleshooting to solve the problem. It ensures that the Windows Search service is running and checks if you have the correct permissions to search all the directories on your computer.

    See the article below for additional information and steps.

    Open the troubleshooter for search and indexing

    http://Windows.Microsoft.com/en-us/Windows7/open-the-search-and-indexing-Troubleshooter

     

    Method 2: I also suggest you to re - index files, then check. Follow the article below for the procedure.

    Change advanced indexing options

     http://Windows.Microsoft.com/en-us/Windows7/change-advanced-indexing-options

    See also:

    Improve Windows searches using the index: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/improve-Windows-searches-using-the-index-frequently-asked-questions

    Hope this information helps. Pleave get back if you need help, will be happy to help you.

  • How to use LR on Mac, and at the same time on a PC

    I'm new to Mac. I used LR on PC and I used a disc external hard storage my catalog and photos of work. Now I have the problem that LR on Mac says a catalog cannot be used on an external drive. So, how can we work on Mac and on my Windows laptop?

    DdeGannes wrote:

    You need to detach the disk from the computer and attach it to the Mac.

    Probably will not work because the drive of the PC is formatted in NTFS (windows) and Mac natively needs a HFS.  The Mac can READ an NTFS drive, but it cannot write to it without a special driver.  Do an internet search for "mac, write to NTFS drive" and several solution will come.

  • How to use wildcards to search for e-mail addresses.

    Hi all


    We have a great html site and we need to search all pages to find all built-in e-mail addresses. We just need to make sure that all the addresses on the site are always topical. I tried to use a regex search such as @[\w\W]*?com but the problem is that it will find a great piece of code that starts by the @ and somewhere later ends with the.] com  For example this piece of code would be returned using this search:

    @import url("./menu.css");

    < / style >

    < link hand. CSS"rel ="stylesheet"type =" text/css"/ >

    < link href = "layout.css" rel = "stylesheet" type = "text/css" / > "

    < link href =' http://fonts.googleapis.com/CSS?family=cabin:700,400 ' rel = "stylesheet" type = "text/css" >

    "< script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js "> < / script >

    < / head >

    < body class = "gradient b" >

    < div class = "container" >

    < div class = "header" >

    < div style = "width: 195px; "" float: left "> < a href =" http://www.SiteName.com " " "

    Can someone suggest a better expression of search to find all email addresses on the site? BTW, all used addresses do not necessarily belong to the same domain name, so I can't limit the search string to that. And I realize that I probably repeat the search for .net, .org, etc.

    I am close, or is it just not possible?

    Thank you
    CJ

    Just add them to the final list in parentheses, separated by a vertical bar.

    There are now a large number of top-level domains. If the OP needs a regex more complete, I'll be happy to oblige. But it would be useful to know which TLDs are likely to be needed in research. Otherwise, the regular expression becomes heavy.

  • How to use the Listview element and list in Adf

    Hello

    Can someone explain how to use list view and tags to list items in adf to display the data in the table.


    Concerning
    Suresh

    On the error, check your log window, if no content appears then it suggests that an error occurs.

    I built it by hand.

    CM.

  • How to use sqlplus to connect and run control?

    Hello, I have a little problem please help me
    I want to use sqlplus to connect and run the command
    for example: sqlplus test/test@DB select sysdate double;
    and then it will show on the screen (sysdate) data
    What should I do?

    Thank you

    Wrong tool. You should start with something like this:
    #! usr w
    use strict;
    Use DBI;

    SQL * more isn't a script tool.

  • How to use the find/search feature in a book?

    Hello

    New to indesign... working on a directory file that contains 25 chapters.

    I have definitive evidence to ensure that all double spaces are gone, all the quotes are right etc.

    Instead of opening of each chapter and by using ' Search/search' through each chapter, I can tell the "Search/search" function through the whole book?

    Appreciate any feedback

    Thanks heaps

    There is no special installation "book Search" in InDesign. You must open all the files that you want to search and then use the option "all the research papers" in the search engine. That and other gaps in the book led me to consolidate all the chapters of my book in a single file.

  • How to use the OS Android and Windows on the same shelf?

    Original title: is it possible I ca use the OS android and mircosoft OS?
    Is it possible that I can used both ANDROID OS and MICROSOFT OS at the same time in my Tablet?

    You will not be able to install the Windows operating system on an Android device.

  • How can I get the number of a random process to use in math´s and show the solution to the user?

    I wrote this function and I try to show the number of seconds that the user had to sooner or later the stopbutton to the user click.

    its about to hit stop councelling while inside ther is a random number already, but the user do not know or see.

    the eye opens in a random between 40000 and 100 milliseconds. If they open the user should click on stop without seeing them. so his Sensa.

    I just tried.

    This code is on the mc with the eyes to make them open at random. This is the second image the main code of the time. 1 frame is the Start button and a small description. on the second stop button and closed eyes with the script here as I have already said. and on the framework of the 3rd is the end wher it should be displayed to the user. That's how I tried. Please let me know any suggestions and or other solutions to my problem! If you need to see my flashfile help me just let me know. I send to you or something :-)
    MIC (at) hellrec.at


    function randomRange(minNum:Number,_maxNum:Number):Number

    {

    return (Math.floor (Math.random () * (maxNum - minNum + 1)) + minNum);

    }

    var myTimer:Timer = new Timer ((randomRange (100, 40000)), 1);

    myTimer.addEventListener (TimerEvent.TIMER, openeyes1);

    myTimer.start ();

    var: duration: uint = getTimer();

    function openeyes1(e:TimerEvent):void {}

    gotoAndPlay (26);

    e.updateAfterEvent ();

    }

    to save the use of number:

    function randomRange(minNum:Number,_maxNum:Number):Number

    {

    return (Math.floor (Math.random () * (maxNum - minNum + 1)) + minNum);

    }

    var randomNum:Number = randomRange (100, 40000);

    var myTimer:Timer = new Timer(randomNum,1);

    myTimer.addEventListener (TimerEvent.TIMER, openeyes1);

    myTimer.start ();

    var: duration: uint = getTimer();

    function openeyes1(e:TimerEvent):void {}

    gotoAndPlay (26);

    e.updateAfterEvent ();

    }

    p.s. Please check the useful/correct.

  • How to use Substr and Instr to get data from a file

    Hi I have a script

    I get a file like this

    1.20, ram, sales

    I get a file as these data as a column

    I want to divide these data into 4 different columns as

    1 20 sales of ram

    Hello

    This query will help you.

    Select

    SUBSTR (C1, 0, INSTR(C1,',')-1).

    SUBSTR (C1, INSTR (C1, ',') + 1, INSTR(C1,',',1,2)-INSTR(C1,',',1,1)-1),

    SUBSTR (C1, INSTR(C1,',',1,2) + 1, INSTR(C1,',',1,3)-INSTR(C1,',',1,2)-1).

    SUBSTR (C1, INSTR(C1,',',1,3) + 1, INSTR(C1,',',1,4)-INSTR(C1,',',1,3)-1)

    SUBSTR (C1, INSTR(C1,',',1,3) + 1)

    BeO

    Select 1, 20, ram, C1 double sales

    )

    Remember that a comma is not really safe as field separator

    Post edited by: DecaXD

  • How to use a secondary control and tab?

    I am the first time using the secondary tab control. I've seen some examples of shipping.

    The purpose of the VI:

    1 termpol1 on: should be on when the mouse is down (for VI without TITLE 4)

    2 termpol1 Off: the mouse is down

    Another screen should come to show:

    3 Process2 on: should be on when the mouse is down (for VI without TITLE 5)

    Off 4Process2: should be on when the mouse is down

    If I click on process On1 a screen should come up from the VI and process 2 then another screen should happen.

    How can I do? How can I create reference to the main VI VI IE 3 Untitled.

    You open the vi FP before insertion of the vi It is by mistake because you will not be able to use overtime to a vi Panel already open so you can remove and move the mention vi Panel of sup and the run method of the vi then you must check the status of the vi to operate inside the void Panel.

  • Does anyone know how to customize (aesthetically), BC search and results in muse?

    I created my site within the muse and used the search function of business catalyst and it works, however I wanted to customize how the search bar and results appear as they look broken. Any help would be appreciated!

    Search page

    [Moved from the endorsement, general, all Adobe forums Lounge for a specific product - Mod support forum]

    I suggest that you contact the catalyst for business team, for advice on your support issue.

    Here is a link to their contact - contact us | Adobe Business Catalyst

    Thank you

    Ankush

Maybe you are looking for

  • Can someone look at my questions?

    I see where people have seen my questions, but no one made a comment or respond. I don't want to be rude, but I don't know how to get the members of the community to help. I imagine that if you click on my user name, you will see my last 2 posts. Pos

  • SM30-304 drivers without wireless/WiFi

    I recently had problems to connect my laptop SM30-304 (number PSM30E-0QKJ1-5U) for my home wireless network that uses the PSK security. The router is Netgear and I am running Windows XP Home SP2. The network is visible, but when I try to connect, Win

  • Properties assistant DAQ does not open

    We use version 8.0.1 LV with daqmx version 8.7.1. Win Xp with a PCI-6025E, SCB-100 card is attached. I can measure the thermistor in the SCB-100 in the measurement and automation for the hardware seems to work OK. The problem is to use Daqmx in LV I

  • How can I run the remote registry service in Windows Server 2003?

    original title: How do I run the remotley remote registry service? I'm unable to open a session I'm on windows 2003 R2 server, when I connect automatically to this topic still disconnects once, I'm remotley to change the registry, but the remote regi

  • HP 2159 m monitor - problem is 'running ants' vertical lines about 1 mm interval during the video display.

    At the following problem troubleshooting steps: (1) monitor confirmed cable is properly attached to the monitor and CPU. (2) monitor reset to the default settings in the monitor menu. (3) installed the latest driver - HP 2159 m 2.0 (4) installed the