Please help with the best way of adding together numbers like this ..

Hey.
What's the best way with J2ME to acheive this .. I have an integer, let's the it's value is "123456" and what I wanna do is to add them together this way: 1 + 2 +3 + 4 + 5 + 6. How would I do that? Thanks in advance!

My solution should keep going until you have all the digits added, regardless of the number of digits. Because it divides the number by 10 each time through the loop, it'll stop when you have divided it enough to reach 0 using integer division. So if your number only has 1 digit, the loop will only run 1 time, and if you have a 20 digit long value (change types to long), it'll run 20 times.
If you want all of the digits added up, this'll do it. If you want the first n digits, and don't know how many digits(m) there are it's going to need a different approach. If you know how many digits long the number is....
int number = 12345678;
int totalLength = 8;
int usefulDigits = 3;
int firstDigit = totalLength - usefulDigits;
for(int i=0; i < totalLength; i++){
    if(i >= firstDigit){
        sum += a % 10;
    a = a / 10;
}This requires you to figure out how many digits are in the number ahead of time. I'm not sure about the fastest way to do this, but I'd likely do it with a series of if() statements that look for the number of digits in a binary-search style...
//pseudo code...
if(num >= 10000){
    //at least 5 digits...
    if(num >= 1000000){
        //at least 7 digits...
        ... fill it in ...
    }else{
        //5 or 6 digits...
        if(num >= 100000){
            //six digits...
            return 6;
        }else{
            //5 digits
            return 5;
}else{
    .... just like above...
}Edited by: hooble on Jan 28, 2008 10:07 AM

Similar Messages

  • Can ayone help with the best way to restore my software function?

    Hi, I'm running OS 10.6.8 on an intel iMac.
    I haven't done a software update for a while, due to poor connection speed, but last night, as the 'net was zipping along nicely for me, I installed all the latest reccommended updates, some via software update, but iTunes I downloaded from the apple download page.
    When all the updates were installed, I restarted the Mac.
    Now a large proportion of my applications, both native and non-apple, will not run.
    I should add that I use firefox, and updated that last night as well.
    I ran disk utility, and verified and repaired permissions. (A lot of repairs needed there!)
    I tried to verify the hard drive, but it showed as needing repair, so I rebooted from my snow leopard install disc and ran the disk utility repair from there, successfully.
    After I restarted in the usual manner, my software still won't run.
    All I get is the "iTunes (or whatever app) quit unexpectedly" box. Hitting reopen from there just gives me the same again.
    Do I need to go back and reinstall everything from scratch? OSX? Just the non-functioning apps?
    The current hard drive is the third in this machine (iMac originially purchased at the start of 07).
    Last time we replaced the drive was about this time last year.
    I restored from time machine  - the last saved back-up from there was from July of last year, as for some reason, time machine had not worked properly in the interim - I think because the drive was too full, or some such.
    Anyway, I was in the process of doing a complete reinstall, update and overhaul after getting the new hard drive.
    We managed to savage some of the data from the old drive, so I was going to replace what files I could into the system, then erase my external hard drive and start time machine fresh. Trouble was, the family (and there's a lot of us) all jumped in and started using the machine before I got through updating everything and I got fed up trying to sort it out. I never started time machine again. I've backed up anything I wanted kept safe on an portable external drive and a couple of USBs. Therefore my more recent data is safe if I need to go back to that time cpsue back-up from last July.
    Not sure about everyone elses. My external drive probably has enough space on it to copy pretty much everything from the main hard drive, but I can't use it via time capsule. It's the wrong format, and I dont want to lose the data I have already copied to it. I could just ignore the fact the others will lose their files, but I'm not that mean spirited, so will try to back up for htem if I can, before I do anything drastic.
    If I have to erase and reinstall, is it possible first to just to copy the whole drive manually to the space on my portable drive, or should I just copy everyone's user files and the cntents of the shared folder?
    I'm not hugely experienced in this, so I'd be grateful for any useful suggestions.
    Thanks, in anticipation.
    ~ Betty.

    Thanks. All your help is really appreciated. I wish I could report a better outcome.
    I gave it a try. Got this:
    while ! curl -C - -O 'http://supportdownload.apple.com/download.info.apple.com/Apple_Support_Area/Appl e_Software_Updates/Mac_OS_X/downloads/041-4966.20110725.gt5tv/MacOSXUpdCombo10. 6 .8.dmg'; do sleep 10; done
    ** Resuming transfer from byte position 299
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
    curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
    So, no luck there.
    Sleep is always nice, but I don't find I need it ar 2.28 in the afternoon! I'm in Western Australia, so I'm guessing we're in vastly different time zones.
    I'm currently attempting to get 10.6.7 combo via speed download. Thus far, 1.6% received in around half an hour. CUrrent estimated time remaining approx 33 hours!
    No ethernet cable.
    DSL is not available to me. I'm on a pair gain, so the only way for me to get broadband is via my wireless modem.
    I tried to do network diagnostics when software updated kept failing.
    It's very odd. External modem, which is what I'm using, is greyed out, so I can't select it.
    No point checking the other options. Ethernet just tells me I'm not connected to ethernet or DSL, which I know. Airport wants me to select a network to join. What? I'm connected to the net NOW, via my external wireless modem. Airport is turned on, but that's only so that the other folks in my house, should they choose to do so, can connect their laptops via airport through this machine.
    I've never had a problem with software update until I did the first download of the 10.6.8 combo, following the instllation of which, everything went kablooie.
    I guess I'll just wait however long it takes for this speed download (not speedy, due to my currently restricted to dial-up speed isp account - but at least I can resume if interrupted) of 10.6.7 to finish and see how that goes. It could be another couple of days before I know.
    Failing that, I think my next step is to go to my local Mac expert (shop 30 minutes drive from home) and see what he can suggest. It occurs to me that he may be able to give me the 10.6.8 combo on a disc or USB drive, so I can give it another try before we proceed to costly investigations. He may or may not charge me a little something for copying the .dmg file for me, but I really dont want to have to get into paying his hourly service rate for further work, if I can manage to sort it for myself. The thought of spending more money on this iMac after already replacing the hard drive (TWICE! - we're on HDD #3) holds ittle appeal. The machine is almost 6 years old. I really wish I could afford to upgrade.
    I'll let you know if I have a breakthrough.
    Thanks again.

  • Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be ab

    Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be able to download the srtony adobe.

    Adobe - Lightroom : For Macintosh
    Hal

  • I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    I am looking to start developing apps for the iTunes Store, but I have no previous experience. What is the best way for me to start on this? As in which programs and materials must I need and what I need to know. Thanks!

    You will need a Mac, with OS X 10.6+ on it, to be able to develop iOS apps.
    There is some info on these pages :
    developer site : https://developer.apple.com
    developing for iOS 7 : https://developer.apple.com/ios7/
    developer support : https://developer.apple.com/support/
    developer forums : https://devforums.apple.com/index.jspa (you will need to be a registered developer to access them)

  • Please suggest me the best way to start learning about Oracle Purchasing.

    Hi,
    I have started reading about Oracle Procurement. I have an over all idea of how ERP functions. Anyhow I am like a fresher to ORACLE APPS. Can you pleasesuggest me what is the best way to start learning about Oracle Purchasing.
    Is it is throuhg user guides or some thing else..... can you please specify the references also.......
    Thank you so much.

    If you have a sponsorship, I would recommend taking classes with Oracle University. The other resources are documentation, functional and technical depending on what your interests are.
    If you can load Vision database or access vision database (I think solutionbeacon offers a free account to login and play around), that will be another resource as well.
    As you learn, join as much user groups like this one, and review all questions and answers in the discussions to understand and learn more.
    Hope this helps.

  • Can you please tell me the best way to increase the number of the downloads of my free ibook

    Since I got the green light in iBook store my free book has been
    Downloaded about 50 times in 10 days.
    What is the best way to increase the number?
    The title is : monter a cheval
    It's in French
    Thanks for the help

    Do you, or anyone ese, have experience in this service? And how's the paid vs free services they have?

  • I need help with the best option for backup of itunes for laptop change?

    i want to change my itunes account from my existing laptop to my new laptop, whats the best way to back up or transfer my itunes?

    Try this link
    http://support.apple.com/kb/HT4527

  • What is the best way to organize a tree-like structure of constants?

    Hello everone!
    Need help with organizing my constants structrure.
    I have several tables, and each of them need a list of column names to define the fields returned after query, and also a corresponding list of hashmap keys because that columnnames are ugly. Hashmap is where I store the result of searching through the table. This question is not about JDBC because I search through tables via COM interface, no JDBC ResultSets and other stuff here.
    Finally, for each table I have two constant lists and I have a list of tables. What is the best way to store this?
    My first idea was to create a enum and store column data in it as String array attributes: String[] columnNames; etc.
    But in this case I cannot use each column and key separately.
    Another option is to create two separate enums for each table: columnNames enum and keys enum. That doesn't look great also.
    The third option is to create inner class for each table and store two enums in each of that classes.
    Also I can store all data in hashmaps, Strings etc.
    (1) Finally, from your experience, what is the best way to organize all that stuff?
    (2) I have heard that smart Java programmer should avoid using the enums by any means. Do you agree?
    (3) Generally what will you prefer when creating a constant which has two values: two final Integers or enum?
    Edited by: Dmitry_MSK on Jul 8, 2010 5:22 AM

    I'm not sure why you don't just invent a generic data structure (e.g., table name, list of column names and aliases of column names) such as:
    class QueryMetaData {
      private final String tableName;
      private final String[] columnNames;
      private final String[] columnAliases;
    }Read into the above structure from a properties file, database table, etc. You can store meta-data itself in places other than enum constants, particularly if would like to change the meta-data without requiring a new build of your application.
    That having been said, WRT to your specific questions:
    (1) Finally, from your experience, what is the best way to organize all that stuff?See above
    (2) I have heard that smart Java programmer should avoid using the enums by any means. Do you agree?Enums are better than simple constants using int or String or something similar. If there are known, discrete values unlikely to change frequently, I see no issues with an enum. They improve the readability of code, and there are enough syntactic sugar features in the language (switch statements come to mind) to make them appealing.
    (3) Generally what will you prefer when creating a constant which has two values: two final Integers or enum?
    See above. Enums were introduced (in large part) to do away with storing constants as integers.
    - Saish

  • Please reply with the best laptops that can suit to my needs '̿'\̵͇̿̿\ .....(^o^)

    Hi foks!
    I allready have like 3 or 4 years a HP 530 with this capabillities:
    Windows Vista Home Premium (Service Pack 2)
    2,00 GB RAM
    32 - bit operation system
    Procesor Genuine Intel (R) CPU T2300 @ 1,66GHz 1,67GHz
    The system is classified by it self with the rate of 3,0... so i definetly need something beter
    So I need a new laptop that will aloud me to use the next things as the best they can get:
    1.- I want to use the full potential of programs such as Ableton Live 8 i mean without affecting my mixes, by the CPU Loads, because i like to play audio in multiple and different channels, unfortunately as normal this make my laptop slower.
    2.- It must aloud me to watch movies with 1080p Bluray (Rip or Discs) format and better if it can burn this type of discs.. I normally can only watch this movies on Windows Media Classic - Home Cinema via codecs, and by doing some suitable configurations, this always gets me tired at the end..so the limit size of movies that i can watch are about 15 GB. I actually played one anime movie with 20 GB very, very flawless but as i say.. it gets worse with files that have more capacity and real picture. And i cant watch any bluray Disc even if it is ripped (accessed as a disc by the folders) and they just have like 7GB size... 
    3.- I recently buyed a Seagate External FreeAgent Desk USB 2.0 that has 2 TB and i allready need more space xD..so it will be great for the new laptop to have external connexions for some FireWire400, USB 2.0, eSATA equipement's... and better if the size capacity of the laptop is close to the one of the external Desk i mean about 2TB
    This are extra requirments that i would like to have, but not primarly as the ones before:
    4.- I am a true fan of games, but since this is not a console well... i would like to play some games with real HD quality such as StarCraft 2, Assasins Creed, Battlefield 2, WoW, you know the classic and the newe ones. I actually woud like some laptop that is capable of playing PS3 games (whatever way if it is possible ;P)
    So please write down a list of laptops that have the primary needs that i want to have, and some another list of the ones that may be "better" in capabillities including the videgame functions.
    Thanks

    Go to an Apple store.
    I'm not being facetious - I've owned several HP laptops, and several Apple laptops and desktops. Apple does everything better. The problems I've had with HP and Windows are enormous compared with Apple. My newest Apple laptop is about seven years old, and it is faster than my two year old HP. One of my HPs has been back to the factory three times in one year for repairs. Now it's out of warranty and pretty much junk. The two year old Pavilion (Vista Home Premium 64) is now pretty slow, it works OK but not as fast as my old Macs.
    Every Windows software update has been a problem and generally causes the computer to run slower. Meanwhile every OS X update causes my Apples to run faster. I know you don't believe me. That's OK. No one believes this until they try it for themselves.
    Windows used to be OK, but has been steady downhill since XP. I have bought my last Windows computer ever. Now I am looking at Macbook Pros for my next laptop, since the last one is still going strong after seven or eight years I expect a new one should too. The only thing I've had to do is replace its battery, but just once in seven years.
    Apple support is better, much better. Just look at the Apple user discussions forum and you'll see lots of very informed people willing to help. This board is full of complaints like mine and help seems virtually nonexistent.
    I think HP is dead as a company too. Used to be great, but now they just make cheap disposable computers and printers. Most of their revenue comes from selling overpriced ink.
    So for your questions:
    Ableton Live 8 has an OS X version.
    Blu-Ray: No Apple laptops have a Blu-Ray option but there are plenty of aftermarket internal and external Blu-Ray drives. I think Blu-Ray licensing fees are the problem.
    External drives: All Apple computers have Firewire 400/800 except for the low end laptops. All have USB 2.0. The maximum volume size OS X can handle is 8 exabytes (8 billion gigabytes). Not sure about eSATA. All their internal HDs are SATA drives though.
    Gaming - I'm not a gaming person but I have many friends who started out with questions like yours and none of them ever stayed with Windows. They didn't believe me either, since they all thought once a computer is two or three years old it is junk. After buying Macs they know better now. One friend in particular spent $5000 on what he described as a "custom high end Windows gaming computer", after a year of problems he bought the most expensive iMac there is, for half as much (27" Intel Core i7). He says the iMac is better. After a few months of not using his $5000 windows desktop he practically gave it away.
    So bring your skepticism to an Apple store. Leave your credit card at home though :-)
    Good luck.

  • Please help with the URL class

    Hello,
    I am trying to write a Java app that will take a url and download it.
    I believe you can do this with the URL class but I don't understand how to. For example, if the http url location points to a picture file, how would I code the app to retrieve this picture and save it to a specified directory?
    Also, is there a way that my java app could open another program, let's say Microsoft Internet Explorer?
    Please be as specific as possible, thanks!

    You'll see below an example to download a file
    private static String copyFile (String url, String nomFichier){
         // construction du fichier de sortie
         File outputFile = new File(repertoire + "\\fichiers\\" + nomFichier);
         // si le fichier existe d�j�, il ne sert � rien de le t�l�charger !
    if (outputFile.exists())
         return "fichiers/" + nomFichier;
              try {     
         HttpURLConnection connect = (HttpURLConnection)new URL(url).openConnection();
    boolean connected = false;
    while (!connected){
    try {
    connect.connect();
    connected = true;
         catch (java.io.IOException e1) { System.out.print("...Tentative de connection"); }     
    DataInputStream reader = new DataInputStream(
    connect.getInputStream());
         FileOutputStream out = new FileOutputStream(outputFile);
         int length = 1024;
         byte[] buf = new byte[length];
         int offset = 0;
         long offsetCourant = 0;
         int nb=0;
         while ((nb=reader.read(buf,offset,length))!= -1) {
              out.write(buf,0,nb);
         out.close();
         catch (java.net.MalformedURLException e) { System.out.println("pb d'url"); }
         catch (java.io.IOException e1) { System.out.println(e1.getMessage()); }
         return "fichiers/" + nomFichier;
    }

  • Please help with the GUI quiz question!

    Hi Folks,
    Please help me with the code for the following GUI.
    The display window of the application should have two panels at the top level (you could have multiple panels contained within a top-level panel). The first top level panel should have a grid or a border layout and should include apart from various label objects: 1) a textfield to store the info entered, 2) a combobox 3) a combobox or a list box , 4) a radio-button group , 5) a combo box 6) checkboxes for additional accessories, and 7) checkboxes .
    The second top-level panel that is placed at the bottom of the window should have a submit button, a clear button and a textarea for output.
    Thanks a lot.

    Please be a little more explicit about what you're doing, what you expect to happen, and what you actually observe.
    Please post a short, concise, executable example of what you're trying to do. This does not have to be the actual code you are using. Write a small example that demonstrates your intent, and only that. Wrap the code in a class and give it a main method that runs it - if we can just copy and paste the code into a text file, compile it and run it without any changes, then we can be sure that we haven't made incorrect assumptions about how you are using it.
    Post your code between [code] and [/code] tags. Cut and paste the code, rather than re-typing it (re-typing often introduces subtle errors that make your problem difficult to troubleshoot). Please preview your post when posting code.
    Please assume that we only have the core API. We have no idea what SomeCustomClass is, and neither does our collective compiler.
    If you have an error message, post the exact, complete error along with a full stack trace, if possible. Make sure you're not swallowing any Exceptions.
    Help us help you solve your problem.

  • Can anyone please help with the 2.3 update in UK?

    Can anyone please help?  I have an unbranded x10 in the UK.  PC companion constantly tells me my phone software is up to date (with android 2.1) so I cannot upgrade to 2.3.  I've tried all the tips on the SE support page like deleting the database content and looking for the setting to update the phone next time it's connected which doesn't exist (very informative SE!).  I'm not keen on this independent software installation through the rapidshare download, it seems full of glitches looking at the forums.  http://www.sonyericsson.com/update/?lc=en&cc=gb&pid=xperiax10  This link clearly tells us the update is available through PC companion, no joy for me though.  Any help is welcome.

    Have a look at this and check your version number see if its listed
    http://forum.xda-developers.com/showthread.php?t=1186045
    As for generic roms you have probable read about custom roms
    See this thread it is a stock SE rom not a custom rom and will give you just that a stock SE rom if you want
    http://talk.sonyericsson.com/thread/19762

  • Please help with the understanding of aspect ratio!!!

    Hi all,
    I'm trying to get my head around the 'aspect ratio' thing if anyone can help.
    To give an example, I have imported footage in FCE and in the details of the file it states:
    Pixel Aspect: PAL - CCIR 601
    Frame size: 720 x 576
    What exactly can I earn from the above information?
    I gather this is not widescreen but I would like the end film to be. Do I have to 'crop' this? If so, how!?
    And how do I make sure the picture looks right on a widescreen TV (so the people don't look squashed, say)?
    Many thanks in advanced for the wisdom passed on!
    Adam
    Oh and should i be thinking about this before I'm about to import from a Mini DV cam? As in settings...
    Message was edited by: Vegas Superstar

    If you check the anamorphic box on a 4:3 clip you will see some kind of distortion.
    In general you choose your setup accordingly with the way your footage has been shot.
    In the article you found that iDVD doesn't recognize the "anamorphic" flag that your footage can have in FCE.
    Therefore your exported material must be "arranged" so that you tell iDVD you have a 16:9 movie.
    When you work entirely in anamorphic 16:9 in FCE (your footage was shot in 16:9 and have the anamorphic flag on), when you export the sequence using export to quick time movie, you'll get a 720x576 PAL movie. Because iDVD will not translate the anamorphic flag, you have to manually change the movie size to 1024x576 for PAL, so that your resultant movie will be keeping the 16:9 aspect ratio.
    The native widescreen doesn't use such flag and the video is already at 16:9 aspect ratio.
    That's has to deal with pixel that are rectangular and not square as computer uses.
    I guess someone else will be more specific and detailed on this.
    Regards,
    Armando.

  • Please Advise On The Best Way To Keep Your Battery Healthy And Not Deformed

    I am a black macbook (mb) user and have had my mb for 37 months now. after a year and a half, my battery (the first one) was deformed and i was advised to replace it quickly. i was also advised to calibrate my battery occasionally and so i did after that. but in just over a year after i replaced my battery, it is starting to deform and swollen. i have been following the advice and calibrated my battery as advised. my battery is still in normal condition according to the system profiler.
    when i first bought my macbook, i was told NOT TO keep recharging my battery whenever i used it and the battery drains because this would make the battery's life shorter. i was also told it is OKAY to have the power plugged in. and so i did that. but it turned out that my battery had deformed from it. most probably from the heat but i don't know.
    i use my macbook regularly. i keep it switched on almost 24 hours a day and i keep it well ventilated (i sit it on top of iLap) because i have my internet on 24 hours a day and use the internet regularly. i am not planning to replace my battery just yet even though the battery capacity has gone down to 77%. it's expensive here. i will keep on continuing with the calibrating every now and then. now it might be the magsafe's problem that the battery is deforming too soon. one time, the magsafe fell from my bed onto the floor quite hard. and since then it wasn't working properly. sometimes it heats up and it becomes too hot to hold for long. at times the battery would say 0:00 (time left charging) but the light doesn't change to green so i have to plug it out from my mb and from the main plug and rest it for about 10 seconds and then it runs as normal. i know i probably need to change the adapter soon.
    anyway, i'm just asking. for someone who uses his mb regularly or everyday and almost 24 hours a day, what is your best advice on how to keep the battery healthy and in good condition for a long period of time?
    sorry for the rambling but thank you.

    About Batteries in Modern Apple Laptops
    Apple - Batteries - Notebooks
    Extending the Life of Your Laptop Battery
    Apple - Batteries
    Determining Battery Cycle Count
    Calibrating your computer's battery for best performance
    Battery University

  • Please help with the query (INSERT RETURNING BULK COLLECT INTO)

    I am trying to write a query inside the C# code where I would insert values into a table in bulk using bind variables. But I also I would like to receive a bulk collection of generated sequence number IDs for the REQUEST_ID. I am trying to use RETURNING REQUEST_ID BULK COLLECT INTO :REQUEST_IDs clause where :REQUEST_IDs is another bind variable
    Here is a full query that use in the C# code
    INSERT INTO REQUESTS_TBL(REQUEST_ID, CID, PROVIDER_ID, PROVIDER_NAME, REQUEST_TYPE_ID, REQUEST_METHOD_ID, SERVICE_START_DT, SERVICE_END_DT, SERVICE_LOCATION_CITY, SERVICE_LOCATION_STATE, BENEFICIARY_FIRST_NAME,
    BENEFICIARY_LAST_NAME, BENEFICIARY_DOB, HICNUM, CCN, CLAIM_RECEIPT_DT, ADMISSION_DT, BILL_TYPE,
    LANGUAGE_ID, CONTRACTOR_ID, PRIORITY_ID, UNIVERSE_DT, REQUEST_DT, BENEFICIARY_M_INITIAL,
    ATTENDING_PROVIDER_NUMBER, BILLING_NPI, BENE_ZIP_CODE, DRG, FINAL_ALLOWED_AMT, STUDY_ID, REFERRING_NPI)
    VALUES
    (SQ_CDCDATA.NEXTVAL, :CIDs, :PROVIDER_IDs, :PROVIDER_NAMEs, :REQUEST_TYPE_IDs,
    :REQUEST_METHOD_IDs, :SERVICE_START_DTs, :SERVICE_END_DTs, :SERVICE_LOCATION_CITYs,
    :SERVICE_LOCATION_STATEs, :BENEFICIARY_FIRST_NAMEs, :BENEFICIARY_LAST_NAMEs, :BENEFICIARY_DOBs,
    :HICNUMs, :CCNs, :CLAIM_RECEIPT_DTs, :ADMISSION_DTs, :BILL_TYPEs, :LANGUAGE_IDs,
    :CONTRACTOR_IDs, :PRIORITY_IDs, :UNIVERSE_DTs, :REQUEST_DTs, :BENEFICIARY_M_INITIALs,
    :ATTENDING_PROVIDER_NUMBERs, :BILLING_NPIs, :BENE_ZIP_CODEs, :DRGs, :FINAL_ALLOWED_AMTs,
    :STUDY_IDs, :REFERRING_NPIs) RETURNING REQUEST_ID BULK COLLECT INTO :REQUEST_IDs
    However, when I run this query, it gives me a strange error ORA-00925: missing INTO keyword. I am not sure what that error means since I am not missing any INTOs
    Please help me resolve this error or I would appreciate a different solution
    Thank you

    You cannot use (and do not want to in this case) the BULK COLLECT.
    create table for_testing
       the_id      number not null primary key,
       some_data   number
    declare
       l_return_value for_testing.the_id%type;
    begin
      4 
       insert into for_testing
          the_id,
          some_data
       values
          1,
          5
       returning the_id into l_return_value;
       dbms_output.put_line('the return values is ' || l_return_value);
    end;
    20  /
    the return values is 1
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    TUBBY_TUBBZ?Is a simple example. In the future, please use the tags to preserve formatting on your code like i have so it remains readable .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for