Need help in a loop

Hello everyone
I need help with loop for
in pl/sql, I see that we do have to give County loop increment for
However if I want to increment suppose 2 so what to do
I want to print an own of stars using the loop
Like this
         *
      * * *
   * * * * *
 * * * * * * *
However, I am able to print at a right angle triangle
*
**
***
****
*****
******
begin
for i in 1..10
loop
 for j in 1..i
  loop
 dbms_output.put('*');
 dbms_output.put(' ');
 end loop;
 dbms_output.put_line('');
 end loop;
 
    end ;
Published by: Sara on November 22, 2010 03:28

Published by: Sara on November 22, 2010 03:37

Published by: Sara on November 22, 2010 03:37

Published by: Sara on November 22, 2010 03:38

Tags: Database

Similar Questions

  • Need help with while loop and shift registers

    I have a broad set of data and required to read data at maybe 200 samples at a time to process these samples through my VI and have add and concatenate a file separate lvm.  The part where I am confused is the shift registers. How can I limit the number of samples read in an iteration? How do the while loop to stop when all data are read in?

    I have attached my diagram, there may be something wrong with my technique?

    This will give you an idea.  There are a lot of other (probably more effective) methods.  It is a basic solution, quick and dirty to help you grasp the overall concept.

  • Need help with a loop of a function

    Hello experts,
    I'm in a bit of a mess of ideas,

    I have a form with different fields of research.

    based on the values that I'm passing, I'm back certain values in my form
    Here's my function
    CREATE OR REPLACE function LOTTO_EROUTES.f_forecast(p_ret_num        in varchar2, 
                                                        p_item_id        in number,
                                                        p_curr_date      in date,
                                                        p_expected_stock out number ,
                                                        p_actual_stock   out number,
                                                        p_inst_settled   out number,
                                                        p_prev_date      out date  ,
                                                        p_range          out number,
                                                        l_settled_avg    out number,
                                                        p_coefficient    out number                                                  
                                                        )
    return number is
    l_forecast_num number;
    l_curr_cdc  varchar2(6);
    l_prev_cdc varchar2(6);
    l_forecast_err varchar2(50) := 0;
    l_game_id number;
    begin
    
      select game_id,STOCK_COEFF_LEVEL_DAYS,IPS_SETTLED_RANGE_DAYS
      into l_game_id,p_coefficient,p_range
      from items
      where item_id =p_item_id;
    
    
    l_curr_cdc  := ltrim(rtrim(to_char(f_get_cdc_num(p_curr_date),999999)));
    
    l_prev_cdc := (l_curr_cdc - p_range);
    
    p_prev_date := f_get_cdc_date(l_prev_cdc);
    
    select count(serial_number) 
    into p_inst_settled
    from LOTTO_INSTANT_TRACK
    where game_id = l_game_id
    and retailer_num = p_ret_num
    and status = 'Settled'
    and cdc between l_prev_cdc and l_curr_cdc ;
    
    l_settled_avg := ceil(p_inst_settled / p_range);
    
    p_expected_stock := ceil(l_settled_avg * p_coefficient);
    
    select count(serial_number) 
    into p_actual_stock
    from LOTTO_INSTANT_track
    where game_id = l_game_id
    and retailer_num = p_ret_num
    and status like 'Confirmed';
    
    l_forecast_num := ceil((p_expected_stock - p_actual_stock));
    
    return l_forecast_num;
    
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    return l_forecast_err;
    end;
    /
    Now I'm passing 1 single value for p_ret_num (retailer number) in my service, I appreciate to p_item_id and p-curr_date, which is by default sysdate.

    now, I should be able to convey all the dealer number and return these values accordingly.

    I think I have a LOV which will have the option 'ALL' through which the user will select and it should return all of its values.

    I know I should have a loop but don't know how to do this. Anyone can guide me please.

    Thank you

    Turning the LOV 0 value for * ALL * as you said in the previous thread here...
    Help in LOV

    The code calling the function will then look like this...

    declare
         CURSOR Fetch_Ret IS
              select retailer_num
              from lotto_retailers
              where agent_status_id = 2
              AND retailer_num = DECODE(:criteria.retailer_num,0,retailer_num,:criteria.retailer_num);
    
         default_date date := :oe_header.order_date;
    begin
         :oe_lines.order_date_disp := default_date;
    
         FOR Get_Ret IN Fetch_Ret LOOP
              :OE_LINES.FORECAST_CNT := f_forecast(  Get_Ret.retailer_num,
                                  :criteria.item_id,
                                  :OE_LINES.order_date_disp,
                                  :OE_LINES.expected_stock,
                                  :OE_LINES.current_retailer_stock,
                                  :OE_LINES.avg_calculated_amt,
                                  :OE_LINES.from_date,
                                  :OE_LINES.calc_stock_coefficient,
                                  :OE_LINES.avg_daily_sales,
                                  :OE_LINES.stock_coefficient_used
                                       );
    
              :OE_LINES.AVG_WEEKLY_SALES := (     :OE_LINES.avg_daily_sales * 7 );
         END LOOP;
    END;
    

    If the data block is tabular, then use GO_BLOCK outside the loop and the NEXT_RECORD integrated inside the loop.

    -Clément

  • Need help of LabView on loops

    I'm doing a LabVIEW MyRIO project on how to display the values. Basically, I give myself a LCD screen and a keyboard. I'm supposed to show three sequences in the order. First, it must ask the user to enter a number on the keyboard to choose his field of interest. Then depending on the number, the user is prompted again to choose another number to specify the particular value he or she wants to watch. Finally, the value is displayed and the user can choose to return to the previous sequence interface by pressing a key. Each of the three sequences are able to "hold" until the user presses a button.

    I am able to attend the second interface using all loop inside a structure of the case, but I don't know how to start pressing a button to return to previous sequences. I need help on this particular part.

    Thanks in advance!

    The code that looks way too complicated for the problem you described.  Where is the state machine that we suggested to you?  Why so many useless people sequence structures?

  • Need help with loops

    Hi all

    I am a beginner in Labview. If need help in loops. Please check the attached vi and suggest me the procedure I followed is effective or not. If this is not the case, correct me.

    Waiting for answer

    According to the commentary of diagram, table sizes are all 16, then here is everything you need:

    (Hmm, clips chiseled Booleans in the constant diagram, just ignore that)

    "Elements of an array AND" checks if all a real (upper thread)

    'The GOLD table elements' check if at least one is true. (all others)

  • Need help to identify the type of object in the loop of pl/sql

    Hello

    I need help to identify the Type of object declared beneath a procedure as shown below:

    I need to pass the parameter to the procedure as a TYPE of OBJECT and also refer to variables of Type Object in a loop

    create or replace type TEST_VALIDATION_REC is RECORD (order_num varchar2 (30),)

    number of inventory_item_id

    reserved_YN varchar2 (1).

    error_flag varchar2 (1).

    Error_message varchar2 (2000)

    );

    CREATE OR REPLACE TYPE VALD_TBL AS VARRAY (10000) OF TEST_VALIDATION_REC;

    PROCEDURE ADD_TO_ORD)

    p_lot_number_list IN VALD_TBL,

    p_ord_number IN Varchar2,

    p_user_id in NUMBER: = fnd_profile.value ('USER_ID'),-change 1.10

    p_responsibility_id in NUMBERS: = fnd_profile.value ('RESP_ID'),-change 1.10

    p_application_id IN VARCHAR2: = 'PO',-change 1.10

    x_error_flag OUT Varchar2,

    x_error_msg OUT Varchar2

    )

    In the above procedure, I had the VALD_TBL. Is it OK?

    And how in the loop if the records if I use:

    FOR indx1 IN 1.p_lot_number_list. COUNTY

    LOOP

    BEGIN

    SELECT

    inventory_item_id

    IN

    ln_item_id

    Of

    dummy_lot_tab

    WHERE

    lot_number = p_lot_number_list (indx1); - > how direct the item here?

    EXCEPTION

    WHILE OTHERS THEN

    ln_item_id: = NULL;

    END;

    Records are PL/SQL objects.  They are not the SQL objects.  You can create a SQL TYPE (schema level) as a collection (variable-tables only, tables nested).

    So therefore your first statement is syntactically incorrect

    CREATE OR REPLACE TYPE TEST_VALIDATION_REC IS RECORD
    (order_num VARCHAR2(30),
    inventory_item_id NUMBER,
    reserved_YN VARCHAR2(1),
    error_flag VARCHAR2(1),
    Error_message VARCHAR2(2000)
    );
    

    You must put in an anonymous PL/SQL block or the stored procedure

    DECLARE
    
       TYPE test_validation_rec IS RECORD
       (
        order_num VARCHAR2(30),
        inventory_item_id NUMBER,
        reserved_YN VARCHAR2(1),
        error_flag VARCHAR2(1),
        error_message VARCHAR2(2000)
       );
    
       TYPE vald_tbl iS VARRAY(10000) OF test_validation_rec;
    
       lv_tbl vald_tbl;
    
    BEGIN
    
       lv_tbl := vald_tbl();
      -- insert your code here 
    
    END;
    
  • The product I bought doesn't work! I need help and I was stuck in your 'contact us loop' for the last few days and I'm frustrated. How can I contact you for help!

    The product I bought doesn't work! I need help and I was stuck in your 'contact us loop' for the last few days and I'm frustrated. How can I contact you for help!

    Probably the best place to start is the right forum for your product. This is the forum for Distiller Server, a product used by corporations long dead, and probably not what you have. If you can't find the right forum, please let us know the FULL name of what you paid for (Please check your invoice, as Adobe have a lot of similar products), and we may be able to direct you. Good luck!

  • Need help with an Audio loop with ACE

    I built a graphic in which audio fades out on a button click. I need also the audio loop, but I can't understand how do. I fiddled it of some old code that I had, probably found on the net, and I don't know where to put the parameters in a loop. Everything that it works just like I need to, I just need the looping sound. Can anyone help? Here is the code:


    Create sound objects *.


    this.createEmptyMovieClip ("holder1", this.getNextHighestDepth ());
    var mySound1:Sound = new Sound (holder1);
    mySound1.loadSound ("yourmusicgoeshere.mp3", true);


    action button *.

    necessary variables:
    var onFaded:Function;
    var currentSound:Number = 1;
    var occupied: Boolean = false;
    var counter: Number;
    //

    B2.onRelease = function() {}
    fadeOut (mySound1);
    };

    B3.onRelease = function() {}
    fadeOut (mySound1);
    };

    bStop.onRelease = function() {}
    mySound1.stop ();
    currentSound = 0;
    };


    fade out function *.


    function fadeOut(theSound:Sound) {}
    counter = 100;
    busy = true;
    clearInterval (nInterval);
    nInterval = setInterval (adjustSoundDown, 10, theSound);
    }
    function adjustSoundDown(theSound:Sound) {}
    If (counter < = 1) {}
    clearInterval (nInterval);
    theSound.stop ();
    busy = false;
    onFaded();
    } else {}
    -counter;
    theSound.setVolume (counter);
    }
    }

    the best you can do if you are streaming your sound is to use a listener onsoundcomplete to restart your sound when it is finished.

  • Need help with network home using Airport extreme

    I need help with my home network.  I'm not very aware when it comes to all things network.  Here's how my network is currently set up.

    Cable modem to Airport Extreme for Gigabit Switch.  Cables come out of the switch to all areas of the House.  I have 2 other extreme airport connected in other rooms of the House directly on the wall that dates back to the switch.  I hope I am explaining that properly.

    My problem is that this seems to have caused some of my connections cable does not work.  When everything is configured, it has worked well.  All connections in the House worked.  Then we have disconnected one of the extreme airport and moved to another location in the House to have the best wifi coverage.  Since that time, a lot of the ethernet wall plugs are not working.  For example, when I plug in my Macbook Pro in making ethernet in my kitchen, it says connected but it has an assigned ip address and cannot connect to the internet.

    Any help you can provide would be great.

    I would like to get the return tech to help you to...

    But it is likely that something (or someone) has tampered with the settings.

    The layout is fine... but you can cause problems with the network by creating a loop.

    This can happen because the AE you moved is connected wrongly... somewhere in the network it is connected to the switch again.

    Or AE is set to expand wireless... It's FAKE... It will loop the network on the back main EI wireless.

    Unplug the two AE you have that function as extensions...

    Turning off everything else... then it works again...

    Do it in this order.

    Modem... Wait 2 min

    AE... Wait 2 min

    Switch.

    Now check that the network is working properly... power of customers in various locations and make sure everything is good.

    If so, then manually reset the two AE of factory and redo their installation.

  • Need help for reading in parallel on the same interface and writing XNET

    Hello. I need help to configure CAN interface to write and read from the same interface.

    I use NI PXI-8513/2. I use CAN1 as interface.

    My had TO send status messages CAN every 100ms. I have to read in order to return akntoowlege to keep DUT CAN interface happy and not make mistakes.

    So, I want to open Strim Session and readall frames in the loop. At the same time, I need to be able to write in a frame HAD at the time...

    I only need to read one picture at a time too, but since I know the ID, I can pull it from the stream.

    What I'm confusing all is how to put in place the same CAN1 interface to be able to write and read in parallel.

    I think I would get errors that interface is already in use.

    Since I'm new to CAN, I was read and write only when necessary. But, sometimes I was getting errors on my messages. Sometimes I get message, sometimes miss me. But, when I run CAN test criminal as sniffer he sends and written every time. I was told it's because it recognizes all messages.

    I opened to suggestions of how best to implement the interface.

    I guess I can use CAN2 and separator to work around this problem, but I would use an interface if possible.

    Thank you

    Hi Rus,

    The XNET hadrware takes care of most of the low level of detials for you. The reading and writing of the circuits are both connected to the bus at any time. When you write to the hardware it will try to put a frame on the bus at the first opportunity he can. If the frame loses arbitration material re - will attempt to send the frame up is successful. Reception equipment monitor activity on the bus, regardless of what it conveys. The material received will usually throw a framework that was sent by communication equipment, but there is an Echo property pass to circumvent this behavior too.

    Take a look at the example of the expedition: MAY-> NI - XNET-> Sessions-> multiple Sessions Intro-> CAN even exit entry framework Port unique Point.vi. Keep in mind that this example you will need to use a second CAN interface to recognize frames, it transmits. I would recoment against the example CAN output Frame Single Point which would mimic your ECU if you choose a type of cyclic frame running this example.

  • Need to view daq reads per second but only to record a reading every 10 minutes. I would also like to record the date and time, at the same pace. Need help

    Need to show daq reads per second, but only to record a reading every 10 minutes, need help

    You are also looking to taste to 1 Hz data acquisition?

    My approach would be to use the DAQ acquisition to time your loop display reading each acquisition, then use the loop counter to control the logic of your writing to file.  For 1 Hz and 10 minutes write I would use 'quotient and remainder' I / 600; If rest = 0, then write the data point.

    For the date and time, under Calendar palette use the time get in seconds food a DateTime Format to a string.

  • need help! brike S6000

    Hi every1 I have flashed my device and bad recovery image collapsed I tried to restart it I had meta and recovery mode, but the recovery screen shows these three operations: recovery, quick mode, normal mode by pressing any botton it hangs for minutes then don't reboot loop, no logo no sound screen led just empty my q is cannot I he unbrick bootable sd will do the job How? I have the stock firmware great need help please thank you

    Use this tool to install drivers for your tab. See here: -.
    http://Forum.xda-developers.com/showthread.php?t=1983470

    Using that you can install the drivers for any device. Now, I think you would be knowing how flash ROM flash SP tool. If this isn't the case, then after return.

  • [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an auto update that's simple to install, just get this error every time

    [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an automatic update that's simple to install, just get this error at each time HHHHEEEELLLPPPPP! Thank you

    I had the same problem.  But finally found a solution.  If your listing is similar to mine, then keep.  XP Media Center Edition 2005 (sp2).  AMD Athlon 64 x 2 Dual-Core, HP a1630n desktop computer.

    Go to the HP website, search for sp37394-XP sp3 Upgrade utility Microsoft for systems equipped with AMD processors.

    I had the same 0 x 80240036, 0x8024400a error, but realize my problem was really get manually downloaded sp3 and installed without continue loop crashing and not error messages.

  • NEED HELP WITH MY HP PAVILION G6

    Hi, I installed an update on my HP Pavilion g6 one moment he keeps saying "FAILED TO CONFIGURE WINDOWS updates updates RESTORE DO NOT turn OFF YOUR COMPUTER" then it restarts and says "INSALLING updated" then he says: "CONFIGURING UPDATES" a return to the first message and continues to turn in circles It has been like this for more than 3 hours, please help someone

    Hello @lisavstar ,

    Welcome to the HP Forums!

    I understand that the computer is stuck in a loop of update. I will do my best to help, but first, I need the following information:

    1. number of the exact model of the computer. If you need help to find this information, please see this site: Product Guide to find your mobile phone number

    2. the operating system. If you need help to find this information, please visit this site in order to determine the Windows operating system.

    3. can you computer go into the BIOS?

    4. have you installed new software or drivers on this computer, before the problem appeared?

    5 can you launch the computer in Mode safe?

    In addition, if you can, I would make a system restore. I want that bring you the computer to the earliest possible restore point, in an attempt to Dodge everything that has the problem. Here is a document on how to perform a system restore: System Restore

    Mario

  • Need help with the batch file command - move all files/folders

    I need help creating a simple batch file that performs the following operations:

    Move all files AND folders in a source folder to a target folder. The source folder will be mklinked with the target folder and an infinite loop can be possible, not sure if any order would be necessary here to avoid this? Executed once A thing, or a thing to stop?

    It comes to free up space on an SSD by iTunes forced location for backups and apps to be physically on another HARD drive, but available as if it were in default location.

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.technet.Microsoft.com/forums/en-us/home

    http://social.msdn.Microsoft.com/forums/en-us/home

Maybe you are looking for

  • Aerial view day 1000 / copy of picasa

    Hello. Is there really no way this piece of neat and very expencive equipment can slide show - see photos from picasa? Do I really sit and press "next image" on the remote control, all the time? Also, the guy in the store said it was supposed to auto

  • Utm9s double vpn double wan

    Hello world is my first time that I'm dealing with a firewall, netgear, anda sicerely I'm having a problem with a configuration. I have 2 utm9s and was asked to me to configure mode vpn dual wan dua. Let me be more specific, we have 2 site with each

  • IZotope Ozone plugin disappeared from FCPX

    IZotope Ozone 6 is still on my computer and I can run as a stand-alone, but it is no longer available in my effects.  How do I re - install?  I don't remember having to do anything a year when I bought it; Just recognized FCPX and let me use it as a

  • ART on Lollipop

    Hello! How works of ART on the lollipop? He has need of a huge storage as in KitKat or something?

  • convert LabVIEW 5.0 8.5

    Hi, when I try to open the attachment screw, labview gives me error 10: too old record, could someone please convert this to a newer version so I can open it? I'm using Labview 8.5.  Thanks in advance!