How to display the value of the variable for bottom of pl/sql

How to display the value of the variable for bottom of pl/sql

declare

V_1 number: = 10;

V_2 number: = 20;

V_3 number: = 30;

v_4 number: = 40;

v_5 number: = 50;

test varchar2 (100);

Start

I'm in 1.5

loop

test: = "v_" | I have;

dbms_output.put_line(i||) e > ' | test);

end loop;

end;

/

How to get below output:

1 > v_1

2 > v_2

3 > v_3

4 > v_4

5 > v_5

But I want to output of

1 > 10

2 > 20

3 > 30

4 > 40

5 > 50

Hello

You cannot reference variables as you did and get the value of the variable. Use pretty collection.

set serveroutput on size 2000
declare
  type      number_table is table of number;
  numbers   number_table := number_table(10, 20, 30, 40, 50);
begin
  for i in numbers.first .. numbers.last
  loop
    dbms_output.put_line(i || '->' || numbers(i));
  end loop;
end;
/

anonymous block completed
1->10
2->20
3->30
4->40
5->50

See the Collections of PL/SQL and Records http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS005

Tags: Database

Similar Questions

  • How to display a value constant and variable

    Hello
    I'm trying to display a variable in sql the line of command and oracle xe object browser. Here is a small code to assign a value to a variable of an existing column name id that has value 4567 plane of the table. I'm a newbie, so forgive my ignorance:

    Report the number of new_num;
    Start
    Select code in new_num of aircraft where id = 4567;
    end;
    /

    Issues related to the:
    1. something wrong with the code?
    2. How can I he discovers via sql more command line?
    3. can I see it in Oracle XE gui object browser?

    Kind regards
    Valerie

    Dbms_output.put_line ();

    declare new_num number;
    begin
    select id into new_num from airplane where id=4567;
    dbms_output.put_line('new_num:'||new_num);
    end;
    /
    
  • How to display the note for a cell of table with javascript?

    My goal is to do it with javascript. No manipulation of the side server.

    < af:table id = "t1" >
    < af:column id = "c1" >
    < af:outputText id = "ot1" >...
    < af:clientListner ...method="showpopup"/ >
    < /... >
    < /... >
    < /... >

    ....

    < af:popup id = "p1" >
    < af:noteWindow id = ot2 >
    here to show the value of ot1
    < /... >
    < /... >


    function showPopup (e) {}
    var text is e.getSource () .getValue ();.
    var popup is e.getSource (.findComponent("::p1"));.
    now, how to upgrade the content of the notewindow?
    Popup.Show ();
    }

    Hello

    You can try with something like that.

                   
                        
                    
    
                    
                        
                            
                        
    
                    
                    
                        function showPopup(evt){
                            var ot1 = AdfPage.PAGE.findComponent("ot1");
                            var text=ot1.getValue();
                            var popup=AdfPage.PAGE.findComponent("p1");
                            var ot2=AdfPage.PAGE.findComponent("ot2");
                            ot2.setValue(text);
                            popup.show();
    
                            }
    
                    
    

    Arun-

  • Oracle UCM - how to display the reason for the rejection workflow

    I've created a workflow

    Contributor->->-> approval of HOD Reviewer2 Reviewer1

    If Reviewer1 Reviewer2 or approval of HOD "REJECT" the document that it redirected to the last step of the workflow. All rejection, they enter "reject the reason", but the reason for the rejection is not displayed to the user of most recent workflow.

    I need a solution to most come

    Thank you
    Deepak

    Please read the readme.txt file. It clearly states:

    ""If you wish, include display_reject_reason could be used to display the reason.". (i.e. it has not yet been added to any page)

    What you need to do is add a line

    <$include display_reject_reason$>
    

    somewhere in workflow_review_frames.htm (or find an inclusion where it can be added).

  • How to display the ToolTip for button

    Hello

    I use 11.1.1.4.

    I want to show the ToolTip in the button. tag that so I want to use and to display the ToolTip.

    Best regards, rami

    Rami,

    Use the property 'shortDesc"of the button.

    John

  • How to display the Description for the selected instead of the ID value

    Hi I have a problem I want to display a description on a combo box list of values instead of the ID when I want to use ir to a formlayout or af:query for estethic

    because I found this link:

    http://vikasadflovdevelop-ADF-Lov.blogspot.com/2012/06/v-behaviorurldefaultvmlo.html?showComment=1389196282800

    https://blogs.Oracle.com/ADF/entry/combo_lov_how_to_display

    The Archives of the Incident: ADF: LOV Description instead of the code

    but none of them works really or I don't no how to make someone can helpme please

    I am new to ADF and jdeveloper

    Hello

    The below tutorial works very well, as I've used in several applications

    The Archives of the Incident: ADF: LOV Description instead of the code

    I guess that u missed a few steps. Just follow step by step as shown in the blog.

    Thank you

    Nitesh

  • OBIEE - how to display the variable 'OVERHAUL'

    Hello fellow BI users.

    I have a question. On my home page I want to have a message that says: "Welcome to the portal of BI, this page has been updated: {date last updated}." In my view, there is a chain of "latest revision".

    Can someone tell me please how to do this?

    See you soon,.
    Mauricio

    For example, use static text view and the following syntax @{biServer.variables ['NQ_SESSION.]} {[LastRunDWH']}
    Variable session is LastRunDWH.

    Kind regards

    Stefan

  • How to display the ddl for a view

    In oracle 11g how can I write a query which will display a view initial create MATERIALIZED view?

    I know that you can click on the SQL tab in sql developer, but how can I do the same thing with a query?

    Hello

    996454 wrote:

    In oracle 11g how can I write a query which will display a view initial create MATERIALIZED view?

    I know that you can click on the SQL tab in sql developer, but how can I do the same thing with a query?

    Yes, the code is in the data dictionary:

    -In SQL * Plus, do this first:

    VALUE LONG 8000

    SELECT text

    From user_views

    WHERE view_name = 'MY_VIEW '.

    ;

    You can also use dbms_metadata for getting this.

    What do you mean by "seen statemnt to create initial display ?  If you create a view and then do a CREATE or REPLACE VIEW statement, then the initial definition is lost. only the most recent is kept in user_views.

  • How to display the information for the account of the past...

    original title: old perental controll reports

    How to view information for a user account on my computer from the past? All I can shoot upwards is from today, when I walk them. I don't need any kind of detailed information just the password of the account and if it has been changed since its creation. It was only created a cpl months however. Please help lol!

    Hi Candy86,

    There is no way to recover old passwords the value on the computer, or the old parental control information.

  • How to display the plan will contact a specific sql in pl/sql?

    Hello Experts,

    Maybe it's a very simple question, but I really wonder, how explain the plan to the following sql.

    DECLARE

    The p_value number;

    BEGIN

    I'm IN (SELECT * FROM emp WHERE empno = p_value)

    LOOP

    -do something

    END LOOP;

    END;

    Thank you

    Activate the trace session

    Run your PLSQL

    End of the session trace.

    Your trace file is now ready.

    Use utility TKPROF to see the trace.

    Now, you will see the SQL used in PLSQL program used execution plan.

    Read using Application tracing tools

  • Question: How to display the rating for the SURVEY

    Hello

    I use Lightroom for years. I like to use the mode of INQUIRY.  But today, I couldn't see the stars rating under each photo in the mode of inquiry; I don't see the status of the indicator.  Now, it's probably something I did, like hit a shortcut or something... but for the life of me, I can't understand how to bring this Visual information.  After searching online + fiddling around with the settings, I finally thought I'd come here and ask if anyone knows...

    Thank you!

    PS. Lightroom 4.3RC (why 4.3 RC, because I am one of these with a super slow Lightroom plagged in develop mode, especially with my D800 files!) I'm crossing my fingers with each update RC software is faster... )

    Look closely

  • How to write the function for bottom of logic...

    I have a picture in the picture I have a records like below
    code value
    1 20
    2 null
    3 30
    4 null
    5 40
    6 null


    The output need to have the values displayed in the fields first, followed by the NULL values as below

    code value
    1 20
    2 30
    3 40
    4 null
    5 null
    6 null

    I think the suspicion is that the values must be concatenated with the replacement of NULL values with (;).
    as
    20, 30, 40
    Get single values and insert into the table...

    for this I don't know how to write function for who can please help me on these...

    Published by: Claudia on June 22, 2011 22:45

    Published by: Claudia on June 22, 2011 22:51

    Create or replace function test_fun
    is
    cursor fun1 is the value select from table by CSA 2;-"this select query will return 20,30,40, null, null, null".
    v_out varchar2 (20);
    Start
    fun1 open cursor;
    loop
    extract the fun1 in v_out;
    dbms_output.put_line (v_out); - this is the command display output on the screen.
    output when fun1 not found %;
    end loop;
    close;
    end;

    Please try it and tell us if no query...

    Thank you
    IQ

  • How to display Quick values in the story

    With the help of 11.1.1.6.2

    In a dashboard page, I have a table with a hierarchy of dimension for the organization. If you click on a division he runs a link action to call a script in the browser (javascript in a text on the dashboard section) from the division. If you expand the section, and then click on a market, it calls the function javascript even.

    Then, the Javascript function uses path go to update an analysis in an iFrame on the dashboard page and passes the value of the Division or the market value.

    The analysis of the target has two filters: Division is invited and the market is invited.

    So, after all, my question is how could display two values from the call of the road go into a narrative on the analysis of the target? Or I guess the other question is how to view the filter on the narrative values.

    Sorry for the long explanation, but I hope it makes sense.

    Thanks for any help or suggestion.

    Brad

    Try something using the Div tag
    for ex:
    < div id = filterValues > @{WeekBetween} {Default Value} < / div >
    < script >
    var i = document.getElementById('filterValues').innerHTML;
    document.getElementById('filterValues').innerHTML = aParams ["varDivision"];
    < /script >

    If brand pls help

  • How to display the values of this query? The type is XDB. XDB$ STRING_LIST_T

    Hi all

    If I run this query using a tool like developer PL/SQL (SQL window), the values are displayed as a Collection. Just click and see the results of the al.

    Select
    dbms_resconfig.getRepositoryResConfigPaths)
    Of
    Double;


    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    How can I do? With the help of the table? Create a type?

    TKS

    user12083350 wrote:

    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    SQL> select * from table(dbms_resconfig.getRepositoryResConfigPaths())
      2  /
    
    COLUMN_VALUE
    --------------------------------------------------------------------------------
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    7 rows selected.
    
    SQL> 
    

    And in PL/SQL:

    SQL> declare
      2      v_list xdb$string_list_t := dbms_resconfig.getRepositoryResConfigPaths();
      3  begin
      4      for i in 1..v_list.count loop
      5        dbms_output.put_line(v_list(i));
      6      end loop;
      7  end;
      8  /
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

    Published by: Solomon Yakobson, April 24, 2010 15:04

  • How to display the results in the order based on the value of research

    Hi all

    How to display the results in the slot order.
     
    
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    
    output: 
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ..
    ..
    ..
    ..
    ...
    If the user makes a search with "MADONNA", I view the results as title begins with "MADONNA" first then the rest of the records.
    Please let me know is possible to show the results in this order.


    Kind regards
    Rajasekhar

    This can be a little more specific:

    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
    
                  SONGID TITLE
    -------------------- --------------------------------------
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    

