run immediately and the set of query results

Hi gurus,

I want to create a series of paintings on the fly using run immediately.
the table_names are stored in another table work_table.


run immediately (select 'create table' | table_name |) '(id int)' of
* (select table_name in work_tables)); *


This will raise error.

ORA-06550: line 1, column 18:
PLS-00103: encountered the symbol "SELECT" at the expected in the following way:

(en) - + new case mod not null < an ID >
< between double quote delimited identifiers of > < a variable binding >


instead of using a cursor to run one by one is the lines an alternative solution?

Thank you very much
Charles

May not know why you want to do it in a single statement, anyway:

SQL> select * from work_tables;

TABLE_NAME
------------------------------
x1
x2

SQL> declare
  2  str varchar2(32000);
  3  begin
  4    for r in (select table_name from work_tables) loop
  5      str := str || 'execute immediate ''create table ' || r.table_name || '( id int )''; ' ;
  6    end loop;
  7
  8    execute immediate 'begin '||str||' end;';
  9
 10  end;
 11  /

PL/SQL procedure successfully completed.

SQL> desc x1
 Name                                                        Null?    Type
 ----------------------------------------------------------- -------- ------------------------------
 ID                                                                   NUMBER(38)

SQL> desc x2
 Name                                                        Null?    Type
 ----------------------------------------------------------- -------- ------------------------------
 ID                                                                   NUMBER(38)

Max
http://oracleitalia.WordPress.com

Published by: Massimo Ruocchio, February 18, 2010 15:03

Tags: Database

