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.
4 4714 Saii 145
Expert 100+
try in-built function TRANSLATE
[quote=Saii]try in-built function TRANSLATE[/QUOT
my table name is alphnumer
can u give me full query plz(total 'select' statement).
[quote=venkataramana22]
try in-built function TRANSLATE[/QUOT
my table name is alphnumer
can u give me full query plz(total 'select' statement).
-
-
DECLARE
-
CURSOR C1 IS SELECT * FROM alphnumer;
-
v_num VARCHAR2(100) := NULL;
-
v_char VARCHAR2(100) := NULL;
-
v_length NUMBER := 0;
-
v_asc_val NUMBER := 0;
-
BEGIN
-
FOR I IN C1 LOOP
-
IF(C1%FOUND) THEN
-
v_length := LENGTH(I.mixed);
-
FOR J IN 1..v_length LOOP
-
v_asc_val:= ASCII(SUBSTR(I.mixed,J,1));
-
--DBMS_OUTPUT.PUT_LINE(SUBSTR(I.mixed,J,1));
-
IF (v_asc_val >= 97 AND v_asc_val <= 122) THEN
-
v_char:= TO_CHAR(v_char||SUBSTR(I.mixed,J,1));
-
ELSE
-
v_num:= TO_CHAR(v_num||SUBSTR(I.mixed,J,1));
-
END IF;
-
END LOOP;
-
DBMS_OUTPUT.PUT_LINE(v_num||','||v_char);
-
v_num:=NULL;
-
v_char:= NULL;
-
END IF;
-
END LOOP;
-
END;
-
-
The above block is to seperate the numbers and alphabets from a single column...hope this helps!!
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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>
...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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,...
|
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$) {
}
...
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
| |