Maximum size of EXECUTE IMMEDIATE

Hellou everyone,

I would like to ask if there is a way how to run the dynamic SQL CREATE or VIEW of REPLACE command more than 32 KB of wholesale. Because the EXECUTE IMMEDIATE statement can run up to 32 k (greater length of variable plsql chain) chain

Is there a way how children Ridge or replace the command?

Or I need to revrite using DBMS_SQL.

Thank you.

(a) WHY? If you want to dynamically create views?  This is not recommended because your application/database should be designed at the time of the design, not running.

(b) If you are on 11 g, you can use the CLOB datatype with immediate execution, so there is no 32 K limit.

(c) If you are before 11 g you need to update, but if you can't then the following example is how you do it using DBMS_SQL.

SQL > declare

2 v_large_sql clob.

3 v_num number: = 0;

number of v_upperbound 4;

5 v_sql dbms_sql.varchar2s;

6 whole v_cur;

number of v_ret 7;

8 v_join_sql varchar2 (100): = ' crΘer view vw_tmp as ";

9 start

10. build a very big SQL statement in the CLOB

11 loop

12 v_large_sql: = v_large_sql | v_join_sql | "select" the number of this line is: ' | TO_CHAR (v_num, 'fm0999999') | " "as col1 from dual;"

13 v_join_sql: = "union all";

14 v_num: = v_num + 1;

15 exit when dbms_lob.getlength (v_large_sql) > 40000 or v_num > 800;

16 end loop;

17 dbms_output.put_line (' length :'||) DBMS_LOB. GetLength (v_large_sql));

18 dbms_output.put_line ('Num :'|| v_num);

19-

20. now divide this big SQL statement into pieces of 256 characters and put in table VARCHAR2S

21 v_upperbound: = ceil ((v_large_sql) dbms_lob.getlength / 256);

22 because me at 1.v_upperbound

23 loop

24 v_sql (i): = dbms_lob.substr (v_large_sql

25, 256 - amount

26, ((i-1) * 256) + 1 - offset

27                                 );

28 end of loop;

29-

30. now analyze and execute the SQL statement

31 v_cur: = dbms_sql.open_cursor;

32 dbms_sql.parse (v_cur, v_sql, 1, v_upperbound, dbms_sql.native, false);

33 v_ret: = dbms_sql.execute (v_cur);

34 dbms_output.put_line ("' view created");

35 dbms_sql.close_cursor (v_cur);

36 end;

37.

Length: 40015

NUM:548

View created

PL/SQL procedure successfully completed.

SQL > select count (*) in the vw_tmp;

COUNT (*)

----------

548

SQL > select * from vw_tmp where rownum<=>

COL1

-----------------------------------

The number of this line is: 0000000

The number of this line is: 0000001

The number of this line is: 0000002

The number of this line is: 0000003

The number of this line is: 0000004

The number of this line is: 0000005

The number of this line is: 0000006

The number of this line is: 0000007

The number of this line is: 0000008

The number of this line is: 0000009

10 selected lines.

SQL >

Tags: Database

Similar Questions

  • "EXECUTE IMMEDIATE" of CLOB

    I have plsql-variable with CLOB datatype. It contains the source code of a package body. The size of the variable does not fit into 'varchar2' data type, it is larger.
    Now, I want to run a "EXECUTE IMMEDIATE" statement to create my package body defined in my CLOB variable.
    How can I use the "EXECUTE IMMEDIATE"?
    Note that "EXECUTE IMMEDIATE" does not allow for CLOB-variable as an argument.
    Note that "EXECUTE IMMEDIATE" allows "varchar2" - variables as arguments but "varchar2" contains maximum only some 32 KB of data.


    --

    Maybe it's possible to run something like
    "EXECUTE IMMEDIATE v1 | v2 | v3»
    where v1, v2, v3 are of type varchar2 and altogether they contain ca 100K of data and execute immediately would succeed?
    I wil outside, a s test...

    I wil outside, a s test...

    You may have searched for as well ;)

    Re: immediate execution of a CLOB field.

    Note: In 11 GR 2 run immediately accepts a clob as well...

  • How to run an EXECUTE IMMEDIATE statement in an interactive report

    Hi all!!

    I need to make a dynamic construction of a query to run in an interactive report, but the Source of the region only allows SELECT simple instructions. There is no way to run an EXECUTE IMMEDIATE statement in a Source of interactive report region?

    Cordially Pedro.

    Hi Pedro,

    Reduce the size of the varchar2 32000 1000 (or, up to a maximum of 4000)

    Andy

  • EXECUTE IMMEDIATE throws exception NO_DATA_FOUND when it should not

    Hi all

    I wrote an anonymous PL/SQL block that, on paper, should be OK, but one of its commands EXECUTE IMMEDIATE is runnning slowing prematurely and throw an exception NO_DATA_FOUND, when it should not because I know that there is data in the table.

    Here is the line that I suspect is out of steam after 8 attempts:


    ---
    immediately execute "INSERT INTO ple101.circular35 (ID, SLAVETABLEID, SLAVEITEMID, MASTERTABLEID, MASTERITEMID, PRO) (SELECT * FROM SLAVETASKS where mastertableid =' |)" subTableID | "and masteritemid =' |" subitemID |' and subtableid =' | mastTableID | "and SLAVEITEMID =' |" mastItemId |') ' ;
    ------

    It is supposed to search the entire SLAVETASKS table for documents that match the WHERE clause, but gives up after 8 cycles.
    Table SLAVETASKS got 10228 records.

    The above statement (and the whole of the PLSQL block) is good in that it gets records if they are wthin the first 8 records in the SLAVETASKS table, but like I said after 8 records, to throw an exception NO_DATA_FOUND.

    Published by: user10390960 on April 28, 2012 03:21

    Published by: user10390960 on April 28, 2012 03:22

    Published by: user10390960 on April 28, 2012 03:23

    Published by: user10390960 on April 28, 2012 05:08

    Hi Goofy,

    The above script is for PLSQL and if you want to display the data in circular 35 follow like that

    # Save the code below in the sqlscript for example. circular_process_display. SQL and run as

    sqlplus /@ @circular_process_display.sql

    -- CREATE TABLE circular 35
    CREATE TABLE circular35
    ....
    ..
    /
    
    -- Execute PLSQL Block as given in my earlier post
    DECLARE
    ...
    BEGIN
    ...
    EXCEPTION
    ...
    END;
    /
    
    -- Run SQL to display output on screen.
    SET SERVEROUTPUT ON SIZE 100000 FEEDBACK ON LINESIZE 200;
    
    SELECT *
    FROM circular35
    /
    
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    
  • Hi, my places.sqlite file size is 30 720 KB I reached the maximum size, is there a maximum size for this. Visited links are is more changing color.

    Hello
    My places.sqlite file size is 30 720 KB I reached the maximum size, is there a maximum size for this.
    Suddenly the visited links don't change is no longer the font color, that I prepare for an exam, I need visited issues to change color, to follow up on issues that I ended. But if I delete a few days of history, then again once, most visited links change color and then it stops, it seems that something is getting full and not able to accommodate more? Why my visited links don't change color after a number of visits? I would like to make a back up of the file places.sqlite. So I tried everything to remove the profile, uninstalling reinstalling, creating a new profile, and then copy paste places.sqlite etc, but as mentioned after a few visits, visited links is no longer change color, if I delete a few days in history and then a few visits is again change color and then stop again, so what should I increase so that my quota of visited links is increased , I also tried tweaking about: config and there has been no result. Although I was not really convinced that _pages growing brower.history_max (don't remember the name, but I'm sure you get the idea) will help.
    Seems that while my visited links change color, quota is met and only if I delete the history of a few days will I get some links most visited to change color. Can someone enlighten us? As mentioned that my places.sqlite file size is 30 720 KB so I think maybe this has something to do with it? Would be very grateful if someone could help me. Thank you.

    Sorry it is not looking good.

    1. Unlike bookmarks history is not saved in Firefox.
    2. There is a possibility using Windows.
    3. Sync is not expected to back up things until the synchronization server
    4. If places.sqlite does not sort itself you may have to re-create remove it. You will lose your history, but can still access indirectly IF you have saved a copy of the appropriate
    5. Different databases to try to create new profiles
    1. History
      is rather less robust than bookmarks, you should deliberately somehow return it upward, but it's too late now
    2. Earlier versions of Windows
      This is really the last chance. Make sure you have some places.sqlite you saved. Always before and after any attempt to restore the backup. Windows must be able to provide a previous version. One of these versions may be usable as is; or can be used after a repair with housekeeping. Of course, this is not the latest version but it should help.
    3. Sync is not a server backup service.
      Sync is intended to save on another device, no backup is the fact that the second device then contains synchronized information. IIRC Sync development ceased, and the replacement when available may include a server backup option.
    4. Recreate the database of bookmarks (including history)
      Unfortunately, recess can only use saved bookmarks, there is no saved history to use. Once the database is re-created, it will continue to store the history but it loses the existing history. This time take steps to save on a regular basis.
    5. Use the new profiles for database testing.

    To simplify comparison of the results of the database different files create one or more new additional profiles. Then try to smash the places.sqlite file into the test profile with any other places.sqlite, you want to try. Allows you to directly compare the databases, without seeking to use sync and without changing the Firefox profile work unnecessarily. You can keep a reference profile of studies with the best of the profiles of any shows results of history; According to the best recreated or corrupted database is.
    • Use the Profile Manager to create and delete profiles Firefox
    • CARE, do not rename or delete profiles created once or use anything other than empty folders when they are created. Don't nest in the other profiles. (At least until you know exactly how it behaves - post back if you never consider such actions)
  • maximum size of the message

    What is the maximum size allowed in icloud mail by email?

    The size of the mailbox and the message sending limits in iCloud - Apple Support

    Limits on sending messages

    There are several safeguards in place to ensure that only iCloud members can send messages using iCloud. One of these safeguards include reasonable limits on:

    • The total number of messages, you can send each day (200 messages)
    • The number of recipients, you can message each day (1000 recipients)
    • The maximum number of recipients per message (100 recipients)
    • The size of incoming and outgoing messages (20 MB, up to 5 GB with mailbox ) enabled
  • What is the maximum size of HARD drive, I use in my dc7600 CMT

    I use a HP dc7600 CMT, which works well after the upgrade to a Samsung 128 GB SSD Intel Pentium D 3.4 GHz, 4 GB of RAM and an AMD Radeon HD 6450. I'm under Win 8.1 Pro x 64, with the most recent upgrade and have absolutely no problem. Now, I want to add a second internal HDD and I wonder what is the maximum size that I can go to. I can't go up to 2 TB, or am I limited to a lower number? 1 TB? 500 GB? 250 GB?

    Will be happy to help here, especially if he actually tried to apply in practice.

    Thanks in advance.

    Best regards

    Hello:

    In theory, you'd be limited to 2 TB.

    The biggest HARD drive I have ever installed in my dc7600 CMT was a 1 TB of HDD, so I can't confirm that a 2 TB drive will absolutely work.

  • Portege R100: Question on the maximum size of HARD drive

    Hello

    I understand the internal player on the R100 is an ATA5 (Enhanced IDE), I've only used the IBM (now HGST) readers, they do a decent-sized on ATA6 disc, I guess, it will take the player that will support ATA5 as the controller on the R100 is ATA5 only.

    As for the size, what is the maximum size can I ride in this unit?

    The orginal is 5.4 width x depth x 7.9 height 8 mm. Can I assume all 1.8 inch drive will fot or is it a mine field?

    Thank you very much
    Ashley

    Hello

    AFAIK the R100 was delivered with a 30GB and 40GB HDD.
    I found an info that the hard drives are compatible:

    HDD1422: Width (mm) 54.0; Height (mm) 5.0 0.15; Depth (mm) 78.5 0.3
    MK2003GAH: Width: 54.0, height: 8.0, depth: 78.5
    HDD1384: Width: 54.0 0.2, height: 8.0 0.15, depth: 78.5 0.3
    HDD1524: Width: 54.0 0.2, height: 8.0 0.15, depth: 78.5 0.3

  • Satellite Pro 4600 - what is the maximum size of HARD drive?

    My age Satellite Pro 4600 has a 20 GB HARD drive. These are now very difficult to obtain, does anyone know if superior capacy HDDs can be used and, if so, what is the maximum size of the HARD drive.

    (Despite his age that I always use the Satellite Pro for some jobs).

    Hello John

    Satellite Pro 4600 is old enough for laptop and it is not easy to find the exact info. The fact is that this laptop comes with 10 and 20 GB hard drives.
    My opinion is that you can use 30 or even 40 GB HDD. I think that 30 GB new HARD drive should be enough for your some jobs.

    What do you think?

  • The maximum size of HDD for Satellite Pro 4290?

    My drive is exhausting (Win 98 tells me he has a lot of bad sectors). What I have to climb a 6gig HDD or can I put? If so, what size a disc will be the last address of the BIOS?

    I think I need a disk 2.5 "9.5 mm, but I don't know if it has all the other features that I have to respect.

    ALSO, if I buy a hard drive USB backup etc., the computer will see it? Y at - it a maximum size for external USB drives?

    Help!

    Mike

    I have problems on my laptop cause sometimes a lot of blue screens is displayed all the time. When I took my laptop to the Distributor here in Malta, he shaped for me twice, but the Dungeon problem persistent. I would like to have the official e-mail address of the parent New York company or even a suggestion that I can do.

    CJB

  • Y at - it a maximum size of HARD drive internal to a Satellite Pro A120

    Is there a maximum size of disk HARD internally for a Satellite Pro A120?
    I tried a 320 HDD int Tosh and had problems with continuous boot.

    I have the BIOS update (March 08)

    > Is there a maximum size of disk HARD internally for a Satellite Pro A120
    Yes, I think so.
    The BIOS doesn't support all sizes of HARD drive!

    In my opinion, teething problems are associated with the large size of HARD drive and advise to use a smaller HARD drive.

  • Satellite L40 - what is the maximum size of HARD drive?

    I have a laptop Toshiba Satellite L40, model number PSL4CL - 001 with 80 GB HDD (SATA) 00C. I need to buy a new bigger hard drive, but I don't know the maximum size that I can use my laptop?

    Can I get a new one with 500 GB or I shouldn't buy one more 250 or 320 GB?

    Hello

    Theoretically, you can buy each HARD drive you want. Your laptop is equipped with a SATA interface for HARD disk and there is no limit of capacity as on the old IDE interface. So, a 500 GB model should work correctly on your laptop.

    If you buy a new one make sure that it s a portable 2.5 HARD drive with SATA interface. All that s! :)

    I hope I could help a bit.

    Good bye

  • Satellite 5200 - maximum size of HARD drive

    Hello
    I have several times successfully updated my hard drive in my 5200-701.
    I am running a 100 GB HD as the primary drive and a 120 GB hard drive in the Bay of style.
    Unfortunately, I'm out of new space and want to step up to a 160 GB or even HD 200 GB.
    Does anyone know if there are no restrictions in the maximum size of a disk?
    I'm not an expert, but it tickles my mind that there was a moment where there is a limit of 132 GB, but that might have had something to do with Windows NT or 2000.
    I am running XP but always in the SP1 Version.

    Best regards
    Henning

    Hello Henning

    It is very useful to know that 5200 Satellite can work well with the HDD. You will be very happy if someone has tested the limits of capacity of HARD disk with this device. It's that there is no official document on this subject.

    As far as I know the maximum capacity of the HARD drive depends on the BIOS and not the operating system. I heard that the hardware (specialized for the hardware upgrade) can manipulate BIOS to work with hard disks of high capacity.

  • Satellite 1700-400: maximum size of the HARD drive?

    Hello

    the hard drive of my 1700-400 has collapsed.
    Initially, it was a 10 GB HARD drive.
    What is the maximum size of the 1700-400 can work with?

    grobi Oxford

    Hi Grobi

    Maybe someone exactly news upgrade HARD drive on this unit, but, in my opinion you can use up to 20 GB hard drives with no problems.

  • Equium A60-157: Question about maximum size of HARD drive

    Hello

    Looking to upgrade my Pentium 4 3.06GHz Equium A60-157 a bit then got a new module of 1024 MB of RAM, but now really to upgrade my 40 gb HDD to go with. I found all the specifications of the type of HARD drive, I need, but may not know what the maximum size of the disk, it is that the BIOS will recognize. I don't think that I've never updated by the BIOS and I'm looking to get a 120 GB drive. Any ideas please?

    Thanks for your help!

    Hi Alex,

    Most portable smanufactured in the last 5 years or so are able to accept larger hard drive capacity without problem. I am currently using a 80 GB drive in an old SA30 of three years. I can't guarantee a 120 GB drive will work, but I see no reason why it wouldn't.

    Kind regards

Maybe you are looking for