What is the best way to run immediately given sql stored in a table

I have a variable string containing row_ids for example "12,24,35,23".

and a table

ROW_ID, sql
1, "insert into une_table values (23, 'Happy');"
6, "insert into some_other_table values (24, 'Sad');"
12, "insert into une_table values (23, 'Crazzzy');"
15, "insert into some_other_table values (23, 'Old');"
23, "insert into another_table values (23, 'Left');"
24, "insert into stuff_table values (23, 'Gold');"
30, ' insert into values (23, 'Even') ancienne_table;
35, "insert into archive_table values (23,"True");"

And I need to write a function, plsql which takes the list of the row_ids as an argument and executes the sql statements stored in the table that corresponds.

I will try a combination of cursor and execute immediate instructions to do it for the moment but suspect I'm being very inefficient. So any suggestions or examples of similar code, that everyone knows would be immensely appreciated.

See you soon


Reuben

Hello
I'm assuming row_id column will take place separately. Here's the code just convert this procedure

Declare
ROW_ID varchar2 (1000): = '12,24,35,23';
rid the number;
insert_query VARCHAR2 (10000);
Start
While instr(row_id,',',1)<>0
loop
RID: = to_number (substr (row_id, 1, instr(row_id,',',1)-1));
Start
Select in the insert_query where row_id = rid;
immediately run insert_query;
commit;
exception when others then
null;
end;
ROW_ID: = substr (row_id, instr(row_id,',',1) + 1);
end loop;
RID: = to_number (row_Id);
Select in the insert_query where row_id = rid;
immediately run insert_query;
commit;
end;

Replace with and insert query column name by respective tablename

Published by: user648705 on March 10, 2009 13:59

Tags: Database

Similar Questions

  • What is the best way to run the report of jasper in the ADF Applications?

    Mr President.

    What is the best way to run the report of jasper in the ADF Applications?

    Concerning

    Tender Hello,

    Check out these links

    Sameh Nassar: Using Jasper report in Application of ADF (detailed)

    https://www.YouTube.com/watch?v=ezX0gdLIhs0

  • What is the best way to deal with a 'Implicit coercion' in a table to a sprite?

    Hi all!

    With the continued support of this forum, I'm getting closer to have a programme of work. I can't wait to be able to help others like me once I've finished learning the ropes of AS3.

    I'll briefly explain what I want to achieve and then followed with my question.

    Background

    I created a random number of 12 x 9 grid that fills each cell with an image, based on the numeric value of each cell. I also have a random play button that makes random numbers in the grid. The problem I am running became my click event of button to erase the current images off the grid in order to allocate the new (for example by removing the objects display battery in order to place the new ones in the same places).

    Question

    My question is this: what is the best way to manage an implicit constraint from a table to a sprite? I pasted my complete code below so that you can see how the functions are supposed to work together. My sentence is apparently not being able to use a value from array with a sprite (sprite represents the real layout of the grid on the pile of display while the table starts as a number that is assigned an image that must be transmitted to the sprite).

    ============================================================================

    package
    {
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.utils.getDefinitionByName;

    SerializableAttribute public class extends MovieClip Blanko
    {
    Contains 12 * 9 grid of cells.
    var grid: Sprite;
    Maintains the shuffle button.
    var shuffleButton:Sprite;
    Is equal to 12 columns, 9 lines.
    var cols: int = 12;
    lines of the var: int = 9;
    Equal number of grid cells (108).
    cells var: int = COL * rows;
    Sets of cell width and height to 40 pixels.
    var cellW:int = 40;
    var cellH:int = 40;
    Contains 108 images of cell.
    var imageArray:Array = [];
    Contains 108 numerical values for the cells in the grid.
    var cellNumbers:Array = [];

    Constructor calls the functions "generateGrid" and "makeShuffleButton".
    public void Blanko()
    {
    generateGrid();
    makeShuffleButton();
    }

    Creates and displays the grid 12 * 9.
    private function generateGrid (): void
    {
    grid = new Sprite;
    var i: int = 0;


    for (i = 0; i < cells; i ++)
    {
    cellNumbers.push (i % 9 + 1);
    }
    trace ("before shuffle:", cellNumbers);
    shuffleCells (cellNumbers);
    trace ("after shuffle:", cellNumbers);
    var _cell:Sprite;

    for (i = 0; i < cells; i ++)
    {

    / / This line is where the implicit constraint occurs. '_cell' is a leprechaun trying

    on a temporary basis equal to a value from array.
    _cell = drawCells (cellNumbers [i]);
    _cell.x = (I % cols) * cellW;
    _cell.y = (I / COL) * cellH;

    grid.addChild (_cell);
    }
    }

    Creates a "shuffle" button and adds a mouse click event.
    private function makeShuffleButton (): void
    {
    var _label:TextField = new TextField();
    _label. AutoSize = 'center ';
    TextField (_label) .multiline = TextField (_label) .wordWrap = false;
    TextField (_label) .defaultTextFormat is new TextFormat ("Arial", 11, 0xFFFFFF, "bold");.
    _label. Text = "SHUFFLE";
    _label.x = 4;
    _label.y = 2;
    shuffleButton = new Sprite();
    shuffleButton.graphics.beginFill (0 x 484848);
    shuffleButton.graphics.drawRoundRect (0, 0, _label.width + _label.x * 2, _label.height +)
    _label.y * 2, 10);
    shuffleButton.addChild (_label);
    shuffleButton.buttonMode = shuffleButton.useHandCursor = true;
    shuffleButton.mouseChildren = false;
    shuffleButton.x = grid.x + 30 + grid.width - shuffleButton.width;
    shuffleButton.y = grid.y + grid.height + 10;
    this.addChild (shuffleButton);
    shuffleButton.addEventListener (MouseEvent.CLICK, onShuffleButtonClick);
    }

    Erase the images of the cell, mix of their numbers and then assigned these new images.
    private function onShuffleButtonClick (): void
    {
    eraseCells();
    shuffleCells (cellNumbers);
    trace ("after shuffle:", cellNumbers);


    for (var i: int = 0; i < cells; i ++)
    {
    drawCells (cellNumbers [i]);
    }
    }

    Deletes any existing cells in the battery of the display image.
    private void eraseCells(): void
    {
    While (imageArray.numChildren > 0)
    {
    imageArray.removeChildAt (0);
    }
    }

    Changes cell phones numbers (makes random table).
    private void shuffleCells(_array:Array):void
    {
    var _number:int = 0;
    var _a:int = 0;
    var _b:int = 0;
    var _rand:int = 0;

    for (var i: int = _array.length - 1; i > 0; i-)
    {
    _rand = Math.Random () * (i - 1);
    _A = _array [i];
    _B = _array [_rand];
    _ARRAY [i] = _b;
    [_Rand] _ARRAY = _a;
    }
    }

    Retrieves and sets a custom image to a cell based on its numerical value.
    private void drawCells(_numeral:int):Array
    {
    var _classRef: Class = Class (getDefinitionByName ("skin" + _numeral));
    _classRef.x = 30;
    imageArray.push (_classRef);
    imageArray.addChild (_classRef);
    return of demonstration;
    }
    }
    }

    ===========================================================================

    Any help with this is greatly appreciated. Thank you!

    If you want to have an array of Sprites that you later clear that is fine. But this does not mean that your function should return to it.

    You need your function to return the sprite so that you can add it to the display list and everything what you need.

    So just have the function get Sprite, push it in the "toBeClearedInTheFutureArray" and then return a reference to the currently acquired sprite.

  • What is the best way to run DAQ in larger system?

    I have a relatively simple installation of the PXI hardware require software in real time to perform data acquisition and to provide feedback to the user.  Somewhere on the order of discrete outputs 150, 55 entered discrete, some analog, etc...  My question is this: does anyone know of a white paper, etc., which describes the best way to the acquisition of configuration data?  For example, is it better to put all the discrete outputs on a single task and manage state in memory (150 items Boolean) before writing to DAQmx, or is there some advantage at the time of the execution/memory to open a task for each channel and individually each signal.  The driver even allow me to do this?

    Synchronization is not a concern, is pilot crashes, so I would like to get the best performance out of DAQmx.

    If someone has explored this?

    Dan

    Hi Dan,.

    To optimize your application, you'll want to create tasks as little as possible.  When you create a task, you ask for all the parameters of this task (which would be like doing 150 calls to the hardware).  The extent of the GB whitepapers - you can find useful this webcast .  For example, some of your concerns are addressed low toware of this FAQ document.  Hope this helps, let me know if you need something more specific.  Have a great day!

  • What is the best way to run two concurrent programs using the output of either executing the other?

    I wanted to just kind of get a notice of some people here. I have two main screws the first is a data acquisition system that displays 99 different sensors and which feeds on these data in a table. The second is a real-time processing system that is designed to take the painting and do many calculations. The two output data from screw at the front that I want to see, so I don't want to use just as a Subvi.

    Is there a simple way to run two screws, using the output of the data acquisition system to power the processor so that you can easily see the signs before two screws? I had thought to simply copy the code from the processor in real-time in the DAQ VI, but I fear that the VI resulting will be very large and unsightly.

    On a side note, I'm more thinking about this? I apologize if this is a stupid question, it has been a long week... aaaand it's Wednesday.

    Look at the Architecture of producer/consumer.  It will be a good starting point, even if you find that you need to change.  When performing data acquisition and processing of tasks in parallel loops, they can both run simultaneously.  Both can feed data to the main draw of the VI.

    I'd probably use three loops with the third being the user interface only.  All that must be displayed to the user is sent to the GUI of the acquisition of data or processing loop loops and commands or entered by users are returned in these loops, probably through queues.  The wall of the VI of data acquisition and processing VI are never displayed to the user.  Especially the treatment, because it runs on a system in real-time, should avoid synchronization issues that can present a graphical interface.

    Lynn

  • What is the best way to run multiple instances of the class containing infinite while loop?

    Hello

    I have a several instances of the class (say a, b, c,...) that have the same parent and I want to run the same methods overridden to all instances in parallel.

    For example:

    a.init ()-> a.run ()-> a.stop ()-> a.run ()-> a.stop ()->

    b.init ()-> b.run ()-> b.stop ()->->->

    c.init() ->           ->             -> c.run() ->               -> c.stop()

    ...

    See the attachment for more details.

    The problems are now:

    1. the 'run' - method does not return until it receives the external trigger

    2. everything to run methods return in a different time

    1 chip means I can't use autoindexed for loop because in this case b.run () will have to wait before the end of a.run (), right? Is it possible to run to the loop in parallel?

    2 chip means that an object must be able to run and stop independently from others.

    What is the most elegant solution? The solution copy - paste in the attachment works for 3 instances, but there are currently 10 and more is coming.

    Juha

    In fact, what I wanted to know was "how to add the 'P' loop '... Easy, after you ask the right question.

    In the attachment, there is a test.vi that has two numerical indicators in a certain time-infinite loops. If I leave the parallelism, the two digital are incremented infinitely. If I don't allow parallelism, only the first is incremented (he never leaves the infinite while loop).

    To solve my original problem, I can make an init-start-stop branch within a loop-parallel-indexing for and make sure that there are the same number of instances of loop as there are objects in my array of objects (object array is an autoindexed in the loop for).

    Also good point about the vis environment. I should also add that.

  • What is the best way to retrieve deleted mp3 files? I am running OSX Leopard 10.5.8 on a PowerPC G5 tower. I'll be very grateful for any help in this matter. Thanks to Chris

    Hello

    What is the best way to retrieve deleted mp3 files? I had a lapse of attention and I deleted a folder containing most of my music files. It is for the most part, the mp3 but there was regular audio files and some wav files in there also. I am running OSX Leopard 10.5.8 on a PowerPC G5 tower. I have another PPC machine to help the recovery, if I need, but at the moment, he is not appearing on my network (3 computers). I'm trying to change this soon. I'll be really grateful for any help in this matter.

    Thanks to Chris

    If you emptied the Recycle Bin after you move the folder to the trash, and you don't have a time Machine or another backup, then it is lost, sorry.

  • What is the best way of reformatting my MacBook ssd for resale?

    I'm preparing my 2015 12 '' MacBook 1.3 GHz 512 for resale.  What is the best way to erase and reformat the SSD drive?

    Thanks in advance!

    -jag

    Before you sell or give away your computer, and more the steps listed in this article to support, please follow these steps:

    1. run the Diagnostics from Apple or the Apple Hardware Test. The buyer will do (or it should), and you won't be surprised by the results.

    2. reset the PRAM and the SMC, which may contain personal information.

    3. If you set a firmware password, remove it by running the utility in recovery mode firmware password.

    4. If you turn on FileVault in OS X 10.7 or later, turn it off.

    5. If you use Boot Camp, the partition must be deleted.

    6. If you have created another partition of data on internal disk, remove them in disk utility.

    7. If the machine has an internal hard drive, erase the remaining data partition with the possibility of putting the data to zero. An SSD has no need to be set to zero.

    8. remove the machine from your list of registered products. If it is still covered by an AppleCare Protection Plan, transfer the warranty to the new owner as described in the terms and Conditions AppleCare (under the heading "Transfer of Plan.")

    Note also:

    You can legally or transfer almost any software downloaded from the Mac App Store to the new owner of the machine, even if it was free. This includes OS X, so if you've switched to OS X 10.7 or later, you need to reinstall an operating system older, either from the installation media, if any, or by commissioning in recovery mode of the Internet (option-command-R start ringing.)

    The new owner will have to re-download everything software that came on the App Store, as appropriate, including updates of OS X, under her Apple ID. If you never updated applications bundled iLife (iPhoto, iMovie and Garage Band) through the App Store, you can not transfer these either. The buyer must buy them. Note that iPhoto has been suspended and is no longer available for purchase.

  • What is the best way to ensure that there is no virus

    Hi guys,.

    Thanks for your reply,
    I believe that my laptop has a virus or spyware. It is slow and take ages to get up. Also during the use of internet Explorer is very slow in browsing the internet.

    During the use of msn chat voice sometimes it freezes.

    What is the best way to be sure that there are no viruses.
    I already have Norton 2007 with the last update.

    Thank you

    Hello

    > What is the best way to ensure that there are no viruses?

    The best way is to use an Antivirus application and some Anti-malware and Trojan applications.
    You already use the Norton Antivirus program. It is very good. Remember that this application is always up-to-date.
    Additionally, you could install Adaware. It is freeware tool and it scans your operating system for malware.

    But the virus or malware is not always a reason for a BONE of freezing.
    Please check your processes that are run in the context of the BONE. You can also use the application called CNettoyez.
    It scans you BONES of this situation and repair the registry.

    Maybe it helps

  • What is the best way to install XP on Vista Equium A100-338

    I want to install XP on my Equium A100-338, who has already installed Vista. What is the best way to do it, I heard a lot of bad luck stories trying to do!
    I do it only as a new software, with that I need to work only works on XP.

    Any help appreciated

    Thank you

    Hello

    In my opinion, you must install the XP operating system on the second partition.
    In this case, you can use the two BONES; Vista and XP.

    Using these two s OS has many advantages. For example, you can always test the Vista and the new Microsoft features that are available in Vista and, in addition, you can use the XP if you need to run some programs and applications that are not fully compatible with Vista.

    Then first ask how o create a second partition in Vista.
    Well, this can be done in disk management. Right-click on the my computer drive management made right click on the disk to manage and modify the size of the partition.
    Then the free space on the HARD drive can be activated, and you can create the new partition.

    Then simply boot from Win XP and install it on the second free partition.
    The Toshiba drivers needed should be downloaded from the Toshiba page.

    Good luck

  • What is the best way to have an indicator that scrolls the content of a table that is updated during the execution of a program?

    I have a program that runs continuously. During this time the errors are produced and I store them in a table. What is the best way to display the table in a window that the user can scroll upwards or downwards, while the program is running?

    Thank you.

    Hi chuck,

    If allowing you to feed two tables to the table you will see also all of these channels in the table

  • What is the best way to upgrade Windows 7 Professional to Windows 7 Ultimate

    What is the best way to upgrade Windows 7 Professional to Windows 7 Ultimate to load the language packs?

    Hello
    Welcome to the Microsoft community. Sorry for the delay in responding.

    Please take a look at this article for more information on the upgrade to Windows 7 Ultimate.
    Upgrade to another edition of Windows 7 by using Windows Anytime Upgrade but now it would be better if you upgrade to Windows 10 directly. If you have Windows 7 Professional, you qualify for a free update to Windows Professional 10.

    Upgrade to Windows 10

    Which edition of Windows I get as part of the free update?

    To install the language packs take a look at this article.

    Windows 7 language packs are available for computers that are running Windows 7 ultimate or Windows 7 Enterprise

    Hope that the information provided has been helpful and let us know if you need more help. We will be happy to help you.

  • What is the best way to improve the performance of this all-in-one PC?

    What is the best way to improve the performance of this all-in-one PC?

    Thanks in advance.

    David Barrett.

    Here are a few methods:

    • Run msconfig.exe, and then uncheck the startup tasks that you don't need. No matter what you disable, Windows always starts.
    • Use a light virus scanner, for example Microsoft Security Essentials.
    • Replace your magnetic drive with a Solid State Disk (SSD)
  • Any transfer on a drive hard new - what is the best way?

    Here's a question simple and straightforward, I hope. I currently have two internal hard drives:

    • C (IDE): OS (Win7), programs
    • F (about three times larger than C, faster, SATA): for most of the multimedia stuff

    (And some external and a dvd burner, which should not be relevant to this question.)

    I ordered a new hard drive, which will take over old job of the F drive. Once I have install and F empty on it, I want to move everything that is currently on C for which is now F and the new C drive I start and run Windows from. (C would also get a new drive letter and would only be used for backup purposes).

    I much prefer this without having to reinstall Windows and all my other programs, and without investing in expensive software of type Ghost I would probably use only once every two years or more. I also prefer not to have to partition F, although I'll do it if necessary.

    What is the best way to do it?

    Windows 7 image and move it to the new hard drive

    The only way to avoid reinstalling programs is in the image of the player. Connect the new drive as a slave (if IDE), then partition the new drive, so it has two partitions (or more if you want) - the last partition being slightly larger, then the amount of data on your current hard drive. Also, make sure that the partition you are moving that Windows 7 is greater, then the current partition is.

    Make now a picture of your current hard drive with either programs below and save it to the last partition on your new drive. If you have the recovery of 100MB partition do not forget to include that. Then restore the image of the partition that you want Windows 7 installed-you put in place the same as long as your current drive, and you may need to remove/change the partitions that you have done.

    Both programs are offered free of charge:

    Reflect disk imaging:
    http://www.Macrium.com/reflectfree.asp

    Paragon Backup & Recovery Free Edition:
    http://www.Paragon-Software.com/home/DB-Express/download.html

    Remove the old hard drive and see if a new start, if it is not:

    Try to repair the Installation of Windows 7

    1. Insert the DVD of Windows 7 and restart your computer
    2 boot from the DVD.
    3. choose your language and click Next.
    4. click on repair your computer, select the operating system you want to repair.
    5. click on the link to repair list system in the System Recovery Options recovery tools.

    More information and a how to guide:
    http://pcsupport.about.com/od/toolsofthetrade/SS/Windows-7-startup-repair.htm

    If this does not solve it:

    1. Insert the DVD of Windows 7 and restart your computer
    2 boot from the DVD. If you are prompted, press any key to start Windows from the installation disc.
    3. choose your language and click Next.
    4. click on repair your computer, select the operating system you want to repair.
    5. Select command prompt and try the following commands (one command might work, or you may need to use several commands according to the exact problem):
     
    Bootrec /fixMBR
    Bootrec /fixBoot
    Bootrec /rebuildBCD

    Note: there is a space before the /.

    Space - increase free hard drive space

    Before taking the free picture of space hard drive if you want.
    The following procedure cleans the files associated with your user account. You can also use Disk Cleanup to clean all the files on your computer.

    1. click the button start, in the search box, type disk cleanup, then click Disk Cleanup.
    2. in the drives list, click the drive you want to clean, and then click OK.
    3. on the Disk Cleanup tab, select the types of files to delete.
    Note: To delete all Points except the most recent system restore - click on "Clean up System Files" and you will get another tab called more than Options. Now click More Options, and then click 'Clean up' under ' System Restore and shadow copies "and then confirm the deletion.
    4. click OK at the bottom of the window cleaning disc and in the message that appears, click on delete files.

    Reduce the amount of space allocated to system restore.

    1. start--> panel--> system and safety--> system
    2. then click on the "System Protection" link located at the top left.
    3. in "system properties? window, click the tab "System Protection".
    4 locate the 'Settings of Protection' box and select / click on the drive letter (usually c :))
    5. now, click the "Configure" button to change the settings to restore "disk space".
    6. move the slider to the left to reduce the amount of disk space, that System Protection can use.
    7. click "Apply" and then the "OK" button after setting the disk space.

    Questions about installing Windows 7?
    FAQ - Frequently Asked Questions from Installation Windows 7 & responses

  • What is the best way to transfer the file to a new larger internal drive?

    I am running win 7 ultimate.  I had two hard drives of 500 GB.  C is partitioned to 120 GB (not enough) I just installed a 1.5 terabyte drive.  What is the best way to transfer my data? I would keep the 500 GB (now C: and D :) and add the 1.5 to, I also have a 2 external to that I tried to move my libraries at, but I'm confused my system.)  I don't know much about indexing or mapping.

    \

    Consider transferring all the files that are currently in the second partition of 500 GB drive that is hosting the C: drive (you have referred to as D :) on the new drive.

    Once you have done this, you can then delete the D: partition since this 1 hard drive. This would then extend the C: drive to actually use all the 500 GB drive. Finally change the drive letter for the 1.5 terabyte disk d: it in disk management ( Diskmgmt.mscRun)

    So in the end you have a 500 GB C drive and a 1.5 TB drive D.

    When it comes to move libraries Windows has a utility to do it for you. If you click on your username at the top right of the menu start all your user profile directories are displayed. If you right-click on each one and select Properties, those that support this feature will have a tab 'location '. In this tab, it displays the current location of the file, but has a button "move". You move the folder and all its files and subfolders in a new location and update the references, the system uses for this folder.

    So if you created a folder on the D drive say 'Juli-year' and you right-click on Favorites, some properties, then on location you can move this summary folder in C:\Users\username\Favourites to D:\Juli-An\Favourites. Not all folders in the user profile supports this but all the c library files and a few others.

    Of course if you did as I suggested and ended with a 500 GB C drive you may need.

Maybe you are looking for