Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: what's wrong with this...DBMS_SQL

Re: what's wrong with this...DBMS_SQL

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Tue, 12 Jun 2001 09:28:24 -0700
Message-ID: <F001.00325AF5.20010612084751@fatcity.com>

Did you try it?
 
I am not sure about v7.
But under 8.1.5 it works.
And why 'parse' should necessarily use <FONT color=#0000ff>'dbms_sql.v7' ?
 
Here is an example, which proves, that for DDL it's enough to call 'parse' without 'execute':  

SQLWKS> declare cur1 integer;

2> begin 
3> cur1 := dbms_sql.open_cursor; 
4> dbms_sql.parse(cur1,'create table ddd(d1 int)', dbms_sql.native); 
5> dbms_sql.close_cursor(cur1); 
6> end; 
7> / 

Statement processed.
SQLWKS> select * from ddd;
D1

0 rows selected.
 
Igor Neyman, OCP DBAPerceptron, Inc.(734)414-4627<A href="mailto:ineyman_at_perceptron.com">ineyman_at_perceptron.com 

<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

  To: <A title=ORACLE-L_at_fatcity.com
  href="mailto:ORACLE-L_at_fatcity.com">Multiple recipients of list ORACLE-L   

  Sent: Tuesday, June 12, 2001 10:52
  AM
  Subject: RE: what's wrong with
  this...DBMS_SQL   

<SPAN

  class=796505013-12062001>Parse doesn't execute DDL in oracle 7.  The   parse call uses 'dbms_sql.v7' so I would guess that even if the d/b is 8 it   will use the 7 semantics.
<SPAN

  class=796505013-12062001> 
<SPAN

  class=796505013-12062001>Regards
<SPAN

  class=796505013-12062001>David Lord   

    <FONT face=Tahoma
    size=2>-----Original Message-----From: Igor Neyman     [mailto:ineyman_at_perceptron.com]Sent: 12 June 2001     14:31To: Multiple recipients of list ORACLE-LSubject:     Re: what's wrong with this...DBMS_SQL     Lisa,
     
    You don't need DBMS_SQL.EXECUTE, when running other then     DML statements.  DBMS_SQL.PARSE is enough.      
    Igor Neyman, OCP DBAPerceptron, Inc.(734)414-4627<A     href="mailto:ineyman_at_perceptron.com">ineyman_at_perceptron.com      

    <BLOCKQUOTE
    style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

      Surendra, you need to execute 
      it.  Look at the spec of dbms_sql (I want to say it's 
      dbms_sql.execute()).  Either that or use EXECUTE IMMEDIATE. 
      
      Lisa Koivu <FONT 
      face="Book Antiqua" size=2>Oracle Database Administrator <FONT 
      face=Tahoma size=2>954-935-4117 
      The information in the electronic mail message 
      is Cendant confidential and may be legally privileged, it is intended 
      solely for the addressee(s) access to this internet electronic mail 
      message by anyone else is unauthorized. If you are not the intended 
      recipient, any disclosure, copying, distribution or any action taken or 
      omitted to be taken in reliance on it is prohibited and may be 
      unlawful.
      The sender believes that this E-mail and any 
      attachments were free of any virus, worm, Trojan horse, and/or malicious 
      code when sent. This message and its attachments could have been infected 
      during transmission. By reading the message and opening any attachments, 
      the recipient accepts full responsibility for taking protective and 
      remedial action about viruses and other defects. Cendant Corporation or 
      Affiliates are not liable for any loss or damage arising in any way from 
      this message or its attachments. 
      
        -----Original Message----- 
        From:   <FONT 
        face=Arial size=1>Tirumala, Surendra 
        [SMTP:Surendra.Tirumala_at_am.sony.com] <FONT face=Arial 
        size=1>Sent:   Monday, June 
        11, 2001 4:55 PM <FONT face=Arial 
        size=1>To:     <FONT face=Arial 
        size=1>Multiple recipients of list ORACLE-L <FONT 
        face=Arial 
        size=1>Subject:        
        what's wrong with this...DBMS_SQL 
        Hi List, 
        As the part of developing hot backup 
        strategy, I am testing the following <FONT face=Arial 
        size=2>piece of code to take care of 
        arch files to be made avaialable along with backup set. 
        ===================== <FONT 
        face=Arial size=2>SQL> create or replace procedure log_switch 
        as   2  cursor1 
        integer;   3  begin 
          4  cur1 := 
        dbms_sql.open_cursor;   5  
        dbms_sql.parse(cur1,'ALTER SYSTEM SWITCH LOGFILE', dbms_sql.v7); 
          6  
        dbms_sql.close_cursor(cur1);   
        7  end;   8  / 
        
        Procedure created. 
        SQL> execute log_switch; 
        PL/SQL procedure successfully 
        completed.  
        ====================== 
        But, I have observed several times that the 
        above code is not forcing a log <FONT face=Arial 
        size=2>switch. FYI, I want to track 
        the sequence# of logfiles before and after the hot <FONT 
        face=Arial size=2>backup, so that I 
        can backup the files in that range. 
        Am I properly using the DBMS_SQL? 
        Any help is highly appreciated 
        TIA, <FONT face=Arial 
        size=2>Suren Oracle DBA 
        Sony -- 
        Please see the official ORACLE-L FAQ: 
        <A target=_blank 
        href="http://www.orafaq.com">http://www.orafaq.com <FONT 
        face=Arial size=2>-- Author: 
        Tirumala, Surendra   INET: 
        Surendra.Tirumala_at_am.sony.com 
        Fat City Network Services    
        -- (858) 538-5051  FAX: (858) 538-5051 <FONT face=Arial 
        size=2>San Diego, California        
        -- Public Internet access / Mailing Lists <FONT face=Arial 
        size=2>-------------------------------------------------------------------- 
        To REMOVE yourself from this mailing list, 
        send an E-Mail message to: 
        ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in 
        the message BODY, include a line containing: 
        UNSUB ORACLE-L (or the name of 
        mailing list you want to be removed from).  You may 
        also send the HELP command for other 
        information (like subscribing). 
Received on Tue Jun 12 2001 - 11:28:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US