Problem while retriving a value in a loop

Problem scenario

I have a loop in which I am retriving a value of a variable and printing, which is of type varchar
and the only one of the variable is concatenated with a numeric value

I'm trying to recover he definition of function, but I can't recover it finally loop
because the final amount may be null. Its a permutation that only the value of the loop may have a number
concatenated.

Can someone please help me to retrieve the digital value...

I can't show the example of a loop because I am retriving the values to a file

I want to recover the last numeric value of the loop and print it...

Just give an example to show the script

declare
v_temp varchar2 (100);
number of v_final;
Start

-loop
v_temp: = 'Sun ';
v_temp: = translate (v_temp, translate (v_temp, '. 0123456789', ' '),' ');
dbms_output.put_line ('Temp :'|| v_temp);
v_temp: = 'Mon5.1 ';
v_temp: = translate (v_temp, translate (v_temp, '. 0123456789', ' '),' ');
dbms_output.put_line ('Temp :'|| v_temp);
v_temp: = 'kills ';
v_temp: = translate (v_temp, translate (v_temp, '. 0123456789', ' '),' ');
dbms_output.put_line ('Temp :'|| v_temp);
-v_final: = to_number (v_temp);
dbms_output.put_line ('v_final' | v_final);
-unite

-end loop;
end;
/

Not at all certain. Can be like that

declare
v_temp varchar2(100);
v_final number;
begin

--loop
v_temp:='sun';
v_temp:=translate(lower(v_temp), '1abcdefghijklmnopqrstuvwxyz', '1');
dbms_output.put_line('Temp:'||v_temp);
v_temp := v_temp || 'Mon5.1';
v_temp:=translate(lower(v_temp), '1abcdefghijklmnopqrstuvwxyz', '1');
dbms_output.put_line('Temp:'||v_temp);
v_temp:= v_temp || 'Tue';
v_temp:=translate(lower(v_temp), '1abcdefghijklmnopqrstuvwxyz', '1');
dbms_output.put_line('Temp:'||v_temp);
v_final:=to_number(v_temp);
dbms_output.put_line('v_final'||v_final);
--coalesce

--end loop;
end;
/

Tags: Database

Similar Questions

  • Problem while retriving attribute values

    Hi, I am unable to retrieve attribute values
    <?xml version="1.0" encoding="iso-8859-1" ?> 
    <root>
       <r1   temp2="10.10.2000">
          <r2    temp3="yyyyyy">
           <r3>1</r3>
           <r4>pxxxxx</r4>
           </r2>
          <r2  temp3="xxxxxx"  >
           <r3>2</r3>
            <r4>qxxxxx</r4>
           </r2>
    </r1>
    </root>
    =============

    Create table Temp_tab (date of the dater1,
    namer2 varchar2 (20).
    number of R3,
    R4 varchar2 (20));

    =============
    code}
    create or replace procedure (var XMLType) IS
    BEGIN
    -Insert data
    INSERT INTO temp_tab (dater1, namer2, r3, r4)
    Select value (li) .extract (' / r1 / @temp2 ') .getStringVal ();
    value (li) .extract (' / r2 / @temp2 ') .getStringVal ();
    value (li) .extract (' / r2/r3/text()').getStringVal (),)
    value (Li). Extract('/R2/R4/text()').getStringVal)
    Li table(XMLSequence(var.extract('/root/r1/r2')));
    EXCEPTION
    WHILE OTHERS THEN
    fnd_file.put_line (fnd_file.log,'Oracle Exception: ' |) SQLCODE | "| SQLERRM);
    END test;
    /
    I am getting the below output
    
    DATER1    NAMER2          R3     R4
    --------- -------------------- --------- --------------
                                           1 pxxxxx
                                           2 qxxxxx
    
    I need to get as
    
    DATER1            NAMER2                R3     R4
    ---------              --------------------    --------- --------------
        10-Oct-2000        yyyyy               1     pxxxxx
          10-Oct-2000      xxxx                2     qxxxxx
    
    Can some one help me
    
    Thanks.....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    I could do on my 11 g

    SQL> with t as (select xmltype('
    
       
          
           1
           pxxxxx
           
          
           2
            qxxxxx
           
    
    ') xml from dual
    )
    ---
    ---
    select x.*
      from t t,
             xmltable('for $i in root/r1/* return element e {$i/../@temp2, $i/@temp3, $i/r3, $i/r4}'
                         passing t.xml
                         columns temp2 varchar2(20) path '@temp2',
                                      temp3 varchar2(20) path '@temp3',
                                      r3 varchar2(5) path 'r3',
                                      r4 varchar2(15) path 'r4') x
    
    TEMP2                TEMP3                R3    R4
    -------------------- -------------------- ----- ---------------
    10.10.2000           yyyyyy               1     pxxxxx
    10.10.2000           xxxxxx               2     qxxxxx         
    
    2 rows selected.
    
  • a problem in passing multiple values in the loop settings for

    Hi all

    I am facing a problem in passing multiple values in the loop settings for.


    EX:

    CREATE or REPLACE PROCEDURE (pr_id OUT NUMBER) HAVE


    tab type is table of NUMBER;

    TEMP_TAB TAB;

    BEGIN

    Select the COLLECT LOOSE pr temp_tab pr_id;

    I'm in 1.TEMP_TAB. loop of COUNTING

    PR_ID: = temp_tab (i);

    end loop;

    END TEST;

    OUTPUT:-

    pr_id = 234578


    in the example above, I'm only a value as an out parameter. but I send you PR_ID of the loop.
    why I don't get all the values that the parameters.please offer a solution for me.

    Thank you my friend.

    More clarification, let's look at your code...

    -- create a procedure and have a single numeric out variable
    CREATE OR REPLACE PROCEDURE TEST ( pr_id OUT NUMBER ) AS
      -- declare a type as an array of numbers
      type tab is table of NUMBER;
      -- declare a varianble of that array type
      TEMP_TAB TAB;
    BEGIN
      -- query all the values from the table into the array
      select pr_id BULK COLLECT INTO temp_tab from pr;
      -- loop through each value in the array
      for i in 1..TEMP_TAB.COUNT loop
        -- set the value of the single OUT parameter, OVERWRITING any previous value it has
        PR_ID := temp_tab(i);
        -- loop around to the next value
      end loop;
      -- end the procedure with the final value of PR_ID
    END TEST;
    
  • How to get the updated values of the loops while they are running

    Hello

    I am trouble with a very basic problem, how to access the updated values of the "loop FOR" during operation?  Basically, the VI I is currently working on two sub vis calls each sub VI has a loop for, and the two screws may or may not work for the same number of iterations. My goal is to read the values in each terminal within the loop of two sub VIs, in primary VI. I tried to do this using Global Variables, but in main VI it will display only the last iteration of the two value sub live. Could someone please tell me whrere I go wrong? Is there any other/better way to do this.

    I appreciate any input on this issue.  

    Pass a reference of the main VI control to the Sub screws.  See attached example.

  • How to export a value of a loop for?

    Hello

    I have a loop and a few other loops running at the same time. The loop is used to read the values of a PMT connected to a data acquisition. I need to export the value of the loop counter in order to to use in a case statement, which takes place outside of the loop. I tried the defintion it out of the loop, using automatic indexing (which exports an array containing all the values of the counter stacked from what I understand) or without automatic indexing, which as I understand it only exports the current value of the loop. But these two were not working, I tried for example to print the value of the counter on an indication on the map and it was like no matter what. On the contrary, when I put an indicator inside the loop it was printing the value of the counter normally. Do you have tips on how I could do or why is - it does not work? I also checked records the shift but it does not resemble their use is appropriate for my problem.

    Thank you

    George

    If you do a search (at least in LabVIEW 8.6.1) under "Help", "search for the help of LabVIEW" 'producer' you will find discussions on what you're trying to do. "Under the 'Fisland ', 'New" pulldowns, should also, under 'Frameworks' "Design Patterns" there are called examples ' Producer/consumer' will open a model in different ways to do what you are trying. As being the previous poster said, while that globals are not inherently bad, their use comes with certain risks. There has been a number of discussions on that (and the people who can provide one, so like, 'local' risk). Without going too deeply into it, the main concern is to know when the data is read from them are valid/updated compared to when it is written.

  • Value of the loop 'For' pass before the complete loop - FPGA

    Hello

    8.5 LV, LV FPGA, PCI 7831-R FPGA Board

    I got a cramp of brain on this one.  I have a function (Arb. GIS read) that Im using to generate an arbitrary signal which I created in memory.  I can't move to the value of data however.  I don't know why I can not, its because it is nested in a "loop For" who runs indefinetly and updates only the value whenever it loops back to 'zero '.  Ideas quick and dirty on how to use this value as it is being updated in the loop in my hand vi?

    I've seen messages on the use of local variable 'Files' and property nodes, but I can not just give a sense the.  Maybe because it's FPGA, something is different/no supported?

    * My principal is 'control MicroMirror Arb. SP", look in the #4 case and the condition of"false. "

    The 'Sub - VI' is called 'Arb Sig read RevB', and I'm trying to pass the variable 'Data' to hand while the loop For always runs.

    Thank you!


  • Facing problem while in place emphasis on the pop-up component interface user

    Hello team,

    Jdev - 12.1.2.0.0

    I am facing problem while emphasizing one of the UI element (af:inputtText) of pop - up to

    Scenario-

    I have a jsff page.

    On the page, I have a button and a pop up

    When you click the button, pop up comes with 10 text entry box. By default, his shows on the first field accent, but I want it to be on the second text box.

    I already have a client component to TRUE for the two input as well as pop-up text

    Please suggest me any hint/help

    Code: -.

    < af:inputText label = "#{ctapmainBundle.Accountno}" id = "pt_it2" "

    partialTriggers = "b11".

    value = "#{pageFlowScope.bannerFlowManager.Criteria.AccountNumber} '"

    autoSubmit = 'true '.

    Validator = "#{backingBeanScope.bannerFlowBean.validateAccountNumber} '"

    Binding = "#{backingBeanScope.bannerFlowBean.AccountNumber} '"

    clientComponent = "true" >

    < af:clientListener type = "keyUp" method = "enterKeyEvent" / >

    < / af:inputText >

    function setFocusOnAccount (event) {}

    Alert ('Hi');

    var component = event.getSource ();

    Alert (' component name ' + component);

    var characterCounter = component.getParent () .findComponent ('pt_it2');

    Alert ('characterCounter with Parent' + characterCounter);

    var characterCounterId = characterCounter.getClientId ();

    Alert ("text entry id ' + characterCounterId");

    characterCounterId.focus ();

    }

    Thank you

    Céline

    Hi guys,.

    I found the solution,

    I changed my customer contact on af:pop - up to earlier that I was calling from button makes part of the same page and he called client listener first and then pop up.

    If my goal is not to set to pop - up field.

    So now I'm able to get the focus on the pop-up field.

    Here's the code.

    function setFocusOnAccount(event) {}

    Alert ('Hi');

    var component = event.getSource ();

    Alert (' component name ' + component);

    var characterCounter = component.getParent () .findComponent ('pt_it2');

    Alert ('characterCounter with Parent' + characterCounter);

    characterCounter.focus ();

    }

    contentDelivery = "lazyUncached".

    popupFetchListener = "#{backingBeanScope.bannerFlowBean.searchPopupClearFields} '"

    popupCanceledListener = "#{backingBeanScope.bannerFlowBean.resetPopUpFields}" > "

     

    Thanks Dario, Ashish and Arun who helped me.

  • Facing problem while getting a point and the location

    Hi all

    I am facing a problem while creating a relationship between the item and location using API INV_LOC_WMS_PUB. CREATE_LOCATOR. CREATE_LOC_ITEM_TIE.

    Error: PLS-00225: subprogram or cursor reference 'CREATE_LOCATOR' is out of range
    Online: 16

    Here is the code that I use

    create or replace procedure Item_loct (retcode out varchar2, errbuff out varchar2)
    is
    g_return_status VARCHAR2 (1): = fnd_api.g_ret_sts_success;
    g_msg_count DEFAULT NUMBER of 0;
    g_msg_data VARCHAR2 (2000) DEFAULT NULL;
    l_msg_index_out NUMBER;
    cursor c1 is select * from item_inv_loc; - where rownum < num_rec;.
    Start
    I'm looping c1
    FND_GLOBAL. APPS_INITIALIZE (FND_GLOBAL. USER_ID, FND_GLOBAL. RESP_ID, FND_GLOBAL. RESP_APPL_ID);

    INV_LOC_WMS_PUB. CREATE_LOCATOR. CREATE_LOC_ITEM_TIE (p_inventory_item_id = > i.item_id,)
    p_organization_id = > i.organization_id,
    p_subinventory_code = > i.subinventory_code,
    p_inventory_location_id = > i.locator_id,
    p_status_id = > i.loc_status,
    x_return_status = > g_return_status,
    x_msg_count = > g_msg_count,
    x_msg_data = > g_msg_data);
    fnd_file.put_line (fnd_file.log, 'Return Status =' | g_return_status);
    If s = g_return_status"THEN
    FND_FILE. Put_line (fnd_file.log, 'Success');
    elsif (g_msg_count > 1) THEN
    FOR j IN 1... g_msg_count
    LOOP
    oe_msg_pub.get (p_msg_index = > j,)
    p_encoded = > fnd_api.g_false,
    p_data = > g_msg_data,
    p_msg_index_out = > l_msg_index_out
    );
    FND_FILE. Put_line (fnd_file.log, l_msg_index_out |) '. ' || g_msg_data);
    END LOOP;
    -ELSif
    -FND_FILE. Put_line (fnd_file.log, g_msg_data);
    end if;
    end loop;
    end;

    Please tell where I hurt e? If you have the sample program, please report

    Hello
    Please decide that you want to call the procedure...

    CREATE_LOCATOR / CREATE_LOC_ITEM_TIE - but you have tried calling both of them, this is the reason for this error.

    INV_LOC_WMS_PUB. CREATE_LOCATOR. CREATE_LOC_ITEM_TIE

    Use your code will work fine...

    INV_LOC_WMS_PUB. CREATE_LOC_ITEM_TIE

    Kind regards
    Yuvaraj.C

  • I have no sound watching videos with firefox but no problem while using internet explore

    I have been using mozilla firefox on my laptop for a long time.recently I've upgraded to the new version of mozilla firefox 7. yesterday, I m facing problems while watching videos. I have no sound with videos using mozilla firefox but I have no problem with sound when using internet explorer.kindly solve the problem with my firefox.

    See also:

    You can click on the Volume icon in the Windows taskbar near the clock and click on the link to mix down to open the mixing console.

    You can adjust the volume level for each application in this window, so make sure that Firefox is not set to mute or set at a low level.

    The current versions of Firefox using the process of plugin-container to run plugins, check the volume control for the process of plugin-container.

    You will see the program Firefox or the Plugin Container in the mixer if you are on a website that plays sound.

  • Hi, actually I want the program stops when you press the stop button. but the problem is the program is runing in loop only he doesn't return tile view deleted complete execution of any body can help me for this.

    Hi, actually I want the program stops when you press the stop button. but the problem is the program is runing in loop only he doesn't return tile view deleted complete execution of any body can help me for this.

    Here

  • No matter what I try to play, I get this message, "Windows Media Player has encountered a problem while playing the file." And the media player does not work

    Windows Media Player

    No matter what I try to play, I get this message, "Windows Media Player has encountered a problem while playing the file."  And the media player does not work

    Reset the WMP.

    Step by step instructions are given here: -.

    http://www.mydigitallife.info/how-to-uninstall-and-re-install-Windows-Media-Player-12-WMP12-in-Windows-7/

  • Windows Media Player encountered a problem while playing the file. (MPEG)

    Windows Media Player encountered a problem while playing the file. (MPEG)

    Don't know why Windows Media Player does not accept your mpeg.

    Just a suggestion:

    Use a video converter and change your mpeg to wmv format and read it.

    If you don't have a video converter, google for a free Converter. No need to buy a.

    You can also install VLC media player.
    It's free.
    He plays almost all kinds of formats.
    It is widely used and recommended.

    If you are interested, here is the link:

    http://www.videolan.org/VLC/

  • Having problem while playing a game of Wow

    Original title: other for microsoft to scan my computer and find an im problems?

    started to have problems while playing a game of wow. starts fine then cant get in my articles, press Esc. but do not go to the minamizes inter face just, if I got to the laptop will not let me type anything

    Hi James,

     

    1. have you done any recent hardware or software changes to the computer before the show?

    2. What is the number of brand and model of the computer?

    Please follow the link and check with the question:

    Game hangs or quits unexpectedly:

    http://support.Microsoft.com/kb/303032

    Note: Also applies to non-Microsoft games.

    Important note: You must follow step 7 of the article mentioned above to recover the computer to Normal startup after you complete all the steps.

    The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    I hope this helps.

  • Windows Media Player does not. I get the message "Windows Media Player encountered a problem while playing the file. For any additional help click web help. »

    Original title: Windows Media Player does not

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    I have Windows XP Professional and have tried playing the CD through Windows Media Player. I get the message "Windows Media Player encountered a problem while playing the file. For any additional help click web help. "Then I do. Nothing here helps me. The player shows all my music but puts little red x showing that he can't play. Help! I downloaded version 11 of Windows Media Player, but it is saying the same thing.

    Thank you.

    Hello

    1. don't you also get an error with the message code?
    2 have you installed third-party readers part?
    3. What is the format of the files you are trying to play?

    Follow these steps and check if they help.

    Step 1:

    I would have you readers of third party temporarily Uninstall and check if persists it to the question.

    Step 2:

    Most likely you need codecs to play these files with Windows Media Player. I suggest looking up codec in the Internet that supports the file format, download and install them.

    See also:

    Player Windows Media for Windows XP supported Codecs

    WARNING OF THIRD PARTY
    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    See also:

    Windows Media Player Error Message help

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • I am facing problem while seraching & folders inside my computer files.

    I am facing problem while seraching & folders inside my computer files. I have always marked the option "Show hidden files & folders" before I start looking for, but it's automaticaliy turn unmarked & I can't seem to find the hidden files & folders. I use XP Service Pack 3.

    Some infections of virus and spyware uncheck the option "Show hidden files & folders" to keep you from finding their files.

    Update your antivirus program and run a full scan.

    Download, install and run the Microsoft Windows Malicious Software Removal Tool scans and Malwarebytes' Anti-Malware .

Maybe you are looking for