Limited consultation.

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
thiago.segantini
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Fri, 05 Jun 2015 9:42 am

Good morning guys.

I have the following situation:

[color=# 40bfff] Contents of the field DS_LOUDO [/color]
Clinical criteria
The patient did not present symptomatology of coronary insufficiency.
Interrupted test due to exhaustion in a 44ml / kg.min VO2 and 13METS.

ECG comments and pre-effort
Sinus rhythm. Within the norms of normality.

Conclusion

Sub-maximum ergometric test (100% of FC Max.) No ischemic changes to the present examination.
physiological tension response to effort.
Physiological chronotropic response to effort.
Absence of significant arrhythmias during the examination.
Good cardiorespiratory fitness.


I need to return to the SQL query only the lines that are below the word "conclusion", but I did not find a way to limit this query.

The field that provides this data is of the LONG type.

Select all

SELECT DS_LAUDO FROM  
( SELECT DS_LAUDO FROM LAUDO_PACIENTE 
where nr_atendimento = 3037270 
ORDER BY dbms_random.value ) 
WHERE rownum =1 
I can not limit that the lines should appear only after the word completion.

Thanks from now!
User avatar
tiago_pimenta
Rank: DBA Júnior
Rank: DBA Júnior
Posts: 217
Joined: Wed, 29 Jun 2011 9:49 am
Location: Barretos / SP

I think this can help you !!!

- Substr - https://docs.oracle.com/cd/B28359_01/ol ... s_2101.htm
thiago.segantini
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Fri, 05 Jun 2015 9:42 am

Hello friend
because my field is the long type the substr does not work.

Select all

SELECT SUBSTR(DS_LAUDO, 1, 40)  
FROM LAUDO_PACIENTE  
WHERE NR_ATENDIMENTO = 3037270
[color=# FF0000] Error: ORA-00932: Inconsistent data types: Hoped Char obteve long. [/color]
nelson.anchite
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 15
Joined: Tue, 07 Oct 2014 10:24 am
Contact:

Since it was suggested the substr for you and you could not use with LOB, try the substr of the dbms_lob package.
http://docs.oracle.com/cd/B19306_01/app ... m#i1016916

I hope it helps, take a look at other functions of this package as well.
Hugs.
nelson.anchite
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 15
Joined: Tue, 07 Oct 2014 10:24 am
Contact:

Or also take a look at this forum link.
http://en.glufke.net/oracle/viewtopic.php?t=3452
DanielNN
Moderador
Moderador
Posts: 641
Joined: Mon, 03 Sep 2007 3:26 pm
Location: Fortaleza - CE
att,

Daniel N.N.

Next,

a possibility is using PLSQL.
My suggestion is to create a function that will make validation whether or not the desired name exists.
Within your SQL you make use of this function to filter your records.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests