Basic instr (docs/bases not clear Oracle guide) question

Hello

I'm obviously quite new to this, but do not understand the more generally instr function, it's just the variable 'position' that confuses me a little, and the oracle documentation and manual review of basic principles are quite vague on this issue.
INSTR(source string, search item, [start position],[nth occurrence of search item) the function returns a number that represents the position in the string source,
tostarting from the given starting position, where the nth occurrence of the search item
begins
Examples
Example 7-127 using Position of character to look forward to find the Position of a substring

The following example searches for the string 'Corporate Floor', starting with the third character, for the string 'or '. He returned in 'Corporate Floor' position in which the second occurrence of 'or' begins.

See THE INSTR ("Corporate Floor', 'or', 3, 2")
14


Surely these things are simply wrong?

If the research started from the starting position given in the example from the oracle documentation, the answer would be 12, 14? 3 ('r') character to the second instance of "or" is inclusive, 12 characters isn't it?

or have I totally misunderstood?

Thank you

Nick

Published by: 967660 on October 25, 2012 06:55

Published by: 967660 on October 25, 2012 06:56

967660 wrote:

just confused me - what is the point of the position variable at all? Why tell it to start at the point "x" If the result will be the same no matter what?

I think that you are still confused, the result won't be the same.

SQL> select
  2    instr('Corporate Floor','or', 3),
  3    instr('Corporate Floor','or')
  4  from dual;

INSTR('CORPORATEFLOOR','OR',3) INSTR('CORPORATEFLOOR','OR')
------------------------------ ----------------------------
                             5                            2

From 3 If is or at 5, from 1 position that he finds it to position 3.

Tags: Database

Similar Questions

  • Basic parameters of SQL defining in oracle 11g env plan

    Hi Experts,
    We have recently improved 10 g for the version of database 11g folloing on hardware 'SUN SPARC ENTERPRISE T5440 SERVER'

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE Production 11.2.0.3.0
    AMT for Solaris: 11.2.0.3.0 - Production Version
    NLSRTL Version 11.2.0.3.0 - Production

    Please can you comment on the setting that we set as below.
    If you see a problem with this setting.

    NAME VALUE ISDEFAULT
    FALSE FALSE OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES
    optimizer_use_sql_plan_baselines TRUE TRUE

    Target memory is set as 0
    Memory max target is defined as 49280M
    Size max of SGA is defined as 49280M
    SGA_target is defined as 44G
    PGA_aggregate_target is defined as 4G

    So now, when my developers will keep on adding changes, plans will be less than optimal.

    Why not optimal? Optimizer generates plan based on statistics. If the statistics are fresh, in most cases the plan will be optimal. But in some cases, for complex queries, plan may be not optimal. In this case, you can manually create fixed plan with outline, profile sql or sql base plan.

    As long as you recommend, that I should change the value of the parameter optimizer_capture_sql_plan_baselines to TRUE and must schedule a task that will evaluate and evolve the lines plan basic sql newly captured.

    Yes, you can leave data base automatically resolve these issues in this way. In addition, you can use "automatic sql tuning task" that will generate and accept the sql Profiler. But in this case DBA can lose control of what's going on. Bad plan may be caused by an error of the developer. The best way is to test each change in the QA system before it will be applied on production.

    Another question. Since I updated memory_target zero and set parameters of the SGA to a zero, I think I do not allow Oracle to decide what is the best setting it shoud choose automatically. You are recommended to set all the parameters of the SGA to zero and the MEMORY_TARGET value to a non zero value? current setting is as below.

    Target memory is set as 0
    Memory max target is defined as 49280M
    Size max of SGA is defined as 49280M
    SGA_target is defined as 44G
    PGA_aggregate_target is defined as 4G

    It depends on the workload, amount of the session. For example, if consuption pga and sga is constant, there is no need to follow to the memory usage, therefore, you can use sga_target and pga_aggregate_target. If the workload varies during the day, requiring more sga the morning and less time use memory_target order to always use all the memory. If you want to limit the total PGA in order to have still large SGA, use not memory_target. For example, by default a session cannot use more than 200 MB of pga. Seen 100 simultaneous sessions requiring a great pga database can use up to 20 GB of memory that will be used on the buffer cache, causing the performance impact.

  • Built-in camera is not clear - Satellite L635

    Since I bought this Satellite L635-I discovered that the built-in webcam is not clear.
    I tried several times to adjust the settings but seems that I can't get through to fix a good resolution.

    I can assume that there is an updated driver?
    Can someone guide me to solve this problem? Thank you

    Hello

    Did you remove a protective film of the webcam of the Tower? To check the latest version of the driver for the webcam you can following the link:
    http://EU.computers.Toshiba-Europe.com/innovation/download_drivers_bios.jsp

  • Error-61207 and DiagramReset did not clear in the expiration time.

    Hello

    Just to start with FPGA programming and trying to get my NOR-9155 and NOR-9223 to capture some simple analog voltages.

    After you have compiled the NI9223 get started (FPGA) for my 9155 - NEITHER with NOR-9223 VI I get the following error messages:

    LabVIEW FPGA: Internal error: DiagramReset is not clear in time.
    Please contact National Instruments Technical Support on ni.com/support.
    Error-61207 occurred at niLvFpga_Open_NI 9155.vi

    I tried to reboot the host and the chassis and reset FPGA but continue to receive this error message.
    I am running LabVIEW 2012 SP1 on a Dell Inspiron 1520 (Intel Celeron 540 @ 1.86GHz. and 3574 MB of RAM and Windows Vista Home Basic

    I ran it on another laptop computer (Dell Dimension M6700) and do not receive this error, and the project works very well.

    Any help would be appreciated.

    Bob

    Soloman,

    I met Adam Bakehouse (rep FOR Imperial College London) Thursday and he suggested that my view of the installation of Windows XP instead of Windows Vista. I did it and everything seems to work fine now. I realize that XP is no longer supported bu MIcrosoft, but this correction will enable me to move forward in the short term, using my old laptop computer Dell.

    Thanks a lot for your help.

    Kind regards

    Bob

  • I would like to know the product key of my operating system, one under the laptop is not not clear

    I would like to format my laptop and reinstall my windows home premium but I don't have the product key because under the laptop is not clear.how can I get it or can you give me.

    There are many key finder utilities, but they will only show the origonal license volume key manufacturers, which is not the same as the key on the base of the laptop.

    If you usually use the origonal recovery disks responsible to reinstall, it would not require any key required

  • Recovery scenario - vote drive does not match the guid of cluster

    Hi all

    Think you can not start your guest virtual machines just because it has a corrupted root system.img image. And suppose that it contains 5 physical disk (which are all created by the model CARS) where ASM on them.
    What is the easier recovery of computers scneario virtual comments (RAC)?

    Can this be a plausible scenario to retrieve availability? (Assume that both of the RAC system images are corrupted and we do not prefer a level system rather than backup recovery / restore)

    1 create 2 RAC instances using the same details of networking and the hostname that is corrupt. -Use the new 5 different drives.
    2 stop the newly created instances. Place the disks for instances newly created using virtual machine Manager.
    3. Add the old records the image system is unable to be corrected, but ASM disks are still in use (since the newly created instances using VM manager.) for newly created instances.
    4. open the newly created instances

    We want that the DSO and CRS have been initialized and be opened without problem?

    When I try this script I get the error the cssd/crsd shows.

    -Cluster guid 9112ddc0824fefd5ff2b7f9f7be8f048 found in the voting disk does not match the guid a3eec66a2854ff0bffe784260856f92a cluster obtained from the profile of negotiators.
    -Found 0 files preconfigured voting but 1 vote files are required, endpoint in order to ensure the integrity of the data.

    What could be the easiest way of recovery of a virtual machine that has healthy ASM disks but image corrupt system?

    Thank you

    Hello

    you have a similar problem, trying to clone data bases with 11.2.
    The problem is that a cluster is identified uniquely, and this information is considered in the OCR and voting disks. So exactly these 2 should not be cloned.

    To achieve what you want, simply configure your system in this way, you have a diskgroup separated for OCR and vote (and ASM spfile), should not be restored in the case of szeanrio.
    Only all files in database in ASM will then be exchanged later.

    Then what you want is possible.
    However, I'm not sure that the RAC models have the ability to install the OCR and vote in a separate diskgroup.

    Concerning
    Sebastian

  • badge iPhone app notification will not clear

    badge iPhone app notification will not clear. The version of the software 6 using iphone 9.3.5. The phone application will not erase the last badge referring to a message I've ever listened to and deleted. The problem started after updating iOS version 9.3.4 and continues with 9.3.5. Research on possible solutions, apparently this has been a recurring problem with the iPhone over the past years.  Possible solutions included notification of closure when it pops up, restart the iphone, update to the latest version of iOS, activating / disabling the group by App.  I had to disable notifications from app badge hoping that Apple will provide a solution. In the meantime his is going to be a pain not having not not available visual notification.

    Tap Settings > general > reset > reset all settings

  • Why then download a clip is not clear, some of the writing, it is not clear how can a solution this? Thank you very much for your time and your help on this issue.

    Video playback that I just downloaded in my VLC it don't watch not clear enough to read Instructions, how can I make it clear to be able to read the Instructions? I thank very you much for your time and your help.

    It could be that the music is bad. It could be your software.

    Download the latest VLC Player.
    Post a public link to the clip.

    • see if there are updates for your graphics card disk drivers

    https://support.Mozilla.org/KB/upgrade-graphics-drivers-use-hardware-acceleration

    • Disable protected mode in the plugin Flash (Flash 11.3 + on Windows Vista and later versions)

    https://forums.Adobe.com/message/4468493#TemporaryWorkaround

    • turn off hardware acceleration in the Flash plugin

    https://forums.Adobe.com/thread/891337
    See also:

  • Why 'Download & browser history' compensation crash Firefox and NOT clear my history?

    I want my Locator bar autocomplete erased. I use my computer for personnel, business and do not want my story showing on screen sharing meetings when you type in the browser.

    Firefox on Mac (Yosemite) 40.0.

    I go to:

    -History
    -Clear recent history
    -Browsing & download history
    -Click the 'clear now '.

    Firefox blocks (beachball), wait a few minutes, still react not, must be "Force Quit" through OS X

    Reopen Firefox, Locator bar always auto-termine. History still there.

    Starts in Mode safe, disabled all add-ons. Always hangs and does not clear the history.

    Disable AutoComplete in the location bar is not a solution. This is a bad solution.

    If there is a folder or .js I could remove from the file system, it would be at least something, but I found nothing on these forums who instructed on how to do it. The only solutions are to disable add-ons, start in safe mode, click the button "Clear recent history" even making crash the browser. To try to solve this problem, I had to wipe all my open tabs, re - configure my workspace, all it costs me time and money.

    I use Firefox because I'm a software developer and he has the best tools for development, but he is trying more and more to be a browser based on the consumer, as Chrome or Safari, and I hate those intensely. I don't want that. I want something that is a development tool.

    Maintenance of the premises {web link}
    Allows to run Maintenance tasks on the database that drives
    Bookmarks and history module places behind Firefox.

    Start Firefox in Safe Mode {web link} by holding down the < shift >
    (Mac options)
    key and then from Firefox. Is always the problem?

    Problems with bookmarks and history does not properly can
    be caused by a corrupted database places.sqlite file.

  • Not cleared leaving privacy data

    Clear privacy data on output are enabled but are not cleared. It appeared to start with the most recent version of Firefox because it worked OK in the past. Manual removal works very well. Update Samsung S5 on Verizon.

    Make uninstall/reinstall did the trick and everything works as it should.

  • Why all the videos are scrambled. not clear

    When you view the videos or ads they are all scrambled, & is not clear. My os is linux zorin are the correct settings? Many thanks allan

    You can attach a screenshot?

    Use a type of compressed as PNG or JPG image to save the screenshot.

    You can have zoomed pages by accident.
    Reset the zoom of page on pages that are causing problems.

    • View > Zoom > reset (Ctrl / command + 0 (zero))

    You can try the following steps in case of problems with web pages:

    You can reload webpages and ignore the cache to refresh potentially stale or corrupt.

    • Hold down the SHIFT key and click the Reload button
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Command + shift + R' (Mac)

    Clear the cache and cookies only from Web sites that are causing problems.

    "Clear the Cache":

    • Edit > Preferences > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Edit > Preferences > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.

    • Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe
  • Videos stopped playing on all websites, just get black screen. Fixed not clearing cache and cookies and restart in safe mode.

    Fixed not clearing cache and cookies and restart in safe mode.

    Your system details list shows two plugins Flash, a Flash 10.0 very old version you must uninstall (remove).

    1. Shockwave Flash 11.7 r700
    2. Shockwave Flash 10.0 r32

    Manually, see "uninstall a plugin:

    See also:

  • on facebook and screen suddenly changed very little character and fuzzy not clear, so I switched to another browser and it was OK out there

    While scrolling through my facebook page. The screen has suddenly changed in very small print and Blur / Blur is not clear. The entire page had changed the way it showed. So I tried another browser and facebook page was working fine. I went back to firefox and still had problems.

    Yes, holding the CTRL key and turning the mouse scroll wheel are another way to set the zoom of page in addition to the hotkeys Ctrl and + to increase and Ctrl and - to zoom out in and Ctrl and 0 (zero) to reset the zoom.

    See also view > Zoom (press Alt to get the menu bar)

  • Select 'delete histroy navigation' in Windows 7 or while on the page web of Firefox (your instructions are not clear in this regard)

    I read your instructions on the Firefox Web site. What is not clear to me is, I have to do 'privacy settings' and ' browsing history delete "within the web site of Firefox or do I have to do this offline via Windows 7"internet settings ". The Firefox tab (top left) does not offer the choice of menu referring to your instructions. My laptop (offline) "internet settings" Please refer to the Internet Explorer settings (that I don't use) is not clear that the changes in my preferences influence on Firefox (or just Internet Explorer)

    If you have the Firefox button orange then you should see the Options entry in the column right above the entrance to help.

    • Press the F10 key or press the Alt key to bring up the 'Menu Bar' temporarily if the menu bar is hidden.
    • Use "Firefox > Options" instead of "tools > Options" If the menu bar is hidden.
  • Libretto W100: Blio - wrong format & text software is not clear

    Hello

    I am trustworthy customer Toshiba because I think is fantastic closed and large producer electronics industry but I am very surprised when I ' ve bought model libretto W100 last week.

    I tried to install * BLIO * SW for because I want to use this template as in dual mode ebook reader screen.
    This new machine of philosophy that I think is right for this use, but I think there are a lot of problem to achieve success.

    In this system in particular operations, I have seen that there are two essential problem;
    -first of all, there is no presentation of good page on the double display mode format screen and
    -Secondly I think that the font of the text is not clear like windows.

    Thank you for your kind attention

    Hello

    In my view, the libretto W100 is a great device with the double 7 display. It can be used for different purposes, and not just for reading electronic books

    However, I think there are different applcations on the market that can be used for reading electronic books and I think that comment is linked especially to the Blio software.

    I can't say anything about this tool. I put t use it.
    However, your opinion is very interesting. Thanks for sharing this in our community.

Maybe you are looking for

  • Portege R600-140: message says: device would work better with USB 2.0

    R600-140 win 7 profI plug in a device of capture usb video and a popup appears saying (roughly) + This device would work better with USB 2.0 - Click here for a list of usb ports. I thought all the usb ports 2.I just checked the drivers in the Panel,

  • Dell Optiplex PC 390: the driver for the PCI device is not installed

    In "Devices and printers" my desktop unit shows a yellow triangle with an exclamation point. When I click on "help" I get the message "PCI device driver is not installed. When I try 'apply this correction', nothing happens, it retains only the search

  • Regarding Apple ID

    I am Rakesh my apple ID is * and my ID apple is locked and I forgot my security questions answers please help me.

  • No to mi pc zip

    VOY al apagar icono y sigue prendida no zip

  • Update installation issues

    When you try to install Windows updates, it takes a terribly long time; and then I get the message 'Installation failure, recovery of changes' which lasts even longer. How can I stop this? First of all, I had the computer installed to automatic updat