Question about finding whether a reference number is NOT in the database?

Hello,
I use the following code to test whether the reference number is in the database
<ul><li>CURSOR cur_yellow</li></ul>
<ul><li>IS SELECT</li></ul>
<ul><li>REFERENCE_NO,</li></ul>
<ul><li>COMPANY_NAME</li></ul>
<ul><li>FROM CONSULTANTS;</li></ul>
<ul><li>rec_yellow cur_yellow%ROWTYPE;</li></ul>
<ul><li>BEGIN</li></ul>
<ul><li> OPEN cur_yellow;</li></ul>
<ul><li> LOOP</li></ul>
<ul><li> FETCH cur_yellow INTO rec_yellow;</li></ul>
<ul><li> EXIT WHEN cur_yellow%NOTFOUND;</li></ul>
<ul><li> IF ref_no = rec_yellow.REFERENCE_NO</li></ul>
<ul><li> THEN</li></ul>
HTP.print ('<ul><li><span class="style5">The information concerning the consultant selected has been deleted from the database.</span></li></ul>');
<ul><li> exp := 1; -- used to make code bullet proof</li></ul>
<ul><li> END IF;</li></ul>
<ul><li> END LOOP;</li></ul>
<ul><li> CLOSE cur_yellow;</li></ul>
Do you have any ideas for how to write code to test whether the reference number is NOT in the database.
Thanks
Doug

Hallo,
in general, yes, but I think , it will be better without cursor:
declare
v_dummy number;
BEGIN
EXECUTE IMMEDIATE 'select 1 from dual where
exists (select 1 from user_indexes where index_name = : ind_name) USING ''DOUGLASMYINDEX'
INTO v_1;
-- something
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
Is it necessary to perform it in dynamic SQL ?
declare
v_dummy number;
BEGIN
select 1 into v_1 from dual where
exists (select 1 from user_indexes where index_name = ''DOUGLASMYINDEX''')
INTO v_1;
-- something
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
Regards
Dmytro Dekhtyaryuk

Similar Messages

  • Question about Finder-Load-Beans flag

    Hi all,
    I've read that the Finder-Load-Beans flag could yield some valuable gains in performance
    but:
    1) why is it suggested to do individual gets of methods within the same Transaction
    ? (tx-Required).
    2) this strategy is useful only for small sets of data, isn't it? I imagine I
    would choose Finder-Load-Beans to false (or JDBC) for larger sets of data.
    3) A last question: its default value is true or false ?
    Thanks
    Francesco

    Because if there are different transactions where the get method is called
    then the state/data of the bean would most be reloaded from the database. A
    new transactions causes the ejbLoad method to be invoked in the beginning
    and the ejbStore at the end. That is the usual case but there are other ways
    to modify this behavior.
    Thanks
    Gaurav
    "Francesco" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi thorick,
    I have found this in the newsgroup. It's from R.Woolen answering
    a question about Finder-Load-Beans flag.
    "Consider this case:
    tx.begin();
    Collection c = findAllEmployeesNamed("Rob");
    Iterator it = c.iterator();
    while (it.hasNext()) {
    Employee e = (Employee) it.next(); System.out.println("Favorite color is:"+ e.getFavColor());
    tx.commit();
    With CMP (and finders-load-beans set to its default true value), thefindAllEmployeesNamed
    finder will load all the employees with the name of rob. The getFavColormethods
    do not hit the db because they are in the same tx, and the beans arealready loaded
    in the cache.
    It's the big CMP performance advantage."
    So I wonder why this performance gain can be achieved when the iterationis inside
    a transaction.
    Thanks
    regards
    Francesco
    thorick <[email protected]> wrote:
    1) why is it suggested to do individual gets of methods within thesame Transaction
    ? (tx-Required).I'm not sure about the context of this question (in what document,
    paragraph
    is this
    mentioned).
    2) this strategy is useful only for small sets of data, isn't it? Iimagine I
    would choose Finder-Load-Beans to false (or JDBC) for larger sets ofdata.
    >
    If you know that you will be accessing the fields of all the Beans that
    you get back from a
    finder,
    then you will realize a significant performance gain. If one selects
    100s or more beans
    using
    a finder, but only accesses the fields for a few, then there may be some
    performance cost.
    It could
    depend on how large some of the fields are. I'd guess that the cost
    of 1 hit to the DB per
    bean vs.
    the cost of 1 + maybe 1 more hit to the DB per bean, would usually be
    less. A performance
    test using
    your actual apps beans would be the only way to know for sure.
    3) A last question: its default value is true or false ?The default is 'True'
    -thorick

  • How does u find whether query touches aggregates or not?

    Hi gurus
         How does u find whether query touches aggregates or not?
    Thanks in advance
    Raj

    Hi Rajaiah.
    You can test this from TA RSRT -> Execute and debug -> Display aggregate found.
    Hope it helps.
    BR
    Stefan

  • I own a copy of CS5.5 that I have on my PC. I have switched to a new iMac and during activation it says my serial number is not for the product I'm trying to activate

    I own a copy of CS5.5 that I have on my PC. I have switched to a new iMac and during activation it says that my serial number is not for the product I'm trying to activate. I have tried live chat a couple times but it says that chat is not available.

    Jb4short you can verify your registered serial number under your account at http://www.adobe.com/.  You can find more details on how to locate your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.
    If you have a volume license serial number then you need to download the volume license installation files from https://licensing.adobe.com/.

  • Im going to restore my ipod touch(4th gen) to factory settings. my question is, how do i back up all notes from the app "notes" so they can be reinstalled? or is it allready backed up as per the main "back-up" ?

    im going to restore my ipod touch(4th gen) to factory settings. my question is, how do i back up all notes from the app "notes" so they can be reinstalled? or is it allready backed up as per the main "back-up" ? I know its a simple question, but i dont know the answer. please help.

    The iPod backup that iTunes makes includes Notes.and other app data. However, it does not included synced media like apps and music.
    Thus, just restore from backup with all your synced media in your iTunes library.
    iTunes: About iOS backups

  • Where is the Project Number value held in the database for i-Expenses..?

    afternoon gurus..
    As title asks - I need to find out where the project number field is in the database so I can query on it.. Or where could I find this out?
    It must be somewhere. The obvvious place, the AP_EXPENSE_REPORT_lines_all.project_id is blank whilst the cost code field is populated with the code_combination_id code.
    THanks for looking..
    S

    aha!
    In OIE.J and below , the project_id value was stored in AP_EXPENSE_REPORT_LINES_ALL table.
    From OIE.K an on ,the column name project_id was obsolete in ap_expense_lines_all table,
    and was added in table ap_exp_report_dists_all.
    good old MOS (sometimes...)
    S

  • How do I change my security questions for my apple ID if I do not remember the answers to my current security questions?

    How do I change my security questions for my apple ID if I do not remember the answers to my current security questions?

    If you have a rescue email address (an alternate email address is different) on your account then you can use that to reset them : http://support.apple.com/en-us/HT6170
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will have to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/en-us/HT5699
    If your country isn't on that page then try this form and explain and see what they reply with : https://ssl.apple.com/emea/support/itunes/contact.html
    When they've been reset, and if you don't already have a rescue email address, you can then add one for potential future use : http://support.apple.com/en-us/HT201356
    Or if it's available in your country you could change to 2-step verification : http://support.apple.com/kb/HT5570

  • Elite plus account online says my phone number is not in the system...

    Hello,
    I have been a member for many years, and have pretty much always used the same phone number when accessing the myrewardzone.com and at the store to apply the purchase.  However recently, when accessing the mybestbuy website, there is a notice to enter my phone number for verification to check points.  When doing so, it says that number is not in the system.  I just went a best buy store yesterday and purchased a TV using that number and it went through fine.  
    Is there anyone who can help with this?
    Thank you!
    -John

    Good morning jedimario,
    I hope you are having a good start to your weekend.
    I am the who, and from what I can see, you have quite a bit of unnecessary information on file (phone #s, mailing addresses, and email addresses).  I would strongly suggest that we update your information and get it down to three primary pieces.  Please send me a private message with the below information, by clicking on the blue button in my signature, and I will make sure everything is up-to-date.
    As far as your points, you should receive a 25% bonus for having Elite Plus status.  I looked over your points history and show that you have in-fact been receiving the bonus points.  You may not see those bonus points pending for recent purchases because it is fairly common for bonus points not to appear as pending, but they should post to your account within 20 days of the original purchase date.
    Name
    Phone #
    Mailing address
    Email address
    Thank you for reaching out to us on the forum!
    Derek|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Cheque printing error Restart number is not in the check file

    Dear Sap friends,
    I need to print the cheque using the standard program FBZ5. Since the client requires to change the description of vendor i am using FCH5 and manually creating the cheque for the payment document number.
    After the cheque no is attached to this document number i go to FBZ5 and am entering  this docuemnt number for printing the cheque.
    Initially i am getting the error
    You cannot print the manually created check AX002 AX002 500000
    Message no. FS675.
    This i have resovled by changing the message from error to warning.
    Later when i press enter i am getting the following error.
    Restart number is not in the check file or is not a From-number
    Message no. FS562
    How to i resolve this.
    Please help.
    Satish

    Exactly,
    If you really need such kind of facility, ask your ABAPER to develop a small report like below
    Selection criteria
    Document number - BELNR
    Conmpany code - BUKRS
    Fiscal year - GJAHR
    Output criteria
    Vendor name
    Amount
    Date
    Form has to develop for Check prinitng
    Thanks

  • IDOC number is not in the list

    Hi,
    I am creating an inbound delivery using IDOC. The message type is DESADV and basic type is DELVRY01. After I have populated the control and data tables, I processed them using IDOC_WRITE_AND_START_INBOUND. I have generated the IDOC number after executing the program. The problem is, when I go to WE02, the idoc number is not the list. I am not sure if the IDOC I generated is successful or not. Does it have something to do with the FM that I used. I set a custom process code that will call the FM IDOC_INPUT_DESADV1. Please advise. Thanks in advance.
    Lalyn

    Hi Arun,
    Thanks for the reply. But the IDOC number is not in the list and I can't access it WE19. Do you have any other Function module that I can use to process the IDOC in ABAP? The Function module should be the one to call the FM IDOC_INPUT_DESADV1 to create an inbound delivery. That's what I think causes the error. Thanks.
    Lalyn

  • Restart number is not in the check file or is not a From-number

    HI!
    I had  posted  payment Document  but i  got below error while  reprint  check from  FBZ5
    Restart number is not in the check file or is not a From-number
    "Message no. FS562"
    on that base, I had  check below  settinng 
    1) I  had check  Cheque no  register . It's  proper in series.
    2)Tcd:FBZP -> Pmt methods in country -> select your country
       and payment method 'C'. If 'Bank details' is checked on, then bank
       details of vendor master is mandatory for that payment.
    Awaiting for reply soon,
    thanking you,
    Rupang shah

    Hi,
    Commonly it will come for below situations:
    1. Client decided to use this check lots for manual payment & this checks already used, so this type of checks system not allowed to take reprint.
    2. You can only reprint checks created with F110, FBZ4, F-58 or FBZ5  (this checks have been printed by the system)
    Check the Payment method wise checks it is already issued / not PAYR - RZAWE
    system not allowed to reprint already exist in PAYR table checks.
    if you already use one check with payment method C now you want to use the same lot for payment method X then system not allow to print.
    Regards,
    Viswa

  • I know that iCloud backs-up apps and other stuff to your phone incase you want restore from a back-up if you start a New iPhone. My question is if I start a new iPhone (not use the restore from back-up option) and redownload apps like (games, Instagram),

    I know that iCloud backs-up apps and other stuff to your phone incase you want restore from a back-up if you start a New iPhone. My question is if I start a new iPhone (not use the restore from back-up option) and redownload apps like (Games, Instagram), would my pics show up on Instagram and would my Games show it was saved and the acccomplisments will remain from the last place I left out.

    Davin12 wrote:
    I know that iCloud backs-up apps and other stuff to your phone incase you want restore from a back-up if you start a New iPhone. My question is if I start a new iPhone (not use the restore from back-up option) and redownload apps like (Games, Instagram), would my pics show up on Instagram and would my Games show it was saved and the acccomplisments will remain from the last place I left out.
    Icloud or itunes backup, only backs up app data, not the app itself.
    so if you restore as new, then there is no app data on your phone, you start out new...

  • How do I reset the answers to my security questions on my iTunes account if I do not remember the answers to them?

    How do I reset my security questions on my iTunes account if I do not remember the answers to them?

    Click here for information. If you can't reset them through the method described in that article or by sending yourself a rescue email(the email may take a few hours to arrive), contact the iTunes Store staff via the link in the 'Additional Information' section.
    It isn't possible to create a rescue email address without correctly answering two of the questions. Nobody on these boards can reset them for you.
    (94839)

  • HT204074 I have just changed my iPad mini password a day ago when trying to log on today it worked fine until about 4:30 (GMT) when I could not access the device using the correct password. I am absoloutley 100% sure it's correct. Any help?

    I have just changed my iPad mini password a day ago, and when trying to access it today it worked fine until about 4:30 (GMT) when I could not access the device using the correct password. I am absoloutley 100% sure it's correct.Additional details:I was last using Kik messenger before it stopped working.I was sitting less than two foot away from the PS3 my brother was playing.I'm 14 but I'm not some spoilt kid who gets iPhones and iPads from his parents to mess around with, I have got important coursework and homeworks on there.Any help would be great Thanks.

    Hello ConfusedLlama
    If the password is not working to get into your iPad mini, you would need to follow the steps to restore it. If you have a back up through iCloud or through iTunes, you can restore from that back up and it would not bring back the passcode unless it is encrypted.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Regards,
    -Norm G.

  • I am a student and i bought an macbook air about 1 month ago but i did not get the 100 giftcard from the apple store. can i still get it?

    Hi, I am a student and i bought an macbook air about 1 month ago but i did not get the 100 giftcard from the apple store (that comes when students purchase computers).Am i still eligible to get it?

    Not usually.
    Apple has had similar offerings every year, to which they always establish a time interval for elligibility. I've not seen where they give credit to prior sales on the education perks.

Maybe you are looking for

  • Home sharing won't play but airplay will.

    Setup: PC (Win 7) running Itunes 11.0.1.12 over WiFi N (2.4ghz) 3rd Gen Apple TV Ethernet connected directly to router. I've got the ATV to see my home sharing just fine.  When I go to play a movie/tv show it sticks on the loading screen for over 5 m

  • How can I orf files in bridge and photoshop cs4

    I have downloaded the latest plugins but still can't open raw files form my OMD-E-m5

  • Static ip option in wifi and media player in notif...

    compare to other mobile os this two feature is need in windows phone ...microsoft should add static ip configuration and media player in the notification bar. so that user can easily chage and access he songs. if DHCP is not enable we can't access th

  • Flash play speex support?

    hello - i saw where flash-10 was going to support speex, but i cannot seem to find a working example. does anybody know how to use the flash player to run a speex audio? i used to be able to easily encode mp3 using either 44100k  or 22050k and play w

  • Custom tab should dislay the same data as in std tab in create Mode

    Hi all, I have added a custom tab (Overview tab) in transaction VL32N and Vl33N using the  BADI "LE_SHP_TAB_CUST_OVER". Now for transaction Vl31N,when I  create delivery ,tthne also this tab should be displayed.However I dont understand,if i display