PL/SQL :: Searching Text Clobs From User_views?

Jul 22, 2013

I needed to search for some specific text in the DDL of each of the views in a particular schema. The text column of the user_views is LONG, and I looked at some old Tom's threads for converting long2clob, but found these processes to be really cumbersome, so I just opted to use DBMS_METADATA.GET_DDL instead even if it is a little slow.

One area I do not have a lot of experience with is searching clob fields. I tried this but not sure what would be the appropriate function to use for something like this:

SELECT *
FROM
(

[Code]....

WHERE contains(object_text, 'WHERE t.policy NOT LIKE') > 0; -- Show the names of all views that contain the matching text

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: Searching Collection For A Specific Value?

Oct 18, 2011

I need to check if a small collection contains a specific value. I know I can use the .exist method to let me know if the nth element exists. But is there a similar syntax for checking if an actual value exists?

So the below collection has 6 values (300,301,310,320,400,410) after the cursor values are fetched. I want to use something similar to the below exists syntax in order to search the collection for a value (rather than position) within an IF statement.

The below code shows the kind of thing I want to do. Currently, unless my test value (310) is in the range 1 to 6 the test will always return FALSE. But is there a similar syntax for testing against the value?

The example I have given is a simplification of what I need. In reality there will be more than one test value... returned by another cursor.

DECLARE
CURSOR c_type_id_usg
IS

[Code]....

-- get the list of sms type id usg values
OPEN c_type_id_usg;
FETCH c_type_id_usg bulk collect into l_type_ids;
CLOSE c_type_id_usg;

-- the above returns value 300,301,310,320,400,410

IF l_type_ids.exists(310)
then
dbms_output.put_line('I have found an entry ');
else
dbms_output.put_line('I have NOT found an entry ' );
end if;
END;

View 2 Replies View Related

SQL & PL/SQL :: Searching For A String In Whole Database

Aug 16, 2012

I've tried to write the procedure for search the string from whole database. If user give the string as an input the output will be tablename and column in which the string contained in the table,But it's showing an error .

CREATE OR REPLACE procedure sample.pr_search_table (p_search varchar )
is
type tb_type is table of varchar(30);
tb_table tb_type:= tb_type();
tb_column tb_type := tb_type();
v_temp varchar(30);
[code]...

View 6 Replies View Related

SQL & PL/SQL :: Searching City Name From Address

Apr 16, 2010

I want to write a SQL statement to search valid city name from address field. Valid city names are in one table and address column is in another table.

View 5 Replies View Related

PL/SQL :: Searching String In A Table

Sep 9, 2013

I am using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production. 

I have a situation where I need to find the number of occurrences of a string that is present in a table having comma separated values. To explain with an example:  

create table test_data ( textfield varchar2(100)); 
insert into test_data values('DM,HM'); 
insert into test_data values('EM'); 
insert into test_data values('AM,CA,CD,FM,ST'); 
insert into test_data values('LS');
  insert into test_data values('TQ,SP,AM,FM,ST,CA,CD'); 
insert into test_data values('TQ,SP,AM,FM,ST,CA,CD,LS'); 
insert into test_data values('DM,HM,LS');

 The data in the table test_data looks like  DM,HMEMAM,CA,CD,FM,STLSTQ,SP,AM,FM,ST,CA,CDTQ,SP,AM,FM,ST,CA,CD,LSDM,HM,LS Now I need to search"LS" in the table test_data. Basically, I need to find if "LS" is present at least once in any of the rows or not. I want to avoid looping here. 

View 4 Replies View Related

SQL & PL/SQL :: Searching Numbers In Description Column?

Jun 15, 2010

I have two tables emp and dept

sql>select emp_id from emp;
emp_id
------
123
345
6782
32

[code].....

I would like to search all the employee id's which are present in description column of dept.

View 32 Replies View Related

SQL & PL/SQL :: Searching Data In Backup Tables

Apr 30, 2013

TEMP1--ORINIGAL TABLE NAME

DESC IS:

SNO NUMBER;
SNAME VARCHAR2(100);

BACK UP TABLES ARE

TEMP1_1;
TEMP1_2;
TEMP1_3;
.
.
.
.
.
TEMP1_10

IN THE ABOVE 11 TABLES SNAME COLUMN HAVING THE DATA AS 'NARESH'
IN SOME OF THE TABLES AND NOT IN OTHERS.

REQUIRMENT:

I WANT THE TABLES ONLY HAVING THE

SNAME COLUMN 'NARESH'.

View 7 Replies View Related

SQL & PL/SQL :: Use Of Index For Searching Data In Table

Mar 5, 2010

i want to know the use of index for searching data in table...tell answer to my query with table example....

View 2 Replies View Related

Tuning Searching Into Clob In Batch Operation?

Jul 3, 2012

My application runs a batch procedure weekly once for searching 'A_Text' from a column in Table1 in a clob column in Table2 and inserts accordingly into another Table3.

code snippet is like this -

---
CURSOR cr_sn
IS
SELECT serial_number

[Code]....

TABLE1 will have at least 1.1 Million rows but not significantly more than this.

This procedure takes 24+ hours to complete. I tried -

1. putting parallel hint ( INSERT /*+ PARALLEL*/INTO Table3)

2. partitioning TABLE2 based on last_update_date and putting a where clause in the above query last_update_date ( last_update_date between date1 and date2)

View 3 Replies View Related

Forms :: Creating Searching Tool Using Oracle 6i?

Nov 26, 2012

I have created searching tool using oracle forms 6i. while searching the cursor move from text field (A) to other block query the data according to the field (A) and come back again to field (A). Everything is working fine but the problem is, when the cursor move back to the field (A) the existing text is highlighted and when user right something in it. It's overwriting the existing text.

I want when the cursor moving bank to the field (A) the text should not be highlighted and when the user writes something that will be added to the existing text.

View 1 Replies View Related

SQL & PL/SQL :: Insert Using String Matches / Matching And Searching Match

Jul 3, 2012

i have three tables ot_cut_head,ot_cut_det and om_mc_master based on which fourth table ot_cut_opr and fifth table ot_cut_mc must get populated , Conditions are as follows

first one is based on job_no in ot_cut_head the selection criteria will be filtered,if the job number is like '%M' then type MISC will be chosen ,if job number is '%G' then GRAT TYPE will be picked from om_mc_master (Machine Master) and operations and machines based on this will be filtered.

Second all the cd_ps_desc will be taken from ot_cut_det and will be compared with om_mc_master to get their corresponding operation codes and machine codes , there can be 2 operations or 1 operation.

Finally if the match is found record will be inserted into ot_cut_opr and ot_cut_mc ,based on the criterias and what i want is the search criteria to be more flexible and if there are 2 operations 2 rows will be inserted and if one opeation is defined in om_mc_master ,then only one record will be inserted.

We have to make sure that if based on operation number stage will be populated ,if its first operation then stage will be 1 and if its second operation the stage will be 2.like previous operation also depends on them , the second operation will have the previous operation as first operation and so on.

CREATE TABLE om_mc_master ( mc_type VARCHAR2(12),mc_prof VARCHAR2(30),mc_prep_cd1 VARCHAR2(30),mc_mach_cd1 VARCHAR2
(30),mc_prep_cd2 VARCHAR2(30),mc_mach_cd2 VARCHAR2(30));
INSERT INTO OM_MC_MASTER VALUES ('MISC','TEE SCH','IR','HO','RE','HO');
insert into om_mc_master values('MISC','Vertical Brace','R','HM','I','HO');
insert into om_mc_master values('MISC','Pipe','IR','HO',NULL,NULL);
INSERT INTO OM_MC_MASTER VALUES ('GRAT','PL','RE','HO',NULL,NULL);
SQL> SELECT * FROM OM_MC_MASTER;
[code]....

View 6 Replies View Related

SQL & PL/SQL :: Searching PRODUCT Column Based Upon User Input?

Apr 30, 2010

I have table in Oracle with one column PRODUCT. Column PRODUCT have following values -

Account Management
Active Directory
Adobe Acrobat Reader
NT Account
Application Security

[code]....

I am designing application where I need to search for PRODUCT based upon user's input. Lets say user wants search on 'Laptop Account Broken'. I want to search for all products which contains any of words in user's input. So based upon user's input I want output like below.

Expected Output:

Account Management
NT Account
WebSite Account
HP Laptop

View 2 Replies View Related

Stored Procedure For Searching Data From A Table By Passing Tablename As A Parameter

Feb 6, 2012

This procedure is not working properly.

create or replace procedure bank_search_sp
(
p_tablename in varchar2,
p_searchname in varchar2,
p_bankcode out varchar2,
p_bankname out varchar2,
p_dist_code out number
)
as
v_tem varchar2(5000);
begin
v_tem :='select bankcode,bankname,dist_code from ' || UPPER (p_tablename) || '
where bankname like '''|| p_searchname||'';
execute immediate v_tem into p_bankcode,p_bankname,p_dist_code using p_searchname ;
commit;
end bank_search_sp;

the Procedure is getting created but i dont know what actually happens when it was executed ,This is the error shown..ORA-01756: quoted string not properly terminated

ORA-06512: at "PENSIONS.BANK_SEARCH_SP", line 14
ORA-06512: at line 1

View 1 Replies View Related

Application Express :: Prefix Text Entered Into Text Area With Userid And Timestamp?

Sep 12, 2012

Have got basic form on a table and have a textarea which holds Notes added by user.

So Notes database field is updated on Save / Apply changes button being pressed.But would really like any text added / appended to the Notes field to be prefixed by userid and date / timestamp.

Is it possible via dynamic actions or Javascript to have any new text added / typed to be auto prefixed as per above.

Would only want the first key press in the filed to trigger the auto-prefix and if added text was deleted then the auto prefix to be deleted as well ?? If user doesn't press Save / Apply changes obviously want to leave existing Notes as is.

View 5 Replies View Related

Forms :: Is There Text Changed Trigger With Text Item Function

May 5, 2010

Is there text changed trigger with text item function like when_list_changed trigger of list item?

View 7 Replies View Related

Forms :: MS Word Rich Text Format In Text Item

Apr 17, 2012

Can I use rich text item on oracle form10G with some simple features like BOLD, UNDERLINE, ITALIC and if possible one more feature like spell check.

I Google my requirement, but mostly I found win word attachment. Further more if I can save this type of data in field then how can I print in report.

View 3 Replies View Related

Text :: Index Memory Parameter For Oracle Text Indexes

Sep 17, 2013

I am on Oracle 11.2.0.3 on Linux and have implemented Oracle Text.I created Oracle Text indexes with default setting. However in an oracle white paper I read that the default setting may not be right. Here is the excerpt from the white paper by Roger Ford:URL....(Part of this white paper below....)Index Memory.                                  

As mentioned above, cached $I entries are flushed to disk each time the indexing memory is exhausted. The default index memory at installation is a mere 12MB, which is very low. Users can specify up to 50MB at index creation time, but this is still pretty low. This would be done by a CREATE INDEX statement something like: CREATE INDEX myindex ON mytable(mycol) INDEXTYPE IS ctxsys.context PARAMETERS ('index memory 50M');  Allow index memory settings above 50MB, the CTXSYS user must first increase the value of the MAX_INDEX_MEMORY parameter, like this:  begin ctx_ adm. set_ parameter('max_index_memory', '500M'); end;  The setting for index memory should never be so high as to cause paging, as this will have a serious effect on indexing speed. On smaller dedicated systems, it is sometimes advantageous to temporarily decrease the amount of memory consumed by the Oracle SGA (for example by decreasing DB_CACHE_SIZE and/or SHARED_POOL_SIZE) during the index creation process.

Once the index has been created, the SGA size can be increased again to improve query performance." (End here from the white paper excerpt)My question is:

1) To apply this procedure (ctx_adm.set_parameter) required me to login as CTXSYS user. Is that right? or can it be avoided and be done from the application schema? This user CTXSYS is locked by default and I had to unlock it. Is that ok to do in production?

2) What is the value that I should use for the max_index_memory should it be 500 mb - my SGA is 2 GB in Dev/ QA and 3GB in production. Also in the index creation what is the value I should set for index memory parameter  - I had left that at default but how should I change now? Should it be 50MB as shown in example above?

3) The white paper also refer to rebuilding an index at some interval like once in a month:   ALTER INDEX DR$index_name$X REBUILD ONLINE; We are on Oracle 11g and the white paper was written in 2003.

View 5 Replies View Related

Forms :: Text Box To Accommodate Large External File Text

Dec 30, 2010

I have a requirement in one of my forms screen.I have a text box(large text area) which should display a help text file when i move my cursor on the topics displayed on the screen.know the code and the properties to be changed in the text box to accommodate large external file text.

View 1 Replies View Related

SQL & PL/SQL :: Converting HTML Format Text To Plain Text?

Dec 23, 2009

Is there any way to convert HTML format text to Plain Text ?

View 26 Replies View Related

Text :: Number Search Using Oracle Text

Jun 19, 2012

I'm new to Oracle Text. I want to implement search for the unique ids. Like google search when the user start typing 123 it need to brings anything starting with 123 and has show like entries how google will shows. When I add number 4 to like 1234 then it has bring numbers starting with 1234.

View 2 Replies View Related

Forms :: Export Text File With Same File As Imported Text File?

May 30, 2011

Is it possible to get the same name of file name from imported text file?

What i've is, I import the text file then I exported it.

can I get the same name of the imported text file?

View 2 Replies View Related

SQL & PL/SQL :: Merging Text For Same ID

Aug 18, 2010

I understand you can do this using cursors, but i need it in plain SQL; so that I can make this a correlated sub-query to another table using the id column.

Here's the original table:

id subid text
-- ----- ----
1 1 red
1 2 blue
1 3 green
2 1 yellow
2 2 black
2 3 orange

result should be:

id text
-- ----
1 red,blue,green
2 yellow,black,orange

SQL to Create and populate the table:

CREATE TABLE testStringJoin(ID number, subid number,text varchar2(50));
INSERT INTO testStringJoin values(1,1,'red');
INSERT INTO testStringJoin values(1,2,'blue');
INSERT INTO testStringJoin values(1,3,'green');
INSERT INTO testStringJoin values(2,1,'yellow');
INSERT INTO testStringJoin values(2,2,'black');
INSERT INTO testStringJoin values(2,3,'orange');

View 4 Replies View Related

Generate A Text File

Apr 28, 2008

i have be requested to create a .txt file. Its for a program that will read the txt file i create to produce a letter i.e I will be extracting, TITLE, FORENAME, SURNAME etc

MR
JOE
BLOGGS

Here is the my code so far,

SELECT
LPA_INPUT.INPUT_TITLE,
LPA_INPUT.INPUT_SURNAME,
LPA_HISTORY.LPA_AMT,
LPA_HISTORY.ELIG_RATE,
LPA_HISTORY.RATE_REBATE,
LPA_HISTORY.RR_AMT,
LPA_HISTORY.LPA_APPLIC,
LPA_HISTORY.LPA_AMT
FROM LPA_HISTORY, LPA_INPUT
WHERE LPA_HISTORY.CLAIM_NO = LPA_INPUT.CLAIM_NO
----------------------------------------------------
Iv been asked to have these eight fields looping over and over for all the records in the database, So im not sure how to do that and how to generate it in a txt file?! I have to produce it in a script and not by a Export/Import wizard in sql server mangement studio!!!

View 11 Replies View Related

How To Find SQL Text History

May 27, 2011

I have SQL ID , sql with bind variables ("SYS_B_005")from AWR report which is taken last week.I need find the full exact sql text with bind variable value (sql ran 1 week before).

View 4 Replies View Related

SQL & PL/SQL :: Update String Anywhere In Text

Mar 3, 2011

We have table with a column REMARKS,where in text somewhere we are storing name also,Now we are planning to update only names with their service number

REMARKS Column Sample row text:

1.It has been created by John
2.John Created this
3.Assistance taken by John for this

Any query which can only replace john in all rows with 1234 .I can update the value if John comes at same position in all rows using SUBSTR() and concat rest of the text.But not getting how to update JOHN in rows at different positions.

View 7 Replies View Related

SQL & PL/SQL :: How To Get Exception Name And Error Text

Aug 21, 2012

I'm inserting to a table through a procedure, I want to log the rejected records to a log table with the execption / reason.How can I get the exception name and error text in PL/SQL ?

View 20 Replies View Related

SQL & PL/SQL :: Convert PLB To Text File?

Feb 11, 2011

is there anyway to convert plb file to sql file or text file

View 20 Replies View Related

Text :: How Does ACCUM Work

Jun 21, 2012

how ACCUM works. We are using a text index over XML documents and want to apply a very simple relevance weighting based on occurrences within a certain tag. For example, if TAG1 has a weight of 10, each occurrence in TAG1 should add 10 to the score. We have 13 Tags that should be weighted and multiple occurrences in different tags should be cumulated. So 3 occurrences in TAG1 (weight 10) and one occurence in TAG2 (weight 7) should result in a score of 37.

Just searching in TAG1 works as expected:
( DEFINESCORE( foo, OCCURRENCE ) WITHIN TAG1 ) * 10Three occurrences score 30.

Just searching in TAG2 works also as expected. One occurrence scores 7. However, when I combine both searches
(( DEFINESCORE( foo, OCCURRENCE ) WITHIN TAG1 ) * 10) ACCUM (( DEFINESCORE( foo, OCCURRENCE ) WITHIN TAG2 ) * 7)the score is 61 instead of 37. More interestingly, including all 13 tags (of which most do not contain the search word) lowers the score again.

I ended up with searches where two documents cont

View 7 Replies View Related

PL/SQL :: Oracle 10g - How To Encrypt The Text

Jan 29, 2013

how to Encrypt the text in oracle 10g? is there any built in function.

View 1 Replies View Related

Excluding Records That Contains Certain Text

Jan 30, 2012

I'm very new to sql. I'm using rapid sql to query an oracle db. I need to exclude records that contain the following text: reissuescholasticmedia tie-inmovie tie-in

Currently, I'm using the following query, which returns records that include the text I'd like to exclude (reissue, scholastic, media tie-in, movie tie-in).

Select
ISBN,
BOOK_TITLE,
PUBLISHER_DESCRIPTION,
AUTHOR_BYLINE,

[Code]....

this query so that it excludes records containing the text that I've indicated?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved