Oracle Regular expression issue

Hi All,
I have regular expression problem.
create table url ( Url varchar2(1024));
insert into URL values ('http://abc.jambo.com/ababs/sffef/dsf/sdfdsf/jk.htm')
insert into URL values ('.*amazon.com.*');
insert into URL values ('Abc.com');
insert into URL values ('xyz.Abc.com');
insert into URL values ('^http://bhido.jambo.com/ababs/kd.htm     ');
commit
SELECT url,REGEXP_SUBSTR(url,'http://([[:alnum:]]+\.?){3,4}/?') "REGEXP_SUBSTR"
FROM url
But it returns following result
URL                                                                       REGEXP_SUBSTR
http://abc.jambo.com/ababs/sffef/dsf/sdfdsf/jk.htm         http://abc.jambo.com/
.**abc.amazon.com.**                                                 NULL
Abc.com                                                                 NULL
xyz.Abc.com                                                         NULL
.**amazon.com.**                                                         NULL
^http://bhido.jambo.com/ababs/kd.htm                         http://bhido.jambo.com/
*What changes would be required in RegEx to get following output*
*URL                                                                       REGEXP_SUBSTR*
http://abc.jambo.com/ababs/sffef/dsf/sdfdsf/jk.htm         abc.jambo.com
.**abc.amazon.com.**                                                 abc.amazon.com
Abc.com                                                                 Abc.com
xyz.Abc.com                                                         xyz.Abc.com
.**amazon.com.**                                                         amazon.com
^http://bhido.jambo.com/ababs/kd.htm                         bhido.jambo.comThanks in advance
-Kuldeep
Edited by: Kuldeep2 on Apr 28, 2009 3:56 AM
Edited by: Kuldeep2 on Apr 29, 2009 3:28 AM

SQL> select url, regexp_substr(url,'[[:alnum:]|\.]*com')new_url from url
  2  /
URL                                                NEW_URL
http://abc.jambo.com/ababs/sffef/dsf/sdfdsf/jk.htm abc.jambo.com
.*amazon.com.*                                     amazon.com
Abc.com                                            Abc.com
xyz.Abc.com                                        xyz.Abc.com
^http://bhido.jambo.com/ababs/kd.htm               bhido.jambo.com

Similar Messages

  • Oracle Regular Expressions in Java?

    JDEV 10.1.3
    ADF BC
    ADF Faces
    Is there a Java library for dealing with Oracle regular expressions? I would like to be able to test a String against an Oracle regular expression for pattern match.
    Thank you,

    Hi,
    Java supports RegularEpressions: http://www.exampledepot.com/egs/java.util.regex/pkg.html
    Frank

  • Regular Expression Issue

    Dear Gurus,
    I had a requirement to read a file and display the words btween two words..
    for an example..
    I need a good friend to share my sarrow things. I need a good friend to share my Loveable things.
    here i need to extract words between good and Loveable
    for this i wrote an regular expression
    Pattern p = Pattern.compile("(?<=\\bgood\\b).*?(?=\\bloveable)\\b)");this is working fine
    Now I need to extract the words between good and loveable or sarrow
    I read from regex tutorial to use | symbol for OR operations.
    Can any one help to solve this issue.
    Thanks and Regards,
    Durai S E
    Edited by: user10734545 on Dec 12, 2011 12:30 AM
    Edited by: EJP on 12/12/2011 19:30: code tags

    user10734545 wrote:
    for this i wrote an regular expression
    Pattern p = Pattern.compile("(?<=\\bgood\\b).*?(?=\\bloveable)\\b)");
    Sometimes a simple solutions is best:  @Test
        public void testGoodLovable() throws Exception {
            Pattern pattern = Pattern.compile("good\\s+(\\w+)\\s+lovable");
            Matcher matcher = pattern.matcher("good test lovable");
            if (matcher.find()) {
                Assert.assertEquals("test", matcher.group(1));
            } else {
                Assert.fail("pattern not matched");
        }bye
    TPD

  • Oracle regular expressions REGEXP_SUBSTR

    Hi,
    I'm relatively new here and this is might be a kind of silly.
    Start using reg expressiona and do not know how to get the second pattern from the end (7 in this case)?
    select REGEXP_SUBSTR('1/2/3/4/5/6/7/8' ,'[^/]+$',1, 1),
    REGEXP_SUBSTR('1/2/3/4/5/6/7/8' ,'[^/]+$',1, 2),
    REGEXP_SUBSTR('1/2/3/4/5/6/7/8' ,'[^/]+$')
    from dual;
    Please help.
    Edited by: lsy_nn on Jul 21, 2010 1:51 PM

    RegExp_Replace is useful ;-)
    Let us read these threads.
    I have created part4 :8}
    Introduction to regular expressions part1 to part4
    Introduction to regular expressions ...
    Introduction to regular expressions ... continued.
    Introduction to regular expressions ... last part.
    Introduction to regular expressions part4
    col extStr for a10
    select
    RegExp_Replace('1/2/3/4/5/6/7/8',
                   '^.*([^/]+)/.*$',
                   '\1') as extStr
    from dual;
    EXTSTR
    7

  • Pattern regular expression issue

    I am trying to validate the file names , the file names can be alpha numeric and can have '_' '-''.' symbols alone
    my code dunno why but my pattern does not work for test# file name
    Pattern _namePattern = Pattern.compile("^\\w\\s-//.]+$");
    private boolean validateFilename(String name) {
              boolean valid = true;
              if (this._namePattern != null) {
                   valid = !(this._namePattern.matcher(name).matches());
              if (valid) {
                   valid = (name.indexOf("%2f") < 0) && (name.indexOf(58) < 0);
              return valid;
         private boolean validateFilenames(File files) {
              if (this._namePattern == null) {
                   return true;
              boolean valid = true;
              if (!(validateFilename(files.getName()))) {
                   System.out.println("ERROR.INVALID_FILENAME"
                             + "The following file contains invalid characters: "
                             + files.getName());
                   valid = false;
              } else {
                   System.out.println("Valid file name " + files.getName());
              return valid;
         }

    i have gone through this link its the same as the pattern API the problem is i have tried so many expressions now that i have lost all of it :(
    Ram asked:
    What was the input string you used to test the above expression?i tried with test it fails for expression [\\w._-]+$so i used negate sight as i am doing a inverse logic in the code and it worked for test
    [^\\w._-]+$now if i tested with a tes#t it still shows a valid string which is not correct
    with the space literal it works for strings having spaces but when i have a input test #test it fails
    I might be sounding too stupid but the matching logic is already present in a third party jar code i don't want to change the logic which i posted in my first i just want to change the regular expression so that it does not allow file names with any of the special characters

  • Javascript regular expression issue

    Hi,
    I am trying to use a javascript regular expression in my code
    var reg_exp = new RegExp("^([0-9]{2})/([0-9]{2})/([0-9]{4})\s([0-9]{2})$");it works from outside of APEX but not being called from inside APEX. It is failing on the
    \sIs there some override or some reason why I cannot do this from inside APEX?
    Thanks in advance!

    Well I just changed it to
      var reg_exp = new RegExp("^([0-9]{2})/([0-9]{2})/([0-9]{4}) ([0-9]{2}):([0-9]{2})$");basically just replaced an actual space for \s and it works fine...

  • Range & Regular Expression issue.

    I'm having a bit of trouble and I'm close to head butting a wall. It's a logic problem. I am trying to create a class, when given a range e.g., 52 - 234 it will output the regular expression
    [5][2-9] | [6-9][0-9] | [1][0-9][0-9] | [2][0-2][0-9] | [2][3][0-4]
    another example
    12-23
    [1][2-9] | [2][0-3]
    It's giving me a logic headache. I can't help but walk around thinking in for loops after trying to get this to work. However, I noticed that someone on the Internet has made a Java tool that does exactly this, but all their links are dead :o(
    Anyone got any ideas? Seen this before? Done this yourself? Help? I've been at this for days now, and I'm fed up!
    Thanks :o)

    Two things:
    1. To use quote inside quoted string you must put two quotes in a row.
    2. Certain characters have special meaning in regeular expressions. You must escape them with \ if you do not want regexp to interpret such characters.
    Select regexp_replace('kathu&+','[/.#''& "\\-\+]')from dual;
    REGEX
    kathu
    SQL>
    {code}
    SY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Oracle regular expression help

    I have worked with regular expressions a little bit in unix scripting.
    I need to diff two schemas to look for missing objects.
    Problem: I changed the naming conventions.
    My objects used to end with '_T' and now end with '_MV'
    I cant use regular instr because I can have
    HELLO_TYPES_T or I could have HELLO_T
    I want to trim off the last T and MV and then do a minus to see if I am missing objects.
    I I think I need to use regexp_instr with an end of line regular expression, but I can't get the syntax correct. Can someone give me a hand?

    Well, how about this:
    SQL> with schema1
      2   as ( select  'HELLO_TYPES_T' obj from dual union all
      3        select  'HELLO_T' from dual union all
      4        select  'TYPES_T' obj from dual union all
      5        select  'HELLO_TYPES_MV' obj from dual union all
      6        select  'HELLO_MV' from dual union all
      7        select  'TYPES_MV' obj from dual union all    
      8        select  'OBJECTS_T' obj from dual )
      9  ,    schema2
    10   as ( select  'HELLO_TYPES_T' obj from dual union all
    11        select  'HELLO_T' from dual union all
    12        select  'TYPES_T' obj from dual union all
    13        select  'HELLO_TYPES_MV' obj from dual union all
    14        select  'HELLO_MV' from dual union all
    15        select  'TYPES_MV' obj from dual)
             ---actual query
    16    select regexp_replace(obj, '^*(_T|_MV)$', '') regexp
    17    from   schema1
    18    minus
    19    select regexp_replace(obj, '^*(_T|_MV)$', '') regexp
    20    from   schema2;
    REGEXP
    OBJECTS
    1 row selected.And vice versa (schema2 minus schema1)

  • Pro Oracle App Express issue : Running stored proc from link in e-mail..

    Just ran into an issue and need some help with it. A person I work with was using code from John Scott's book (Great Book for APEX!!) and was using the verification e-mail link code, when it started acting up.
    The e-mail that is sent is to call a procedure in a database package (pkg_auth) procedure is called send_verification_email. We moved his code up to my hosted area on Oracle's site so I could help further.
    The e-mail is sent properly, but when the link is clicked through, the following error is returned from the server:
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /pls/otn/f HTTP-400 Missing '=' in query string or post form
    The link that is being clicked is:
    [http://apex.oracle.com/pls/otn/ACT_SOFTWARE.pkg_auth.verify_user?p_user=becky&p_code=D62B94845A5E8A5149CCB391CE53D31B]
    Two parameters being passed are user name and a verification key.
    I am stumped since we compared his code to what John has in his book and except for changes in e-mail addresses and server information (don't visit apexdemo.com, its a company in Washington state..)
    Thank you,
    Tony Miller
    Webster, TX

    Only tested on Oracle's site right now. He was working on local machine with code, thus we moved to hosted site so we could work together..
    Execute rights granted to PUBLIC for named package.
    WWV_FLOW_EPG_INCLUDE_MOD_LOCAL: Since this is on Oracle's hosted site, can't really change this setting..
    Funny thing is, I believe before the 3.2.1 update, I had a version of this working in a demo for someone (deleted it since then...) now it seems to be having issues..
    Strange, the url is being re-written as : [http://apex.oracle.com/pls/otn/f?p=&APP_ID.:101:&APP_SESSION.] after the error is displayed. Also that the url seems to long for the address bar and I need to scroll right..
    Thank you,
    Tony Miller
    Webster, TX
    Edited by: Tony Miller on Oct 14, 2009 1:51 PM

  • Need PL/SQL - Oracle Regular Expressions help

    Hi all,
    I have to create script some schema in oracle database to update our SVN. And after create DDL scrip need to do some modification (Ex: add columns). Example as follows,
    After create table DDL original scripts as follows,
    --table format 1
    CREATE TABLE "USER"."TABLE1"
            "COLUMN1"   NUMBER,
            "COLUMN2"   NUMBER,
            "COLUMN3"   NUMBER,
            "COLUMN4"   VARCHAR2(20 BYTE),
            PRIMARY KEY ("COLUMN1") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "T1" ENABLE
        PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
            INITIAL 35651584 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE1_COLUMN2" ON "USER"."TABLE1"
            "COLUMN2"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE1_COLUMN3" ON "SPIDERP4"."TABLE1"
            "COLUMN3"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 458752 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    --table format 2
    CREATE TABLE "USER"."TABLE2"
            "COLUMN1"  NUMBER,
            "COLUMN2"  NUMBER,
            "COLUMN3"  NUMBER,
            "COLUMN4"  VARCHAR2(20 BYTE)
        PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
            INITIAL 35651584 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE2_COLUMN1" ON "USER"."TABLE2"
            "COLUMN1"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE2_COLUMN2" ON "SPIDERP4"."TABLE2"
            "COLUMN2"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 458752 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    I need to include following amendment to above table scripts (expecting results),
    --1
    CREATE TABLE "USER"."TABLE1"
            "COLUMN1"   NUMBER,
            "COLUMN2"   NUMBER,
            "COLUMN3"   NUMBER,
            "COLUMN4"   VARCHAR2(20 BYTE),
            _*"COLUMN5"   NUMBER(3,0) DEFAULT 0,*_
            PRIMARY KEY ("COLUMN1") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "T1" ENABLE
        PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
            INITIAL 35651584 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE1_COLUMN2" ON "USER"."TABLE1"
            "COLUMN2"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE1_COLUMN3" ON "SPIDERP4"."TABLE1"
            "COLUMN3"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 458752 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    --2
    CREATE TABLE "USER"."TABLE2"
            "COLUMN1"  NUMBER,
            "COLUMN2"  NUMBER,
            "COLUMN3"  NUMBER,
            "COLUMN4"  VARCHAR2(20 BYTE),
            _*"COLUMN5"  NUMBER(3,0) DEFAULT 0*_
        PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
            INITIAL 35651584 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE2_COLUMN1" ON "USER"."TABLE2"
            "COLUMN1"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    CREATE INDEX "USER"."TABLE2_COLUMN2" ON "SPIDERP4"."TABLE2"
            "COLUMN2"
        PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
            INITIAL 458752 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
        TABLESPACE "T1" ;
    /Note:
    I need solution apart from these conditions,
    1)Table cannot be modify before create DDL (DDL creating using this method “dbms_metadata.get_ddl” ).
    2)This is automated processes manual modification cannot be allow.
    3)We cannot hard-coded any Dynamic Values because above create DDL table just for explain my question.(**note : “PCTFREE” ,” PRIMARY KEY”, “),”.... above values can be hard-coded**)
    Thanks
    Tharindu Dhaneenja
    Edited by: Dhaneenja on Mar 14, 2011 11:16 PM
    Edited by: Dhaneenja on Mar 14, 2011 11:17 PM
    Edited by: BluShadow on 15-Mar-2011 09:08
    Added {noformat}{noformat} tags                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    not very safe code to do what you are looking for...
    =================test data========================
    SET ECHO ON FEED OFF LIN 2000 PAGES 9999  LONG 1000000 LONGC 1000 TRIMS ON;
    EXEC DBMS_METADATA.SET_TRANSFORM_PARAM( DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
    DROP USER u CASCADE;
    GRANT DBA TO u IDENTIFIED BY u;
    CREATE TABLE u.t1
       c1   NUMBER,
       c2   NUMBER,
       c3   NUMBER,
       c4   NUMBER,
       PRIMARY KEY (c1)
    CREATE TABLE u.t2
       c1   NUMBER,
       c2   NUMBER,
       c3   NUMBER,
       c4   NUMBER
    CREATE TABLE u.t3
       c1   NUMBER NOT NULL,
       c2   NUMBER,
       c3   NUMBER
    CREATE TABLE u.t4 (c1 NUMBER    REFERENCES u.t1);
    CREATE TABLE u.t5 (c1 NUMBER UNIQUE);
    CREATE TABLE u.t6 (c1 NUMBER CHECK (c1 > 0));
    CREATE TABLE u.t7 (c1 NUMBER NOT NULL);=================query========================
    SELECT CASE
              WHEN (SELECT COUNT (*)
                      FROM dba_tab_columns tc
                     WHERE tc.owner = o.owner AND tc.table_name = o.object_name) >
                      0
              THEN
                 SUBSTR (
                    DBMS_METADATA.get_ddl (object_type, object_name, owner),
                    1,
                    INSTR (
                       DBMS_METADATA.get_ddl (object_type, object_name, owner),
                       CHR (10),
                       1,
                       2
                       + (SELECT COUNT (*)
                            FROM dba_tab_columns tc
                           WHERE tc.owner = o.owner
                                 AND tc.table_name = o.object_name)))
                 || CASE
                       WHEN (SELECT COUNT (*)
                               FROM sys.obj$ so,
                                    sys.cdef$ scd,
                                    sys.con$ sc,
                                    sys.user$ su
                              WHERE     su.user# = so.owner#
                                    AND so.obj# = scd.obj#
                                    AND scd.con# = sc.con#
                                    AND so.obj# = scd.obj#
                                    AND scd.type# != 7
                                    AND so.name = o.object_name
                                    AND su.name = o.owner) = 0
                       THEN
                          ',column5 number(3,0) default 0'
                       ELSE
                          'column5 number(3,0) default 0,'
                    END
                 || SUBSTR (
                       DBMS_METADATA.get_ddl (object_type, object_name, owner),
                       INSTR (
                          DBMS_METADATA.get_ddl (object_type, object_name, owner),
                          CHR (10),
                          1,
                          2
                          + (SELECT COUNT (*)
                               FROM dba_tab_columns tc
                              WHERE tc.owner = o.owner
                                    AND tc.table_name = o.object_name)))
              ELSE
                 DBMS_METADATA.get_ddl (object_type, object_name, owner)
           END
              t
      FROM dba_objects o
    WHERE owner = 'U';=================output========================
      CREATE TABLE "U"."T1"
       (    "C1" NUMBER,
            "C2" NUMBER,
            "C3" NUMBER,
            "C4" NUMBER,
    column5 number(3,0) default 0,
             PRIMARY KEY ("C1")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      TABLESPACE "USERS"  ENABLE
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;
      CREATE UNIQUE INDEX "U"."SYS_C0025504" ON "U"."T1" ("C1")
      PCTFREE 10 INITRANS 2 MAXTRANS 255
      TABLESPACE "USERS" ;
      CREATE TABLE "U"."T3"
       (    "C1" NUMBER NOT NULL ENABLE,
            "C2" NUMBER,
            "C3" NUMBER
    ,column5 number(3,0) default 0
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;
      CREATE TABLE "U"."T4"
       (    "C1" NUMBER,
    column5 number(3,0) default 0,
             FOREIGN KEY ("C1")
              REFERENCES "U"."T1" ("C1") ENABLE
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;
      CREATE TABLE "U"."T2"
       (    "C1" NUMBER,
            "C2" NUMBER,
            "C3" NUMBER,
            "C4" NUMBER
    ,column5 number(3,0) default 0
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;
      CREATE TABLE "U"."T5"
       (    "C1" NUMBER,
    column5 number(3,0) default 0,
             UNIQUE ("C1")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      TABLESPACE "USERS"  ENABLE
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;
      CREATE UNIQUE INDEX "U"."SYS_C0025507" ON "U"."T5" ("C1")
      PCTFREE 10 INITRANS 2 MAXTRANS 255
      TABLESPACE "USERS" ;
      CREATE TABLE "U"."T6"
       (    "C1" NUMBER,
    column5 number(3,0) default 0,
             CHECK (c1 > 0) ENABLE
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;
      CREATE TABLE "U"."T7"
       (    "C1" NUMBER NOT NULL ENABLE
    ,column5 number(3,0) default 0
       ) SEGMENT CREATION DEFERRED
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "USERS" ;

  • Query help in regular expression

    Hi all,
    SELECT * FROM emp11
    WHERE INSTR(ENAME,'A',1,2) >0;
    Please let me know the equivalent query using regular expressions.
    i have tried this after going through oracle regular expressions documentation.
    SELECT * FROM emp11
    WHERE regexp_LIKE(ename,'A{2}')
    Any help in this regard would be highly appreciated .
       Thanks,
    P Prakash

    please go here
    Introduction to regular expressions ...
    Thanks,
    P Prakash

  • Changeparticular characters in a string by using regular expressions ...

    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you

    SSU wrote:
    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you
    SQL> SELECT
      2  regexp_replace('sdfsdf Sdfdfs Sdfd','s|S','X') from dual;
    REGEXP_REPLACE('SD
    XdfXdf XdfdfX XdfdRegards,
    Achyut

  • IR filter using "matches regular expression"

    Hi,
    I am familiar with Perl regular expressions, but I'm having trouble using the IR filter by regular expression in Apex.
    For instance, I would like to search for dates of format 'MM/DD/YY' - can someone tell me how this would be done? I tried '[0-9](2)/[0-9](2)/[0-9](2)' and many other patterns to no avail.
    Also can you point me to a good thread for regular expressions in Apex?
    Thanks for any help.

    Hi,
    you can play around with oracle regular expressions at
    http://www.yocoya.com/apex/f?p=YOCOYA:REGEXP_HOME:0:
    It's an Apex application, albeit "seasoned", where you can build and test the regex and it will be 100% compatible as it runs natively, so it's not simulated on a different platform.
    Most likely the IR filter will make use of REGEXP_LIKE so you can pick that function from the menu.
    Flavio
    http://oraclequirks.blogspot.com
    http://www.yocoya.com

  • Regular expression - Replace not like

    Hi All,
    Is there a regexp pattern to replace anything other than 'oracle' from the below string.
    "oracle sdsd oracle xyd fgh oracle idmdh asasas trtrt"
    The result will be "oracleoracleoracle"
    If I want to write like regexp_replace('oracle sdsd oracle xyd fgh oracle idmdh asasas trtrt',<pattern>), what should be the pattern?
    I know how to get the result by nesting regexp and other functions.
    But is there any single pattern for this?
    Thanks in advance.
    Note; This is not a business requirement, trying to learn regexp..

    884476 wrote:
    Could you please explain what does that pattern mean? We can look at your string as a sequence of substrings where each substring is set of characters (part A) followed by word oracle or, in last substring, by end-of-line (part B). Each of such substrings be want to replace with part B thus removing part A.
    Dot (.) means any character. Asterisk (*) means repeated 0 or more times. This is our part A (I'll get back to ? later). Pipe (|) means OR. Dollar sigh ($) means end-of-line. Parenthesis mean grouping. So ((oracle)|$) means string oracle or end-of line. This is our part B. Now back to question mark. By default Oracle regular expressions are "greedy". We say any character repeated any number of times followed by word oracle. Since word oracle itself matched definition of any character repeated any number of times (6 in this case) regexp will match it that way that it will be from the beginning of the string to last occurrence of word oracle - that's why it is called "greedy". Question mark (?) tells regexp not to use greedy matching, therefore '.*?oracle' will stop at first occurrence of word oracle. Now replacement string. Notation \1 is grouping backreference. Group 1 is ((oracle)|$) and, as I already noted, means string oracle or end-of line (whichever was found).
    SY.

  • Oracle Database Express Edition 10g Download Issue

    Hi everyone. I just downloaded the freeware Oracle Database Express Edition without any apparent problems. However, when I attempt to go to the Express Edition Homepage, which is location http://127.0.0.1:8080/apex,
    I get the message that my Internet Explorer cannot display the webpage. (It can, however, display other pages.) I cannot understand why this is the case since I successfully added Web site 127.0.0.1 in my Control Panel (as specified in the instructions.) Also, the instructions stated that HTTP port 8080 was the default port, unless my system said that this was not available (which it did not.) I also tried rebooting, which did not make a difference. Help!
    Thanks,
    Jason

    user13176791 wrote:
    Hi everyone. I just downloaded the freeware Oracle Database Express Edition without any apparent problems. However, when I attempt to go to the Express Edition Homepage, which is location http://127.0.0.1:8080/apex,
    I get the message that my Internet Explorer cannot display the webpage. (It can, however, display other pages.) I cannot understand why this is the case since I successfully added Web site 127.0.0.1 in my Control Panel (as specified in the instructions.) Also, the instructions stated that HTTP port 8080 was the default port, unless my system said that this was not available (which it did not.) I also tried rebooting, which did not make a difference. Help!There is a forum dedicated to Express Edition, in which we have discussed a lot of the variants in failure that causes this problem. At the top of the page you are reading, there should be links like "Forum Home » Database » Database - General". The middle one will get you to a list of all Oracle forums and after the first 5, the rest are alphabetical - XE is pretty far down that page.
    (You might also note that there is an Installation forum next to this one. That might be better suited to the task than the 'catch-all' general forum.)
    The most common issues are related to not preparing the operating system properly. For example, if you use a laptop you probably use DHCP to get a different address from the various sites you connect to. However, Oracle works as a server and depends on having a well known address. In fact, it tends to bind the IP address at install into it's configuration files. Therefore it is critical to use the loopback adapter in such situations.
    Other issues are dependent on the actual OS into which you install. For example, Ubuntu (Linux) has very differnet install philosophy as Red Hat / Fedora, and requires a different install technique. Then again, on Windows, it is nearly impossible to install anything Oracle on a Windows 'Home' OS, and XE generally has not even been tested against Windows 7.
    Other common reasons include anti-virus; firewall; not having appropriate operating system level permissions; in Windows - using a Domain-based userid instead of a local administrator; and just general finger issues.
    Express is considerably different in the install behaviour and runtime behaviour. For example. it uses RPM and MSI instead of Oracle Universal Installer. It does not include Java in the database, which limits a lot of functionality. And it uses the built-in PL/SQL Web Gateway instead of any external HTTP server. As a result, it can be quite a shock to mmany of the regular inhabitants in this forum.
    I strongly encourage reading the documentation for XE. In particular, reading the install doc. Start at http://tahiti.oracle.com and look for the Oracle Database 10g Release 2 Express Edition documentation. (Just below the Oracle Database 10g Release 2 documentation.)
    G'luk

Maybe you are looking for

  • Remote not working with new Mac Book Pro

    Had my 2.16 MBP for 2 days and cannot get the remote to work. The IR is not disabled, but I cannot select the UNPAIR option so I am guessing the remote is not paired with the MBP. I am pressing the Menu and FFD button, but nothing appears to happen.

  • Regarding standard report changes !!!

    Hi Every One , I am new to FI module ABAP Support ,Can any one tell me the procedure to modify the standard report    " FAGLL03 ".. My requirement is to add the vendor field in the output, from which table i have to retrieve this and hw to modify the

  • IMac & System Software Problem: FontBook

    Dear Apple and to whom this may concern, My name is Ramen/Sameul either name would do, my problem here is that my iMac doesn't have the Application called FontBook forsome reason. I really want to install fonts because I am wanting to become some kin

  • New Gateway desktop monitor blacks out, but power's on...

    Anyone have a clue why a brand new monitor would go black shortly after it's turned on?  We're on the illiterate side of computer stuff, so any tips would be helpful.  Waiting on Geek Squad to call back...and waiting...

  • Blank Line in Webform

    Hello Planning Guru's, how is it possible to insert a blank line in the webform in planning? Many thanks, whitebaer