Conversion

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Fri, 11 Apr 2008 8:48 pm

Well Let's Have a field with the following fields: field to 2126302240 2133445 = 2334567898 21233456F-2144566 = 5 need an oracle function q me makes it return only the numbers of Field a. is there any function defined in Oracle able to do this, if the answer if yes which?

:-o
filipe009
Location: Niterói - RJ

Poston Sat, 12 Apr 2008 2:36 pm

Dear Philip, if you have a bank 10 g, can use the REGEXP_SUBSTR function.

Example: select REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 1) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 2) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 3) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 4) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 5) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 6) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 7) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 8) + ||+ REGEXP_SUBSTR (' FieldA ', ' [[:d igit:]] + ', 1, 9) from the chart;

I couldn't find a simpler solution to this, but at least she works with up to 9 sequences of numbers into a string
Marlon Costa
Location: Salvador - BA

Saudações

Marlon Costa (marlonsc@conit.com.br)
DBA Sênior - Oracle OCP DB 9i e 10g, OCA AS 9i
CONIT - http://www.conit.com.br - Salvador - BA
Conectando Inteligência e Tecnologia

Poston Mon, 14 Apr 2008 9:09 am

Topic moved to the SQL .
Trevisolli
Location: Araraquara - SP

Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP



Return to SQL

Who is online

Users browsing this forum: No registered users and 2 guests