473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

separate numeric and non-numeric values from alphanumeric

venkataramana22
have column named "mixed"
data in that column is like..

12acdf45
534fdfddy5
gfg56789
fgas636382

So, i wld like to retrieve only numericals from those OR
only characters..
the result should be either -- 1245,5345... or
acdf,fdfddy,gfg
i need a query to this retreval of data.
Apr 4 '07 #1
4 4714
Saii
145 Expert 100+
try in-built function TRANSLATE
Apr 4 '07 #2
[quote=Saii]try in-built function TRANSLATE[/QUOT

my table name is alphnumer
can u give me full query plz(total 'select' statement).
Apr 5 '07 #3
amitpatel66
2,367 Expert 2GB
[quote=venkataramana22]
try in-built function TRANSLATE[/QUOT

my table name is alphnumer
can u give me full query plz(total 'select' statement).
Expand|Select|Wrap|Line Numbers
  1.  
  2. DECLARE
  3. CURSOR C1 IS SELECT * FROM alphnumer;
  4. v_num VARCHAR2(100) := NULL;
  5. v_char VARCHAR2(100) := NULL;
  6. v_length NUMBER := 0;
  7. v_asc_val NUMBER := 0;
  8. BEGIN
  9. FOR I IN C1 LOOP
  10. IF(C1%FOUND) THEN
  11. v_length := LENGTH(I.mixed);
  12. FOR J IN 1..v_length LOOP
  13. v_asc_val:= ASCII(SUBSTR(I.mixed,J,1));
  14. --DBMS_OUTPUT.PUT_LINE(SUBSTR(I.mixed,J,1));
  15. IF (v_asc_val >= 97 AND v_asc_val <= 122) THEN
  16. v_char:= TO_CHAR(v_char||SUBSTR(I.mixed,J,1));
  17. ELSE
  18. v_num:= TO_CHAR(v_num||SUBSTR(I.mixed,J,1));
  19. END IF;
  20. END LOOP;
  21. DBMS_OUTPUT.PUT_LINE(v_num||','||v_char);
  22. v_num:=NULL;
  23. v_char:= NULL;
  24. END IF;
  25. END LOOP;
  26. END;
  27.  
  28.  
The above block is to seperate the numbers and alphabets from a single column...hope this helps!!
Apr 6 '07 #4
have column named "mixed"
data in that column is like..

12acdf45
534fdfddy5
gfg56789
fgas636382

So, i wld like to retrieve only numericals from those OR
only characters..
the result should be either -- 1245,5345... or
acdf,fdfddy,gfg
i need a query to this retreval of data.

select replace(translate('12acdf45534fdfddy5gfg56789fgas6 36382','abcdefghijklmnopqrstuvwxyz','~'),'~','') from dual

select replace(translate('12acdf45534fdfddy5gfg56789fgas6 36382','0123456789','~'),'~','') from dual
May 21 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: anonymous | last post by:
with X Y separate dual-bus super sub , maybe reverse by freq Y is super-bus X or Y maybe set to internal base ( default ) X@ X! Y@ Y! ( top of stack X@ y@ --> TOS ) >X >X >Y Y> intelligent...
2
by: LM | last post by:
Hi, Assume I have a java.awt.Frame running in my main Thread. This frame is the main UI for my application. Is it possible for this application to create a second frame in a completely separate...
8
by: nickdu | last post by:
I'm trying to isolate "applications" into their own application domain within a single process. I've quoted applications because it's a logical representation of an application. Basically it...
24
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> ...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
48
by: phillip.s.powell | last post by:
MySQL 3.23.58 - 4.0.17 (yep, several database server instances, don't ask) I have database Spring with table Students I have database Summer with table Students I am tasked to produce a...
3
by: LurfysMa | last post by:
I would like to hear opinions on the tradeoffs of putting the tables, forms, and queries for several related datasets in separate databases vs one combined database. I am working on an...
2
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is...
4
by: John Goche | last post by:
Hello, I have been going through several header source files which define classes with inline functions. In the case where the inline functions are not defined in place, the inline functions...
15
by: bruno.desthuilliers | last post by:
On 27 juin, 18:09, "John Salerno" <johnj...@NOSPAMgmail.comwrote: For which definitions of "content" and "logic" ??? The point of mvc is to keep domain logic separated from presentation logic,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.