Similar Questions

  • How can I create VI with inputs that run immediately when the update?

    I'm using LabView for controlling stepper motors. I would create a VI with a front panel that has 4 arrows, 2 per engine. My goal is to be able to run the VI and then press a button to move the engine.

    I created separate VI for each funcition of engines - one vi to set current operations, to determine the current travel, another to move up by a certain amount and so on. Work of these vi and I can move and adjust engines, but only by running separate VI.

    How can I combine them into a single VI and make them run to the pressure of a button or the change of a property? An example would be to establish a new current holding company and place the operation current vi run immediately and send the order to the engine. Then continue to press the arrow keys without having to hit 'run' on an another vi.

    Thank you very much


  • Get a large red cross saying that the system is not operational. Went and checked in services.msc and the setting says Automatic (delayed).

    Original title: necessary emergency aid

    Windows lost completely. After trying a variety of things, I finally got one to start, but my entire system had returned back to the year 2012.

    After updating my anti-virus and other security programs, I tried to check the updates of Windows, but I get a large red cross saying that the system is not operational. Went and checked in services.msc and the setting says Automatic (delayed). You run the Windows Update Troubleshooting Wizard and he said that he had set things so I rebooted to try check update again. However, I get the same message.  There is nothing showing at all when I click "update history", but check "updates installed" shows things are fine until 2012.

    Please, how can I get my system again right?

    Restart your computer and wait 30 minutes for the system to operate before you download information. When the review much, not Event Viewer log files all problems show in the period immediately after the computer has booted.

    Please provide a copy of your system information file. Type the system information in the search box above the Start button and press the ENTER key (alternative is select Start, all programs, accessories, System Tools, system information). Select file, Export and give the file a name noting where it is located. Not to place the cursor in the body of the report before exporting the file. The system creates a new information file system each time system information is available. You must allow a minute or two before the file is completely filled before exporting a copy. Please download the file to your OneDrive, to share with everyone and post a link here. Normal mode preferred report. Please say if the report was obtained in safe mode. If the report is in one language other than English, please indicate the language.

    Please download and share with everybody fresh copies of your System log and journal of the Application (two files) of your event viewer on your disc one and post a link here. You can delete any previous copies of your OneDrive records.

    To access the system, log, select Start, Control Panel, administrative tools, Event Viewer, in the list on the left of the window, expand Windows logs and select System. Place the cursor on the system, select the Action in the Menu and record all events like (the evtx default file type) and give a name to the file. Do the same for the application log. Do not offer not filtered files. Do not place the cursor in the list of reports before selecting the Action from the menu. Do not clear the logs so that you have a persistent problem.

    For assistance OneDrive see paragraph 9.3:
    http://www.gerryscomputertips.co.UK/MicrosoftCommunity1.htm

  • can someone change my WZC and the setting of security through the internet?

    can someone change my WZC and the setting of security through the internet? I was watching a video on youtube when my stop comp. and restarted on its own. start and my security program was not able to start, had to uninstall and reinstall to turn back. He told me has encountered a problem and that you must close the program and the program would not close. It comes in a loop. Security found nothing. WZC to capture multiple signals, but now I can't pick up a. right extremist to the modem.

    It seems that if you picked up some malware.  What is the full error message on "antimalware executable?

    I would like to cancel the restoration ago 2 months... it's really too long to rely on system restore.  Too many things have been added in the meantime who is affected negatively by the restoration.

    It is very difficult to say anything from the limited information you provided, but I suggest starting by download, install, update and run a full scan with MalwareBytes Anti-Malware.

    In your answer, in addition to providing the full text of the error messages, provide all of the following:

    What version of Windows, including service pack, do you have?
    What antivirus application do you use?  Is up to date? Have you ever let her subscription lapse?
    What other antimalware applications do you have?
    What is the brand and model of your computer?
    What is the brand and model of your wireless router?

  • Vista SP1 does not update problems and System Restore returns a message "system restore was not entirely successful. File system and the setting of your computer has not changed"with the error code (0x80071AA7)

    0rignal title: Vista SP1 didn't update problem

    So, recently, I was on my computer of gf and noticed she had some updates, it could use his computer which included the SP1 update.  So I went through the process trying to update his computer and he has been a disaster and have had many problems and seems to have tried everything.  It has a Dell inspiron 1525 and has no CD and no key for its program of Vista.  I burned a Vista recovery disk and tried troubleshooting by using that, but have not had much luck.  When I use the Startup Repair tool there is no nothing.  So I tried to use the restore of the system with the Description of "install: Windows Vista Service Pack 1.  He had a restore point saved just before I tried to update to SP1.  Whenever I chose this method, it's but the whole process then in the end it says:

    "System restore was not entirely successful.  File system and the setting of your computer have not changed. "

    then he begins to list the details with the error code (0x80071AA7) and then gives me the option to close or 'Run System Restore"once again that is an endless loop, because I just end up with the same error each time.  If anyone has had this problem and bring myself through it.  I don't want to reinstall windows because it seems simply ridiculous and plus that she a lot of pictures on his computer and I want to get rid of those.

    If you need more information please let me know and evil provides everything I can

    Hello
     
    Follow the steps and check if the problem persists.
     
    Step 1:
     
    I suspect that your security program may be responsible for this. I would suggest you temporarily disable all security software and try the system restore.
     
    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-Firewall-on-or-off
     
    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software
     
    Note : Antivirus software can help protect your computer against viruses and other security threats.  In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.
     
    Step 2:
     
    As for installing updates is concerned, I you should install them after you put your computer in aclean boot State. There could be a third-party software in conflict with updates. Clean boot helps eliminate these conflicts.
     
    Note: Restart your machine as usual by following step 7.
     
    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • My macbook air running hot and the battery drains quickly can help you with this problem?

    My macbook air running hot and the battery drains fast is a 13 ", at the beginning of 2014.  Processor 1.4 GHz intel core 15Can you help with this problem?

    Apps can affect the performance of Mac, battery, temperature and fan activity - Apple Support

  • How to change your settings to allow you to be able to place images and things outside of the artboard when you work? I have it on a single file and I opened another and the setting seems to have changed, but I can't find where to change it.

    How to change your settings to allow you to be able to place images and things outside of the artboard when you work? I have it on a single file and I opened another and the setting seems to have changed, but I can't find where to change it.

    I think that things are there, but just hidden.

    Try this:

    Make sure that your cursor is not in a text box, and then type a W.

  • Depending on your mode, I loaded down and insatalled and executed. But he doesn't not started and signed "check internet connection and time setting". Internet and the setting of the time are correct.

    Depending on your mode, I loaded down and insatalled and executed. But he doesn't not started and signed "check internet connection and time setting". Internet and the setting of the time are correct.

    Please let me know how to start.

    Please try to follow: https://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

  • limit the number of query results for content Presenter CMIS

    Hi dear,

    I have a problem. I added content present on my page in Jdev ide, not at run time. And I need a query including the limitation of the number of results.

    My query is: ${' SELECT * from ora: t:IDC:GlobalProfile WHERE the ora: p:xRegionDefinition =-"CSGMNEWS_REGDEF\" ORDER BY ora: p:dInDate DESC'}


    I just want to add a number parameter.

    Can you help me please? How can I limit the number of results?

    Kind regards

    Yacouba

    Published by: erdo on 21.Mar.2013 18:37

    Hello.

    Content Presenter has a setting (maxResults) to set the maximum returned results:

    Sample:

    xmlns = "http://xmlns.oracle.com/adf/controller/binding" Refresh 'ifNeeded' = >







    When you add your CP to a page at design time, you can access the pageDefinition and provide more values for attributes of CP.

    I hope this help you.

    Kind regards.

  • Through a set of query results, replacing one string by another.

    I want to write a function that replaces the occurrence of a string with another string different.  I need to be a CF fuction which can be called from another function CF.  I want to 'hand' this function (a string) SQL statement like this: (Please note, don't bother commenting "there are ways of writing this SQL try..., I made this simple example to get to the point where I need help.)  I have to use a 'sub_optimal' SQL syntax just to demonstrate the situation)

    Here's the string I want to pass to the function:

    SELECT

    [VERYLONGTABLENAME]. FIRST NAME,

    [VERYLONGTABLENAME]. LAST_NAME,

    [VERYLONGTABLENAME]. ADDRESS

    Of

    LONGTABLENAME [VERYLONGTABLENAME]

    Here are the contents of the ABRV table:

    TBL_NM, ABRV <! - header line - >

    VERYLONGTABLENAME, VLTN

    SOMEWHATLONGTALBENAME, SLTN

    MYTABLENAME, MTN

    ATABLENAME, ATN

    The function returns the string origin, but with the abbreviations in place names of the long table, example:

    SELECT

    VLTN. FIRST NAME,

    VLTN. LAST_NAME,

    VLTN. ADDRESS

    Of

    LONGTABLENAME VLTN

    Notice that only the table brackets and names that match a value in the table ABRV were replaced.  The LONGTABLENAME immediately following the FROM is left as is.

    Now, here's my attempt at amateur said written dum function: Please look at the comment lines for where I need help.

    < name cffunction output = "AbrvTblNms" = "false" access = "remote" returntype = "string" >
    < name cfargument = "txt" type = "string" required = "true" / >

    < cfset var qAbrvs = "" > <! - variable to hold the results of the query - >

    < cfset var output_str = "#txt #" > <!-I create a local variable so I can manipulate the data returned by the parameter TXT.  Is it necessary or can I use the parameter txt? ->


    < cfquery name = "qAbrvs" datasource = result "cfBAA_odbc" = "rsltAbrvs" >
    SELECT TBL_NM, ABRV FROM BAA_TBL_ABRV ORDER BY 1
    < / cfquery >

    <!-I'm assuming that at this point, the query is executed and records in the result-> set

    < cfloop index = list "idx_str" = "#qAbrvs #" > <! - is - right?  I do not. ->
    < cfset output_str = Replace (output_str, "#idx_str #",) <! - is - right?  I do not. ->

    < / cfloop > <!-who am I loop on?  What is the index? How to do the replacement of the chain? ->

    <!-the chunck, below is a partial of my Object Pascal from Delphi function that does the same thing

    I need to know how to write this part in CF9
    So what not of folklore
    Start
    s: = StringReplace (s, ' [' + FieldByName('TBL_NM').]) [AsString + ']', FieldByName ('ABRV'). AsString, [rfReplaceAll]);
    Following;
    end;
    ->

    < cfreturn output_txt >

    < / cffunction >

    I am mostly struggling with the syntax here.  I know what I want to do, I know how to get there in a different programming language, just not CF9.  Thanks for any help you can provide.

    RedOctober57 wrote:

    ...
    Thanks for any help you can provide.

    One:

     

    No you need not create a local variable that is a copy of the variable arguments that the scope of the arguments is already local to the function, but you are not referencing correctly the scope of the arguments, then you may be using a variable 'txt' in another scope.  So best practice would be to refer to "arguments.txt" where you must.

    Two:

    I know what I want to do, I know how to get there in a different programming language, just not CF9.

    Then a best start would be to descirbe what you want to happen and give a simple example in the other programming language.  Most of us is muti-lingual and can analyze code in any clear and clean syntax.

    Three:

         

    I think you want to be a loop on your recordset returned by the previous query, perhaps 'qAbrvs '.

    
    

    Four:

    Continuing on this assumption I suppose you want to replace each instance of the long chain with the short form string that record together.

    
    

    Five:

                  

    If this is true, then you loop through the set of records from tablenames and abbreviations that you want to replace the chain.

  • In the last few days my xt720 run hot and the battery to last for only 4 hours

    I don't know what happened to my XT720 but since 2 days my phone is running more hot than usual in the back between xeon flash and plate "xeon 8.0.

    I think it should be the domain of the CPU

    I tried to remove the battery several times, but it does not help

    Now, I have disabled all the synchronizations and data exchange, off WIFI and basic GPS (but I used to have my phone with this setting turned on for several weeks) and still no improvement.

    The phone is good work and looks like there is just an application of high power of the CPU for something.

    I would try a reset of the device factory to check if some sw or fw settings has been the cause of this new bad behavior.

    Do you think that it's worth to try it, or is it better to get in touch with Motorola customer service to request a check (my phone has only 3.5 months of life)

    Thank you

    Marco

    Resolved after a factory reset!

    In fact, I would suggest that a reset from factory to everyone feels that the battery of the XT720 wouldn't last as expected.

    I have my phone unplugged and mode intelligence (with active Gmail) from 9 h 42 m and the battery is still at 70%

    This is a very positive behavior from the last days where my battery low runned after about 4 h.

    It is also a good way to assess the potential of the stand-by battery and could be a way to compare the real potential of vanilla by a custom filter (widget, screensaver, desktop direct current) and think that if it is worth to keep the customization and the battery life let go.

    See you soon

  • Help on the game of query results

    Hi gurus,

    Have this survey for my requirement of dataset sql.

    Sample, it's that I have to pick up the nonfunctional currency transactions.

    Lets say for a given month, data that are present are for CurrencyA and CurrencyB for a particular account.

    Account1 has a transaction does not work CurrencyA and CurrenyB then Account2 has only transaction to CurrencyB.

    My current query result is that the 3 first lines, what I need is the 4th should also appear and be included.

    CurrencyA - amount - account1

    CurrencyB - amount - account1

    CurrencyB - amount - Account2

    CurrencyA - < '0' / or null >-Account2

    I think that my request is based on the currency < x > I have, so it should be for each account, he has all the lines for each currency.

    If please notify and let me know your thoughts.

    Kind regards

    Hello

    It looks like you want an outer join partitioned.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • Help returns the array of query results

    Hi all... Pretty new to this so please forgive my ignorance. Running Oracle 11 g, trying to return results as in the example I give below. I don't know how the Sport field will have unique values, and I don't know how many unique values the year field is seen in the data. Does anyone have recommendations/suggestions?

    The structure of the table is:
    Year of sport
    Baseball 10-11
    Football 10-11
    Football 11-12
    Football 11-12
    Football 11-12
    Baseball 11-12

    The result should be sports in each year and should be grouped by year but shown as columns so:
    (GROUP OF the year)
    1, baseball 1, Football
    2, 1, Football Soccer 1, Baseball


    I hope that makes sense. Thanks for any help!
    ... Kaelon

    Does anyone have recommendations/suggestions?

    Maybe something like:

    SQL> with t as (
     select 'Baseball' sport, '10-11' year from dual union all
     select 'Football', '10-11' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Soccer',   '11-12' from dual union all
     select 'Baseball', '11-12' from dual
    )
    --
    --
    select year, listagg(cnt || ', ' || sport, ' ') within group (order by cnt desc) sports from (
    select count(*) cnt, sport, year from t
    group by sport, year)
    group by year
    /
    YEAR    SPORTS
    ------- ----------------------------------------
    10-11   1, Baseball 1, Football
    11-12   2, Football 1, Baseball 1, Soccer       
    
    2 rows selected.
    

    ?

  • Windows XP - Ask toolbar all movies / games run slower and the sound breaks down constantly

    Original title: help

    I have an ibm laptop and windows xp. After that I installed the Ask toolbar all movies / games run more slowly and the sound is broken down permanently. How can I fix this?

    Hi calludinmace,

    Sorry to hear about the issue. From what I understand, movies and games on the computer to run slowly and his bodyguard break.

    1. This problem started to happen after an activity especially on the computer?
    2. Are these movies online or stored on CD or on the computer?
    3. In addition, are the games online or installed on the computer?

    You can update the computer with the latest drivers in particular sounds, video and chipset drivers. Log computer manufacturer site to do so.

    In addition, update the computer with the latest version of Flash Player. Visit this link to install the latest version.

    Here's a very useful article that can be of additional assistance.

    Do not respond if these suggestions don't help you.

  • I need to enter the administrator to run mode and the cleaning viruses on my computer.

    How to make Windows vista administrator mode

    Sign in to a user account with administrator privileges and make a thorough analysis. However, it should not be necessary to do so. Normally, you can perform the scan of your Standard user account. Just provide the password/OK to the UAC prompt when it appears for different programs.

    http://www.elephantboycomputers.com/page2.html#Removing_Malware

    If you would like more information, please post back with more details and the results of the analysis by the link above.

    MS - MVP - Elephant Boy computers - don't panic!

Maybe you are looking for