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

Home -> Community -> Usenet -> c.d.o.server -> Re: using DBMS_METADATA.GET_DDL with table name containing a single quote

Re: using DBMS_METADATA.GET_DDL with table name containing a single quote

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 21 Apr 2007 14:11:39 -0700
Message-ID: <1177189899.155662@bubbleator.drizzle.com>


yaru22 wrote:
> Hi,
>
> I have a table named "Hi$Schema's" in my schema 'myschema'.
>
> However, if I try the following sql statement, I get a failure
> message.
>
> SELECT DBMS_METADATA.GET_DDL('TABLE','Hi$Schema''s','myschema') FROM
> dual

CREATE TABLE "Hi$Schema's" (
bad_idea VARCHAR2(1));

SQL> set long 1000000
SQL>
SQL> SELECT dbms_metadata.get_ddl('TABLE', 'Hi$Schema''s') FROM dual;

DBMS_METADATA.GET_DDL('TABLE',


   CREATE TABLE "UWCLASS"."Hi$Schema's"
    ( "BAD_IDEA" VARCHAR2(1)
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING    STORAGE(INITIAL 262144 NEXT 262144 MINEXTENTS 1 MAXEXTENTS 2147483645    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)    TABLESPACE "UWDATA" SQL> The fact that you can abuse Oracle does not mean you should. The very first thing you should do is:

RENAME "Hi$Schema's" TO something_intelligent;

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sat Apr 21 2007 - 16:11:39 CDT

Original text of this message

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