Maybe you are looking for

  • Shutdown in Vista with a Portege M400 problems

    Hello! I have a problem with my Toshiba Portege M400 (do not know if it is a matter for the Council of vista or portege support plate, anyway). I installed Vista Express Upgrade a few months ago and everything worked fine for a while.But over the las

  • Import pictures disappear when deleting photo stream

    When I put photos into albums, I hope that they will be saved in my local library on my Mac, because they were in iPhoto.  But in the Photos when I delete a photo from my photo stream I had imported a local album, the photo is no longer present in th

  • How to customize the bookmark window? Change "tags" for "keyworkds.

    I usually use the keys ctrl + d for bookmarks, but when I hit him open the popup with 'Name', 'Folder' and 'Tags '. I wan't to know if it is possible to add the "Keywork" here too. The simple question is: is possible to customize the bookmark popup b

  • Satellite Z830-10J - ECO Utility does not install

    Hello I have 12 Ultrabooks Satalite Z830-10J all installed in the same way.I have a Ultrabook where I can not install the Utillity ECO I get a warning with a yellow triangle and nothing more...Tried different versions, but none works. How can I solve

  • my game bioshock crashes?

    Hi I have windows 7 ultimate. I installed bioshock and it crashed as soon as I started the application with appcrash problem. Please tell me how to avoid this problem and improve the compatibility of windows 7 please. It is not compatible with the ha