Viva,
I need to search strings within a long field that is, make a select using the like.
Is it possible to do this in a LONG field?
Thanks
Is there a way to use Like in a Long field?
-
- Rank: Programador Sênior
- Posts: 49
- Joined: Mon, 13 Oct 2008 9:01 am
- Location: Lisboa
- fsitja
- Rank: OraSauro
- Posts: 611
- Joined: Mon, 19 Jan 2009 4:29 pm
- Location: Gaúcho no Rio de Janeiro - RJ
"The scars exist to remind us that the past was real"
Campanha: Como fazer uma pergunta e obter uma resposta.
http://tkyte.blogspot.com/2005/06/how-t ... tions.html
OCA & OCP Developer — OCE SQL Expert — OCS Data Warehousing Specialist
Campanha: Como fazer uma pergunta e obter uma resposta.
http://tkyte.blogspot.com/2005/06/how-t ... tions.html
OCA & OCP Developer — OCE SQL Expert — OCS Data Warehousing Specialist
It is not possible, firing an error or-00932.
Inclusive it is recommended that no more long types in the new oracle versions because this will be discontinued. Replace by BLOB if you are feasible and the varchar2 does not serve you.
http://www.techonthenet.com/oracle/errors/ora00932.php
Inclusive it is recommended that no more long types in the new oracle versions because this will be discontinued. Replace by BLOB if you are feasible and the varchar2 does not serve you.
http://www.techonthenet.com/oracle/errors/ora00932.php
- fsitja
- Rank: OraSauro
- Posts: 611
- Joined: Mon, 19 Jan 2009 4:29 pm
- Location: Gaúcho no Rio de Janeiro - RJ
"The scars exist to remind us that the past was real"
Campanha: Como fazer uma pergunta e obter uma resposta.
http://tkyte.blogspot.com/2005/06/how-t ... tions.html
OCA & OCP Developer — OCE SQL Expert — OCS Data Warehousing Specialist
Campanha: Como fazer uma pergunta e obter uma resposta.
http://tkyte.blogspot.com/2005/06/how-t ... tions.html
OCA & OCP Developer — OCE SQL Expert — OCS Data Warehousing Specialist
Oh yeah, pretend it was TYPO! : roll:
- dr_gori
- Moderador
- Posts: 5024
- Joined: Mon, 03 May 2004 3:08 pm
- Location: Portland, OR USA
- Contact:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Remember that in dbms_lob has some functions that can help, such as dbms_lob.instr, dbms_lob.substr ...
These can "simulate" a like ...
These can "simulate" a like ...
-
- Rank: Programador Sênior
- Posts: 49
- Joined: Mon, 13 Oct 2008 9:01 am
- Location: Lisboa
Live again.
I spent the Long Clob field to be able to use the like, but now needed to change again for Long and I can not.
The question, is there a way to pass a cloze field for Long?
Thanks.
Greetings.
I spent the Long Clob field to be able to use the like, but now needed to change again for Long and I can not.
The question, is there a way to pass a cloze field for Long?
Thanks.
Greetings.
-
- 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
Brother,
Doing alter returning I believe it is not possible. I made some tests here and I could not.
Create it as Long (I am using version 9i) is possible yes, however, after changed, you can not return to the original datatype.
may be any Oracle Feature , which no longer allows you to use this type of data in some bank versions (would need to take a more calm search).
But to be sure, I did the tests below:
a tip: I do not know the Your structure and complexity of your table, but if you are obligatoryly to need this type of data again (as informed by Dr_Gori, if other datatypes do not satisfy your need), give a drop on your table (saving information before) and recreate This datatype you will probably get.
If you can not give a Drop in the table, create another column in this table, type long , give a update of the values ??of the CloB Pro Long field and then drop this cloble column.
There is the Brother tip.
Anything, send us to us.
Doing alter returning I believe it is not possible. I made some tests here and I could not.
Create it as Long (I am using version 9i) is possible yes, however, after changed, you can not return to the original datatype.
may be any Oracle Feature , which no longer allows you to use this type of data in some bank versions (would need to take a more calm search).
But to be sure, I did the tests below:
CREATE TABLE teste (cod NUMBER(10), descricao LONG);
SELECT *
FROM teste;
ALTER TABLE teste MODIFY descricao CLOB;
SELECT *
FROM teste;
ALTER TABLE teste MODIFY descricao LONG;
-- ORA-22859: invalid modification of columns
If you can not give a Drop in the table, create another column in this table, type long , give a update of the values ??of the CloB Pro Long field and then drop this cloble column.
There is the Brother tip.
Anything, send us to us.
You can create a function to convert the field.
then use it at Query:
CREATE OR REPLACE FUNCTION get_search_condition
(
p_owner all_constraints.owner%TYPE,
p_constraint_name all_constraints.constraint_name%TYPE
) RETURN VARCHAR2 IS
v_long LONG;
BEGIN
SELECT search_condition
INTO v_long
FROM all_constraints
WHERE constraint_name = p_constraint_name
AND owner = p_owner
AND constraint_type = 'C';
RETURN substr(v_long, 1, 32760);
END;
SELECT constraint_name,
get_search_condition(owner, constraint_name) AS search_condition
FROM all_constraints
WHERE owner = 'MYSCHEMA'
AND table_name = 'MYTABLENAME'
AND constraint_type = 'C'
AND get_search_condition(owner, constraint_name) = 'TEXT_SEARCH';
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest