Good evening!
I need to get a data, but in the field I have other recorded information, and what "separates" this information is the comma. I want to pick up only what appears after the comma.
Thus:
'Example, test'
I want only the 'test' value ... The content until the virgulum is variable, so I can not use The substr.
Please, how could you do it?
: Roll:
Thank you!
Search value in the field after a character
-
- Moderador
- Posts: 2016
- Joined: Wed, 12 Jan 2005 3:25 pm
- Location: Araraquara - SP
Abraço,
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Thati, try this code:
Whatever it sends there.
DECLARE
v_string VARCHAR2(50) := 'Paulo;Trevisolli';
BEGIN
dbms_output.put_line(' Depois do ponto e virgula : ' || SUBSTR(v_string,INSTR(v_string,';')+1,11));
END;
-
- Rank: Analista Sênior
- Posts: 147
- Joined: Thu, 16 Mar 2006 11:26 am
- Location: São Paulo
O mundo gira muito!!
Speak thatifc,
Good afternoon,
So, make a selection of the column you need !!
Create a spool C: \ test.txt on SQLPlus and then open in Excel, separating by virgins from the Tools menu, importing external data, Deee you put the tab by ",": LOL:
any things, post here in the forum!
abs hahu
Good afternoon,
So, make a selection of the column you need !!
Create a spool C: \ test.txt on SQLPlus and then open in Excel, separating by virgins from the Tools menu, importing external data, Deee you put the tab by ",": LOL:
any things, post here in the forum!
abs hahu
-
- Rank: Estagiário Sênior
- Posts: 9
- Joined: Wed, 06 Jun 2012 4:48 pm
I have a very similar question:
In your case you searched for the second item of the "list", but if I had more than two items and wanted to seek only the second? Because the way you did it will return everything after the second.
This will return: "Test, Example2"
How could I do to seek only the test?
In your case you searched for the second item of the "list", but if I had more than two items and wanted to seek only the second? Because the way you did it will return everything after the second.
Select Substr('Exemplo,Teste, Exemplo2', Instr('Exemplo,Teste,Exemplo2', ',')+1)
From Dual
How could I do to seek only the test?
- adrianoturbo
- Moderador
- Posts: 393
- Joined: Thu, 20 Mar 2008 4:09 pm
- Location: Brasília
Adriano Alves
---Para cada problema dificil existe uma solução simples.----
---Para cada problema dificil existe uma solução simples.----
Ironijunior, just adjust the string incrementator, follow the example:
SQL> SELECT SUBSTR('Exemplo,Teste,Exemplo2',+9,5) FROM DUAL;
SUBST
-----
Teste
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests