Execution of several statements

I want to execute several statements in one turn. After reading the API I found out that I must use execute(String sql) to perform these multiple statements. But when I put this text below in the argument list of Statement stmt = new Statement();
stmt.execute(MyQuery);
The query
create table test2(name varchar(10))
create table test3(name varchar(10))
this information I get out of a JEditorPane
sql = jEditorPane1.getText();
stmt.execute(sql);
But I get this errormessage back:
Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'create table test3(name varchar(30))' at line 1"
Is there anything wrong with this use of execute?

I am using the same driver but not executing multiple statements at once.
The test I run was through an database manager - not under program control when
it worked with the ;
I searched several areas and all the results I came up with did not
solve the problem you are having executing several statements at
one time against MySQL. They all reverted back to executing one
statement at a time.
If there are a lot of statements - store them in an array or vector
and execute them in a loop.
rykk

Similar Messages

  • Tkprof not showing the Execution Plan for Statement

    Hi all
    using oracle 9i release 2
    I have issued the following statements
    alter session set sql_trace
    alter session set events '10046 trace name context forever, level 12';
    --then executed a pl-sql procedure
    after reading the traceout outfile it shows the Execution plan for statements directly wirtten under begin and end block and doesnot displays the plan for the statements written like this
    procedure a is
    cursor b is
    select ename,dname from dept a,emp b
    where a.deptno=b.deptno;
    begin
    for x in a loop --plan not found but stats are written
    select ename into v_ename from emp where empno=300; --does show the plan+stats
    end;
    what I am missing to get the actual plan in trace output file
    thanks in advance

    You have to exit sql*plus after running the procedure, example tkprof is below:
    declare
    cursor c is
    select ename, dname
    from emp, dept
    where emp.deptno = dept.deptno;
    begin
    for v_x in c
    loop
    dbms_output.put_line(v_x.ename || ' ' ||v_x.dname);
    end loop;
    end;
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.06 0 0 0 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.00 0.06 0 0 0 1
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 68
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 0.00 0.00
    SELECT ENAME, DNAME
    FROM
    EMP, DEPT WHERE EMP.DEPTNO = DEPT.DEPTNO
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 15 0.01 0.00 0 44 0 14
    total 17 0.01 0.00 0 44 0 14
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 68 (recursive depth: 1)
    Rows Row Source Operation
    14 NESTED LOOPS
    14 TABLE ACCESS FULL EMP
    14 TABLE ACCESS BY INDEX ROWID DEPT
    14 INDEX UNIQUE SCAN DEPT_PK (object id 40350)
    Best Regards
    Krystian Zieja / mob

  • Order of execution of static { }  statements question

    Hi,
    I have a question about the order of execution of static statements. Let's imagine the following Class B inheriting of Class A:
    public class A {
        static {  // My static code for A };
    public class B extends A {
        static { // My static code for B; };
    }I know that static statements are executed when classes are loaded, but does Java guarantee an order of execution of static statements between inherited classed (like for constructors) or is it 'random' in that it depends which class is loaded first?
    Thanks,
    J.

    Jrm,
    My advise with this and all such questions is "Suck it and see"...
    Have compiler, will travail ;-)
    Cheers. Keith.
    PS:
    package forums;
    import java.util.List;
    import java.util.ArrayList;
    public class InitBlocksTesterpator
      private List<String> list = new ArrayList<String>() {
          add("This hack uses an anonymous inner-class to populate the list.");
          add("It causes serialization problems");
    C:\\Java\\home\\src\\forums\\InitBlocksTesterpator.java:8: warning: [serial] serializable class <anonymous forums.InitBlocksTesterpator$1> has no definition of serialVersionUID
      private List<String> list = new ArrayList<String>() {
                                                          ^
    1 warning
      static {
        System.out.println("this is a static initialiser block above the main method.");
        System.out.println("this is a instance initialiser block above the main method.");
      public static void main(String[] args) {
        // static { System.out.println("this is a static initialiser block inside the main method."); } // won't compile
        { // this is hardly ever used. just use a method FFS!
          int n = 0; // n is lexically scoped... i.e. it only exists in this code block
          System.out.println("this is a code block inside the main method.");
        new InitBlocksTesterpator().moreBeer();
        System.out.println("this is a instance initialiser block below the main method.");
      static {
        System.out.println("this is a static initialiser block below the main method.");
      public void moreBeer() {
          System.out.println("this is a code block in the moreBeer instance method.");
        // static { System.out.println("this is a static initialiser block in an instance method"); } // won't compile
        System.out.println(list);
    }... just to save you some time ...

  • Execution of SQL statement 'alter tablespace PSAPSR3

    Dear mastah,
    I trying extend tablesapce at oracle, but not succesfully, and have problem,
    maybe can help this issue..
    error problem add tablespace:
    BR0280I BRSPACE time stamp: 2014-01-06 10.27.31
    BR0370I Directory /oracle/SID/sapreorg/semxnacf created
    BR0280I BRSPACE time stamp: 2014-01-06 10.27.32
    BR0319I Control file copy created: /oracle/SID/sapreorg/semxnacf/cntrlSID.old 99106816
    BR0280I BRSPACE time stamp: 2014-01-06 10.27.32
    BR1088I Extending tablespace PSAPSR3...
    BR0280I BRSPACE time stamp: 2014-01-06 10.27.51
    BR0301E SQL error -59 at location BrSqlExecute-1, SQL statement:
    '/* BRSPACE */ alter tablespace PSAPSR3 add datafile '/oracle/SID/sapdata16/sr3_218/sr3.data218' size 4000M autoextend off'
    ORA-00059: maximum number of DB_FILES exceeded
    BR1017E Execution of SQL statement 'alter tablespace PSAPSR3 add datafile '/oracle/SID/sapdata16/sr3_218/sr3.data218' size 4000M autoextend off' failed
    BR0669I Cannot continue due to previous warnings or errors - you can go back to repeat the last action
    BR0280I BRSPACE time stamp: 2014-01-06 10.27.51
    BR0671I Enter 'b[ack]' to go back, 's[top]' to abort:
    regards,
    amin

    BR1088I Extending tablespace PSAPSR3...
    BR0280I BRSPACE time stamp: 2014-01-06 10.27.51
    BR0301E SQL error -59 at location BrSqlExecute-1, SQL statement:
    '/* BRSPACE */ alter tablespace PSAPSR3 add datafile '/oracle/SID/sapdata16/sr3_218/sr3.data218' size 4000M autoextend off'
    ORA-00059: maximum number of DB_FILES exceeded
    $ oerr ora 59
    00059, 00000, "maximum number of DB_FILES exceeded"
    // *Cause:  The value of the DB_FILES initialization parameter was exceeded.
    // *Action: Increase the value of the DB_FILES parameter and warm start.
    $

  • Time of execution of SQL statement

    Hi,
    I executed some DML statements and Select statements as user SYS for user U1. How can I find the time of execution of these statements?
    Regards,
    Mathew

    You have a couple of options to time queries.
    SET TIMING ON has already been mentioned. I'll add that spooling the session to a file helps keep those timings for later reference.
    You can use DBMS_UTILITY.GET_TIME to get start and end times in microseconds for PL/SQL evaluation. DBMS_PROFILER will time lines of PL/SQL code as they execute. Trace/tkprof has also already been mentioned, although tkrpof times tend to vary a bit between reported and real times and don't take OS activity into account as much as the other timings do.

  • ORA-20001: GET_BLOCK Error. ORA-20001: Execution of the statement was unsuc

    Hi All,
    I have exported a application and after that imported and tried to install it then i am getting this error:
    ORA-20001: GET_BLOCK Error. ORA-20001: Execution of the statement was unsuccessful. ORA-06550: line 5, column 1: PLS-00306: wrong number or types of arguments in call to 'CREATE_REPORT_COLUMNS' ORA-06550: line 5, column 1: PL/SQL: Statement ignored <pre>declare s varchar2(32767) := null; begin s := null; wwv_flow_api.create_report_columns ( p_id=&gt; 29524721731534348 + wwv_flow_api.g_id_offset, p_region_id=&gt; 29524015959534345 + wwv_flow_api.g_id_offset, p_flow_id=&gt; wwv_fl
    History which happen:
    everything was working fine in my workspace but 2 days back one of team member created customer demo application in the same work space so login was also failing and after struggling oneday i got that my authentication function was get overwritten by the demo user authentication so again i chaned by my bakup function now authentication is working but when i export my new developed application and tried to replace the existing application then i am getting the erroe which i have mention before.
    1: I tried to replace by existing one
    2: i tried to assign new application id
    nothing is working so is it problem occues due to new demo application creation which i have deleted or other problem if other then how to solve if by demo then what i need to do .
    But all applications are working well not able to install which i need to do with new developed application.
    Please help me i am in tough situation.
    Thanks in advance,
    Amit

    Amit,
    The next useful test would be to run the file in SQL*Plus, connected as the application parsing schema. If it works, you will have imported the application. After that, please send me the file ([email protected]) and I'll figure out where the trouble is. If it fails in SQL*Plus, try to isolate the failing block. You'll get a pretty good idea by the prompts echoed to the output indicating the import progress.
    Scott

  • RMAN-11003: failure during parse/execution of SQL statement: alter session

    without doing any changes I have started getting the following error in the RMAN logs.
    i didnt any changes related to sort_area_size but getting the error below
    plz help guys
    RMAN logs
    =====================
    connected to recovery catalog database
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of allocate command at 12/03/2007 22:00:01
    RMAN-03014: implicit resync of recovery catalog failed
    RMAN-03009: failure of full resync command on default channel at 12/03/2007 22:00:01
    RMAN-11003: failure during parse/execution of SQL statement: alter session set sort_area_size=10485760
    ORA-00068: invalid value 10485760 for parameter sort_area_size, must be between 0 and 1

    Hi:
    It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe).

  • Sudden increase in buffer gets per executions in update statement

    Hi,
    Recently we have encountered one performance issue, which is most likely caused by a sudden increase in the buffer gets per execution.
    The SQL is an update statement, updating a table using a primary key (we have checked to confirm the running execution plan is using the primary key), and one field being updated is a BLOB column.
    As shown in the below statistics, there is no major change in the number of executions during the every 20 minutes monitoring interval. However, the buffer gets per executions has been more than double, and the CPU time is almost doubled, hence the exec_time (elapsed time) has been doubled.
    The same SQL has been running for the past four years in multiple similar databases. The database is Oracle 9.2.0.4 running on Solaris 9. For the past 300 days, the average elapsed time per execution is about 0.0093s, while the average buffer gets per execution is about 670. The update statement has been executed about 9 times per second.
    The question is why there is a sudden increase in the buffer gets? The sudden increase happened twice for the past two days.
    <pre>
    B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
    2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
    2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
    2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
    2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
    2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
    2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
    2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
    2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
    2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
    2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
    2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
    2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
    2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
    2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
    2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
    2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
    2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
    2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
    2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
    2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
    2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
    2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
    2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
    </pre>
    Yesterday I did a trace on one of the sessions running the update statement, and below is the tkprof output:
    <pre>
    call count cpu elapsed disk query current rows
    Parse 76 0.03 0.00 0 0 0 0
    Execute 76 4.58 5.14 0 567843 19034 76
    Fetch 0 0.00 0.00 0 0 0 0
    total 152 4.61 5.14 0 567843 19034 76
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 88
    Rows Row Source Operation
    1 UPDATE (cr=30 r=0 w=0 time=6232 us)
    1 INDEX UNIQUE SCAN <PK Index Name> (cr=3 r=0 w=0 time=58 us)(object id 81122)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    Waited--------------------------------------------------------------------------------
    SQL*Net message to client 152 0.00 0.00
    SQL*Net message from client 152 0.00 0.22
    SQL*Net more data from client 1894 0.00 0.03
    SQL*Net break/reset to client 152 0.00 0.00
    buffer busy waits 14 0.00 0.00
    enqueue 1 0.61 0.61
    </pre>
    GaoYuan

    Hi,
    I've reformatted your output for better understanding (with {noformat}...{noformat}):
    B_TIME           E_TIME           EXECUTIONS_DIFF  EXEC_TIME   CPU_TIME BUFFER_GETS EXEC_PER_DAY
    2009-11-25-14:04 2009-11-25-14:23            8513      .0069      .0068      315.56       646329
    2009-11-25-14:23 2009-11-25-14:43           10170       .007      .0068      312.28       726188
    2009-11-25-14:43 2009-11-25-15:05           11873      .0072      .0069      320.17       787885
    2009-11-25-15:05 2009-11-25-15:23            8633       .011      .0101      844.83       675014
    2009-11-25-15:23 2009-11-25-15:44            9668      .0144      .0137     1448.51       680778
    2009-11-25-15:44 2009-11-25-16:04            9671      .0163      .0156     1809.04       702163
    2009-11-25-16:04 2009-11-25-16:25           10260      .0188      .0177     2107.67       711447
    2009-11-25-16:25 2009-11-25-16:44            9827      .0157      .0151      1834.3       739593
    2009-11-25-16:44 2009-11-25-17:05           10586      .0171      .0164     2008.25       714555
    2009-11-26-08:04 2009-11-26-08:24           11028      .0182      .0172     1979.61       800688
    2009-11-26-08:24 2009-11-26-08:44           10533      .0154      .0149     1734.62       750248
    2009-11-26-08:44 2009-11-26-09:04            9367       .018      .0168     2043.95       685274
    2009-11-26-09:04 2009-11-26-09:24           10307      .0214      .0201     2552.43       729938
    2009-11-26-09:24 2009-11-26-09:45           10932      .0251      .0234     3111.48       762328
    2009-11-26-09:45 2009-11-26-10:05           10992      .0278      .0254     3386.41       797404
    2009-11-26-15:03 2009-11-26-15:16            7183      .0425      .0348     4615.42       746824
    2009-11-26-15:16 2009-11-26-15:23            2921      .0417      .0373     4887.75       682092
    2009-11-26-15:23 2009-11-26-15:43            9597      .0393      .0352     4603.62       679656
    2009-11-26-15:43 2009-11-26-16:03            8797      .0411      .0362     4783.66       630755
    2009-11-26-16:03 2009-11-26-16:23            9957      .0453      .0391     5168.28       718100
    2009-11-26-16:23 2009-11-26-16:43           11209      .0436      .0369     4870.77       808395
    2009-11-26-16:43 2009-11-26-17:03           10729      .0428      .0375     5119.56       766103
    2009-11-26-17:03 2009-11-26-17:23            9116      .0409      .0363     4912.58       659098
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       76      0.03       0.00          0          0          0           0
    Execute     76      4.58       5.14          0     567843      19034          76
    Fetch        0      0.00       0.00          0          0          0           0
    total      152      4.61       5.14          0     567843      19034          76
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 88
    Rows     Row Source Operation
          1  UPDATE  (cr=30 r=0 w=0 time=6232 us)
          1   INDEX UNIQUE SCAN <PK Index Name(cr=3 r=0 w=0 time=58 us)(object id 81122)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      SQL*Net message to client                     152        0.00          0.00
      SQL*Net message from client                   152        0.00          0.22
      SQL*Net more data from client                1894        0.00          0.03
      SQL*Net break/reset to client                 152        0.00          0.00
      buffer busy waits                              14        0.00          0.00
      enqueue                                         1        0.61          0.61
    ********************************************************************************Can you please provide a DDL for the table, indexes, type of the tablespace(s) they reside in (ASSM/MSSM, extents sizes), the UPDATE statement, how many sessions on average/peaks are doing the same thing concurrently, how many sessions are working this table concurrently and how do they use it?

  • Problems with several statements in one servlet

    Hi!
    I use the jdbc:odbc bridge driver, and an Access database. I'm making a webshop, and everything is working except for one thing: I can't insert several OrderItems at the same time.
    I have a basket structure, where I have several OrderItem objects. In these objects, I have product_id, price, quantity etc in each object.
    My database have to related tables, Order and OrderItem. I first insert a new order into the Order table. That works. Then I try to read the Order table to find the highest Order ID, which will then be used when I insert data into the OrderItem table.
    The problem is that if I add any more statements to the same servlet, I get a Invalid Cursor type error.
    This is the code that works:
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:Network");
    Statement stmt = conn.createStatement();
    java.util.Date date = new java.util.Date();
    java.sql.Date sqlDate = new java.sql.Date(date.getTime());
    String strDate =String.valueOf(sqlDate);
    stmt.executeUpdate("INSERT INTO Order2(CustID, Ordertime) VALUES("+id+", '"+strDate+"');");
    stmt.close();
    conn.close();
    }catch (Exception e){
         out.println("Error: " + e);
    This is the code that doesn't work:
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:Network");
    Statement stmt = conn.createStatement();
    java.util.Date date = new java.util.Date();
    java.sql.Date sqlDate = new java.sql.Date(date.getTime());
    String strDate =String.valueOf(sqlDate);
    stmt.executeUpdate("INSERT INTO Order2(CustID, Ordertime) VALUES("+id+", '"+strDate+"');");
    Statement stmt2 = conn.createStatement();
    ResultSet rs = stmt2.executeQuery("SELECT Max(OrdID) as max FROM Order2");
    //this will be used to insert the OrderItems
    int MaxOrderID = rs.getInt("max");
    rs.close();
    stmt2.close();
    stmt.close();
    conn.close();
    }catch (Exception e){
    out.println("Error: " + e);
    This is the error I get:
    Error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    I've tried using the same statement, using another connection, closing the first statement before I create a new one etc. But nothing works.
    Any suggestions?
    Any help appreciated!
    Vidar

    Error: java.sql.SQLException: [Microsoft][ODBC Driver
    Manager] Invalid cursor state
    I've tried using the same statement, using another
    connection, closing the first statement before I
    create a new one etc. But nothing works.I could imagine that this is the same again like here:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=147704
    Simply try after your INSERT a dummy query like
    "SELECT 1 FROM <yourtable>"
    I'd be interested if it helps.

  • First execution of sql statements is slow every morning

    Dears,
    we are running an oracle11g database (HP-UX Itanium) and have the following problem:
    Every morning the first execution of statements is very slow.
    After the first execution the statements are running fine.
    Does anyone have an idea where this can come from?
    Is it possible that the cache (shared pool, etc.) will be deleted every night (for example when new statistics are generated or something else)?
    Regards,
    Ilja

    I think you are close to answering your question.
    As you know, Oracle 11g has an automated job to run performance stats every night at approx. 10:00pm (until 2:00am).
    This is run by the dbms_scheduler.
    This could be causing the shared_pool to be flushed because it certainly uses it a lot. I have to manually flush the shared_pool every night in one of my databases before this job runs otherwise I get an ORA-01461.
    But, what I'm surprised is that you have this problem only in the morning.
    It seems you would want to pin your SQL in memory and perhaps set a profile for your execution.
    You don't bounce your database every night, do you?

  • Combine Several Statements.. semi-colon?  "go"?

    I'm using Hyperion Interactive Reporting (a reporting tool), and need to be able to send a very long multi-step SQL statement to Oracle 10g that contains several 'create table x as select y from..' statements, 'create index' statements, etc., then eventually returns one recordset (select * from finaltable).
    Currently a DBA runs all the various steps one by one, then provides the user with the end result in the form of a text file. We would like to make this self serve with parameterized queries.
    My question is, how do I run several different sql statements in one call? I don't have permission to create stored procedures. In MSSQL, I would place a "go" command between each statement. I've tried that, semi-colons, and a lot of other things, and it hasn't worked yet.
    Thanks.

    As this is Oracle and not MS SQL Server, you don't need to create temporary tables, just write a select statement possibly using WITH or sub-query factoring.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9758

  • Please explain execution of select statement after parsing.

    Can any body explain me what happen when a "select * from emp where ename='sanjay' " statement parsed information is found in shared sql area in library cache.
    Where does the execution phase takes place. Is it in private SQLAREA or shared sql area. Please consider that it is MTS(shared server connection) and also UGA is present in Large Pool.
    Please explain step by step.
    Thank you

    You did not indicate a version number and this is important information especially since the term MTS has been replaced by the term "Shared Servers."
    Perhaps this will help you:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2588723819082

  • Prompting error while pl-sql execution to gather stats

    Hi,
    Please find below pl/sql code:
    create or replace
    PROCEDURE ANALYZE_INVOKER_ALT(
        IN_SCHEMA_NAME VARCHAR2,
        IN_TABLE_NAME  VARCHAR2)
    IS
    var_dyna_sql1 varchar2(4000);
    BEGIN
       var_dyna_sql1 := 'EXEC SYS.DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => '''||IN_SCHEMA_NAME||''', TABNAME => '''||IN_TABLE_NAME||''', ESTIMATE_PERCENT => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => ''FOR ALL COLUMNS SIZE AUTO'',CASCADE => TRUE, DEGREE => DBMS_STATS.DEFAULT_DEGREE )';
       dbms_output.put_line(var_dyna_sql1);
       EXECUTE IMMEDIATE var_dyna_sql1;
    END;Procedure created successfully but while execution its displaying following error:
    EXEC SYS.DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'ZEAL', TABNAME => 'POSITION', ESTIMATE_PERCENT => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT =>
    'FOR ALL COLUMNS SIZE AUTO',CASCADE => TRUE, DEGREE => DBMS_STATS.DEFAULT_DEGREE )
    BEGIN ANALYZE_INVOKER_ALT('ZEAL','POSITION'); END;
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "ZEAL.ANALYZE_INVOKER_ALT", line 9
    ORA-06512: at line 1Please assist.
    Thanks in adv..

    dba wrote:
    Hi,
    Please find below pl/sql code:
    create or replace
    PROCEDURE ANALYZE_INVOKER_ALT(
    IN_SCHEMA_NAME VARCHAR2,
    IN_TABLE_NAME  VARCHAR2)
    IS
    var_dyna_sql1 varchar2(4000);
    BEGIN
    var_dyna_sql1 := 'EXEC SYS.DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => '''||IN_SCHEMA_NAME||''', TABNAME => '''||IN_TABLE_NAME||''', ESTIMATE_PERCENT => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => ''FOR ALL COLUMNS SIZE AUTO'',CASCADE => TRUE, DEGREE => DBMS_STATS.DEFAULT_DEGREE )';
    dbms_output.put_line(var_dyna_sql1);
    EXECUTE IMMEDIATE var_dyna_sql1;
    END;Procedure created successfully but while execution its displaying following error:
    EXEC SYS.DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'ZEAL', TABNAME => 'POSITION', ESTIMATE_PERCENT => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT =>
    'FOR ALL COLUMNS SIZE AUTO',CASCADE => TRUE, DEGREE => DBMS_STATS.DEFAULT_DEGREE )
    BEGIN ANALYZE_INVOKER_ALT('ZEAL','POSITION'); END;
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at "ZEAL.ANALYZE_INVOKER_ALT", line 9
    ORA-06512: at line 1Please assist.
    Thanks in adv..EXEC is how you invoke PL/SQL procedure from sqlplus
    & is not needed within PL/SQL
    EXEC SYS.DBMS_STATS.GATHER_TABLE_STATSnot as above but as below
    SYS.DBMS_STATS.GATHER_TABLE_STATS

  • Regarding severity  States in OEM

    Hi
    When we set up alerts in OEM 10g, Is there any way to edit the % of critical,warning and clear states? I am not able to understand what % of tablespace or disk space oracle treats as critical,warning or clear.My archive destination is 92% full but still oracle treats the severity as warning alert.I want to edit this..please suggest
    Regards
    Vikram

    If you have kept only the default settings, you will have for e.g. tablespace usage set with warning at 85% and 97% for critical. You can change this by going to manage metrics.

  • Set the order of several states?

    I would like to create a long tutorial animation with several pages (states).
    Is it possible and if?
    How do I select the order in which to display states?
    I don't want each state to have a button for the next state some states should just continue on to the next state.

    Hi Gabriel,
    This is unfortunately not trivial, but here are a few ways to do it:
    A) Create a master action sequence that marches through all the states:
    1.  Put your states inside a custom component. If you haven't used Custom Components before, just select some artwork and choose "Convert to Component > Custom Component". Then double-click the component and start adding states.
    2.  Outside the custom component (in the main application), create a button. This will be used to start the animation.
    3.  In the Interactions panel, add an interaction: On Click > Play Action Sequence. When you choose OK, Catalyst will show the action sequence in the Timelines panel.
    4.  Select the custom component. In the Timelines panel, choose "Add Action >  Set Component State". In the Properties panel, choose the first state.
    5.  Repeat step 4, choosing each subsequent state.
    6.  Space out these "Set component state" interactions on the timeline.
    B) This is a total hack that I just discovered, but it works. You can use a video component to automatically go to the next state after going to one state.
    1.  First, you'll need any FLV video. You should just use an empty one.
    2.  Go to one of the states that should just continue to the next state.
    3.  Import the FLV file "File > Import > Video/Sound File".
    4.  Add an interaction: "On Video Load Complete > Play Transition To State > ".
    C) If you're willing to write some code, you can import your project to Flash Builder and write a handler for the "currentStateChange" event.
    Good luck,
    -Adam

Maybe you are looking for

  • Can i create a back button in ibooks author?

    I know i can go to a videofile on for examlpe pag 20 making a textlink on page 1. but is it possible to create a back link to the page where i came from?

  • BT Broadbands awful set up service

    Hello, I have a problem both with my broadband and my phoneline so am unsure where to post, but the issues have arisen out of signing up to BT Broadband. I asked to be switched to BT Broadband in the middle of August, and was told that my switchover

  • Photoshop CS6 Release Build Date Implies Beta Preferences Valid

    Interestingly, it looks like the released code is closely related to the beta code...  Build date and time of the released files are March 15, 2012 at 3:22 am (someone was burning the midnight oil). I guess that says they didn't feel anything was too

  • Fixing Error message Table CSSL

    Hi, Can somebody help me with the following problem. I did run T:Code KS04 in test run on a cost center and had the following error message (Deletion is not possible (depedent records exist in tabel COKA) I did check remove the checks in Average Acti

  • Excise condition in export

    hi excise conditions are  not fetching in sales order . i have used table 357 to maintain condition records Thanks Sandeep