first name and collection methods

Hello

Billy explained in a recent thread that do not use such and .last methods. Can someone explain this indetail. What are the problems, we will be facing if we use these?

https://forums.Oracle.com/thread/2590384

A loop in a table (do not use . First and . Last methods but if you fully realize the consequences of this):

  1. Start
  2. ...
  3. for I in 1.myArray. Counting loop
  4. .. do something with myArray (i)
  5. end loop;

I prefer the following construction:

I: = myArray.first;

loop

output I have is zero;

do something with myArray (i);

I: = myArray.next (i);

end loop;

It works on the associative and normal collections.

Also, it will not fail if the collection is null.

According to the first, last or 1.count will give an error with the rare collections, when indexes are not contiguous.

For example, a collection where myArray (1) and myArray (3) exist, but there is no such thing as myArray (2).

declare

type t_myArray is table of index varchar2 (64) by pls_integer;

myArray t_myArray;

Start

myArray (1): = "foo";

myArray (3): = 'bar ';

because me in 1.myArray.count

loop

dbms_output.put_line (myArray (i));

end loop;

end;

This will give an ora-01403 no data found

in the same way:

declare

type t_myArray is table of index varchar2 (64) by pls_integer;

myArray t_myArray;

Start

myArray (1): = "foo";

myArray (3): = 'bar ';

I'm in myArray.first... myArray.last

loop

dbms_output.put_line (myArray (i));

end loop;

end;

will also give ora-01403

but it works perfectly:

declare

type t_myArray is table of index varchar2 (64) by pls_integer;

myArray t_myArray;

I have pls_integer;

Start

myArray (1): = "foo";

myArray (3): = 'bar ';

i: = myArray.first;

loop

output I have is zero;

dbms_output.put_line (myArray (i));

I: = myArray.next (i);

end loop;

end;

Tags: Database

Similar Questions

  • account is not found, name, first name and date of birth, but it is not!

    try to allow my sons xbox account after the recent upgrade.  After I have connect and click Yes to give him access he says I need acount.live.com to visit t enter my name, date of birth, but when I visit it and login, my name, first name and date of birth are there.

    I'm lost for what to do.
    Any ideas?

    Hi all

    This could be caused if there is no synchronization between the Xbox LIVE account information which are obtained on the LIVE and the information stored locally on your console. Try to remove the profile (delete profile only) and download the album LIVE profile. Here's how:

    How to remove Xbox Live profile safely
    Before to delete your profile, that you know the user name and password for your Microsoft account that is associated with your profile.

    1. Go to settings, then System.
    2. Select storage.
    3. Select all the devices.
    4. Select Gamer profiles.
    5. Select the gamer tag you want to delete.
    6. Select Remove.
    7. Select delete profile only. This deletes the profile but leaves saved games and achievements.

    Clear cache Xbox system
     
    1. Press the Guide button on your controller, go to settingsand select system settings.
    2. Select storage or memory.
    3. Storage device highlight and press is on your controller.
    4. Select clear system Cache.
    5. Clear your cache of Xbox 3 times online system.

    Restart your console

    Download Xbox Live profile.

    1. Press theGuide Xboxbutton on your controller (large button in the center of your controller X).
    2. Select the option download profile.
    3. Enter the Microsoft account associated with your Xbox LIVE player number.
    4. Enter the password for your Microsoft account.

    Let us know in case you need more help.
  • SQL for substr first name and family name

    Hi How can I subtr first name and family name

    Select first_name + lastname of employee

    for example if I have michael james I what to have JMichael

    Select your table instead of two. We do not have your tables and does not have the validation of samples, results, etc...

    Select upper (substr (one, 1, 1)) | initcap (substr (one, instr (1,' ') + 1)) result

    from (select job |) ' ' || Ename a

    WCP

    )

    RESULT
    Kill
    MBlake
    MClark
    MJones
    AScott
    AFord
    CSmith
    SAllen
    Ground vegetation
    SMartin
    STurner
    CAdams
    CJames
    CMiller

    Concerning

    Etbin

    Post edited by: Etbin

    example of the EMP

  • Extract the first name and last names of a string

    Hello people,
    I am trying to extract the last name, first name, first name and initial of some names of students for a report. I have some success with the first name and the first names, but have some difficulty to come with the other two. I use Oracle 9i and would like to come with the SQL.

    Script to create the table:
    create table grad_student_tb
    (student_id varchar2(3) primary key,
     salutation varchar2(4),
     student_name   varchar2(60));
    Script to insert records into the table:
    Insert into GRAD_STUDENT_TB (STUDENT_ID,SALUTATION,STUDENT_NAME) values ('001','Mr','Adams,Robert Murphy');
    Insert into GRAD_STUDENT_TB (STUDENT_ID,SALUTATION,STUDENT_NAME) values ('002','Mr','Green,Eric Craig');
    Insert into GRAD_STUDENT_TB (STUDENT_ID,SALUTATION,STUDENT_NAME) values ('003','Miss','Brown,Jennifer William H');
    Insert into GRAD_STUDENT_TB (STUDENT_ID,SALUTATION,STUDENT_NAME) values ('004','Mr','Adams,Michael William H');
    Insert into GRAD_STUDENT_TB (STUDENT_ID,SALUTATION,STUDENT_NAME) values ('005','Miss','White,Snow');
    Here's what I would like on my report:
    Student ID   First Middle Name    Last Name   First Name   Initial
    ==================================================================
    001          Robert Murphy        Adams       Robert       M
    002          Eric Craig           Green       Eric         C
    003          Jennifer William H   Brown       Jennifer     W
    004          Michael William H    Adams       Michael      W
    005          Snow                 White       Snow
    Currently my SQL looks like this:
    select student_id,
           SUBSTR(student_name, INSTR(student_name,',')+1, LENGTH(student_name)) first_middle_name,
           SUBSTR(student_name,1, INSTR(student_name,',')-1) last_name
    from   grad_student_tb;
    Output:
    STUDENT_ID FIRST_MIDDLE_NAME                                            LAST_NAME                                                    
    ---------- ------------------------------------------------------------ ------------------------------------------------------------ 
    001        Robert Murphy                                                Adams                                                        
    002        Eric Craig                                                   Green                                                        
    003        Jennifer William H                                           Brown                                                        
    I need to come up with the first name and initial of the students.

    Any help is greatly appreciated!

    Thank you

    Published by: Roxyrollers on August 18, 2011 12:53

    Assuming that each name is exactly the same format

    SQL> ed
    Wrote file afiedt.buf
    
      1  select student_id,
      2         SUBSTR(student_name,
      3                INSTR(student_name,',')+1,
      4                LENGTH(student_name)-INSTR(student_name,' ')) first_name,
      5         SUBSTR(student_name,
      6                INSTR(student_name,' ')+1) middle_name,
      7         SUBSTR(student_name,
      8                INSTR(student_name,' ')+1,
      9                1) middle_initial,
     10         SUBSTR(student_name,1, INSTR(student_name,',')-1) last_name
     11* from   grad_student_tb
    SQL> /
    
    STU FIRST_NAME      MIDDLE_NAME          MIDDL LAST_NAME
    --- --------------- -------------------- ----- ---------------
    001 Robert          Murphy               M     Adams
    002 Eric            Craig                C     Green
    003 Jennifer        William H            W     Brown
    

    In general, of course, analysis names as it is much more complicated because you have to deal with the family as "la Hoya" names that contain spaces and cannot easily be distinguished from someone with several names.

    Justin

  • Need space between the first name and family name

    Hi, I use Concat to join the first and last name, but I need a space between the two...

    Hello

    Try this concat (concat ('users'. "First name",""), 'Users' '. "" Family name")

    Kind regards
    Young

  • Auto generate database login on initial first name and the last user... LC Designer

    First initial + last name = user name...

    Text field + = text field text field...

    can I use javascript to generate the name of the first form loginname (Int first) and family name?

    For ex... First name: John

    average int: k

    Last name: Doe

    LoginName: jdoe

    var LoginName = getField("LastName").value;

    var FirstName = getField("FirstName").value;

    If (' FirstName! = "")

    LoginName += "" + FirstName.substring (0.1) + "."

    Event.Value = LoginName;

    don't know if it's true... Please help

    You guys are both using the Acrobat JS notation so you're not having much luck.

    In LK there is no getField or event.value and values are returned from fields by using fieldName.rawValue (or .formattedValue).

    I put this on the Calculate of the LoginName field event:

    var vFirstName = FirstName.rawValue;

    var vLastName = LastName.rawValue;

    If (!) (FirstName.isNull) | LastName.isNull)) {/ / if the two data fields}

    this.rawValue = vFirstName.substring (0.1) + vLastName;

    }

  • SEPARATE THE FIRST NAME AND LAST NAME

    How to separate the first and last name? the first name is always first.

    With the help of 10g,.
    select (Tim Tebow) from dual

    Not an easy task.

    Sir Nicholas Mimsy Porpington
    John Jacob Jingleheimer Schmidt
    Dear

  • Apex access user meta-data such as first name and family name

    Is it possible to access the metadata user such as the name and surname of the logged-on user? I know how to get the username through APP_USER, but I'd like to be able to access the other meta-data user that are stored in the user record. Thanks for any help.

    Published by: Klabautermann on February 22, 2013 10:52

    Klabautermann wrote:
    fac586,

    .. .to not to mention when one of my users will on the lamb and change their alias... :-) I agree with your observation of 3NF, and am happy insert the user ID and join for the statement, but what to attach to? I can't find a file specifications for user apex data table, and the suspect is not generally available in view of the apex_util.fetch_user requires permission from the admin.

    No, it is accessible to the public through the view of APEX APEX_WORKSPACE_APEX_USERS. The data in the view are visible to one workspace schemas.

    Note however that for the serious long term production use Oracle (and me) recommends creating a sign personalized with user data in your own tables.

  • 10.10.5 running on macbook pro. I want my email when received on the receiver side to read with my first initial, followed by my first name, and last name. But it always appears as name the middle initial, then last name.

    I want my email, as it appears to the recipient to read: my first initial, followed by my middle name, then my family name. But no matter what I try,

    It always appears as name the middle initial, then last name. any suggestions?

    Not knowing what you have already tried

    -Preferences - accounts - e-mail did change the name of the account alias help?

  • I want that my address book to view all entries by first or last name and have filled all the information accordingly.

    Original title: address book

    I want that my address book to view all entries by first or last name and have filled all the information accordingly. However, I have a mixture of the first name and the name of the list alphabetically when I scroll down tom insert name in an e-mail message. My list of contracts is organized by all the names first. How can I sync the address book to match the list of contacts?

    Hi tgblueblade,

    1. what email program are you using?

    2 are. what device or software you using Sync?

    If you use Windows contacts, then this isn't the ability to synchronize the list of Windows contacts to be identical to the list of e-mail contacts.

    Manage your contacts

    http://Windows.Microsoft.com/en-us/Windows-Vista/managing-your-contacts

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • contacts first name last name live mail

    I use Windows Live Mail on Windows 7. When I enter a new contact, he invites me to enter in the "first name" and "last name". I'm doing this, but when I use the contact in a new e-mail message, it always displays the contact as "LASTNAMEFIRSTNAME. I can outsmart him by reversing my entry to the first name in 'last name' and the name 'first name', but it's crazy to do.

    In addition to say Ron, for future information, Windows Live Mail doesn't not part of Windows, it is a part of Windows Live Essentials. (Yes I know the name of this forum is confusing!)
     
    You will get much better and more rapid responses to your questions to WLM by posting in the forum Windows Live Mail here:
     
    http://windowslivehelp.com/product.aspx?ProductID=15

  • The title, first name, the name of the fields in the form database

    The field current which is title, first name and family name, which is provided in British Colombia to form building is no longer relevant to the business practices of today, in addition to the fields where you fill out, the more people will not.

    We could continue with the simple name, E-mail address, we actually want to try to capture the name in itself, like this time in the children of the WORLD to every person - dear {FirstName}.

    I know the title seems to be mandatory, it is not actually and you can easily remove the html code

    My question is: can I just get out the Javascript for name verification procedure

    Currently, BC have this

    <! [CDATA]

    var submitcount87552 = 0; function checkWholeForm87552 (theForm) {var why = ""; if (theForm.FirstName) why += isEmpty (theForm.FirstName.value, "Name");} If (theForm.LastName) why += isEmpty (theForm.LastName.value, "Last name"); If (theForm.EmailAddress) why += checkEmail (theForm.EmailAddress.value); If (why! = "") {alert (why);} return false ;} If (submitcount87552 == 0) {submitcount87552 ++; theForm.submit (); return false ;}; else {alert ("the form submission is in course."); return false ;}}}}

    []] >

    If I remove this article-

    If (theForm.LastName) why += isEmpty (theForm.LastName.value, "Last name");

    Will this work or is it a problem

    <! [CDATA]

    var submitcount87552 = 0; function checkWholeForm87552 (theForm) {var why = ""; if (theForm.FirstName) why += isEmpty (theForm.FirstName.value, "Name");} If (theForm.EmailAddress) why += checkEmail (theForm.EmailAddress.value); If (why! = "") {alert (why);} return false ;} If (submitcount87552 == 0) {submitcount87552 ++; theForm.submit (); return false ;}; else {alert ("the form submission is in course."); return false ;}}}}

    []] >

    Hello

    Could you please check the following link,

    Customization of Web Forms

    Check under "Combining the first and last name in a name", you should get an idea about it.

    Let me know if you have any question.

  • How to sort by last name and first name, family name

    I'm unable to find a path in the address book to find a way to sort by first name

    Thanks for your help

    To sort by first name:
    View > Show name as: "first of all, the last

    To sort by last name:
    View > Show name as: ' last, first

    View > sort by > name and order growing

    In your case, affect the 'Show name for what is' first of all, the last
    then set the name and ascending sort

  • 'My card' when contact is not me, and it won't let me change it or delete the info. for the person mentioned (which is having the same first name as I do). Any ideas?

    'My card' when contact is not me, and it won't let me change it or delete the info. for the person mentioned (which is having the same first name as I do). Any ideas?

    iPhone OS 9.2 6.

    I already tried to delete information about the person identified as "my card". Because the phone think it is 'my card' delete the contact and/or modify the information. does not work.

    Create a new contact with your correct information, who like 'My card' to:

    Settings > Mail, Contacts, calendars > Contacts > my info

  • I would like to change the name in my profile my name and my company name, so when my clients receive a signature on the Forms application, my company name is displayed in the email as opposed to my first and last name. How can I change

    I would like to change the name in my profile my name and my company name, so when my clients receive a signature on the Forms application, my company name is displayed in the email as opposed to my first and last name. How can I change this? I tried to edit my profile however my first and last name are not editable fields.

    Hello Laurag92400722,

    You connect with Adobe ID account E-Sign? If Yes, then you can directly connect to your Adobe ID account and can update the name as the name of the company and it will reflect in your E-Sign account as well.

    -Usman

Maybe you are looking for