Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Posts
    5

    Unanswered: pl/sql(help me please)

    I have a problem.
    When I read from a file I must respect the folowing rules:

    The only characters admited are :

    Number: from 0 till 9
    Alphanumeric:
    Blank and A....Z (capital letters).
    (The not capital letters and the letters with accent are deleted.)
    The special letters: ! % $ & ( ) * +, - . / : ; < = > ?
    All the others characters will be replaced by blanks.


    How could I realise,easily this thing.
    Yours,
    Virginia

  2. #2
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    So, what have you done so far ?

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    A hint, check out translate function
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Dec 2003
    Posts
    1,074
    I don't know if it's available in versions prior to 10g, but you could do something like:

    Code:
    create table t (f varchar2(5))
    table created.
    
    insert into t values ('1aA!>')
    1 row created.
    
    select regexp_replace(regexp_replace(f, '[a-z]', ''), '[^[:alnum:]]', ' ') as f1
    from t
    
    F1                                                                              
    -----
    1A                                                                              
    
    1 row selected.
    The inner regexp_replace() replaces all lowercase letters with a zero-length text string, and the outer replaces all non-alphanumeric characters with a space.

    -Chuck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •