PL/SQL :: Regular Expression To Remove Space In HTML Tag?
Nov 6, 2013
, My HTML string is like below. select '<CityName>RICHMOND</CityName> <StateCd>ABCD CDE <StateCd/><CtryCd>CAN</CtryCd><CtrySubDivCd>BC</CtrySubDivCd>' Str from dual Desired Output is<CityName>RICHMOND</CityName><StateCd>ABCD CDE <StateCd/><CtryCd>CAN</CtryCd><CtrySubDivCd>BC</CtrySubDivCd> i.e.
want to remove those spaces from tag value area having only spaces otherwise leave as it is.implement the same using Regular expression.
I'm trying to match all sentences that contain words starting with given search tokens at least once. For example: if the given search token words are one and two then only sentences like "one plus one is two" should match. And should not match sentences like "one plus three is four". I was able to come up with this but I need a AND condition which I'm unable to get it right.
select count(*) from dual where regexp_like('one plus one is two', '(^|s)one|three', 'i');
Currently this gives a count of 1. But needs to give a count of 0 when the regexp is fixed.
search words : one two
one is less than two -> match two is greater than one -> match onetwo is union of two numbers -> match onetwo is union of 2 numbers -> not a match as 'two' is not at the beginning of a word one is less than three -> not a match as two is not present.
I have a Identifier column with start and stop dates along with description .
Two dates are separated by '-'. But the position of that character(-) is not constant always. Depending on the instr function I am able to divide the start and stop dates. But I am getting the performance problem because of huge data
I think the same logic will be implemented by regular expression also . How to write the equivalent logic by using regular expressions
I would like to write a select that would return all places in DB that are commiting transaction.
E.g. package for testing:
CREATE OR REPLACE PACKAGE test.TEST_COMMIT AS PROCEDURE THE_ONLY_COMMIT_IN_DB ; END TEST_COMMIT;--not a match CREATE OR REPLACE PACKAGE BODY test.TEST_COMMIT AS
[code]....
The select should return 4 rows with --ok.
SELECT * FROM ALL_SOURCE ASO WHERE REGEXP_LIKE(ASO.TEXT,'commit(s*);','i' ) AND name = 'TEST_COMMIT'
I need to search a specific pattern from a source code. In word, I need to check whether "getCode" has been called or not, for all the string inside double-quote("). Following are sample code lines -
Now, expression should be such that it will return true during check for 1, 3 and 4, although, for 3 & 4 getCode has been called for part of the String.
Apex 4.2I currently have a report column in a classic report that has a Column Formatting Attribute as below. This works fine it shows a map icon that when you click on it goes off to google maps and put 2 geo points on a map. However I need to change this report column so that the HTML expression will be different dependent on the value returned so if the column returns 1 then the HTML Expression will be slightly different.
I think I can do this in the report source directly with a case statement and include the HTML in that for the column but how do you handle all the quotes within the SQL statement. e.g.
Original Query SELECT parcel_id ,status ,LOCATION ,scan_date ,scan_id ,driver_comments ,card_id ,valid_geo_codes -- this is my html column ,property_geo_lat ,property_geo_long ,scan_geo_lat ,scan_geo_long ,broke_geo ,line_1 ,post_code FROM vw_parcel_history_details WHERE parcel_id = :p341_parcel_id ORDER BY scan_date New Query SELECT parcel_id ,status ,LOCATION [code].....
various iterations of that large html string but I do not know how to format it because off all the quotes?
I have interactive reports where the column link on a specific column has to be dynamic, that means, it cannot be hard coded in the column link attributes. The following is an example of one such report query:
case when d.object_type_description ='Business Service' then
when d.object_type_description = 'Real Time Event' then
'< href="f?p='||:app_id||':162:'||:app_session||'::::P162_OBJECT_ID:'||d.id||'">'||d.object_name||'</>' else null end
as "OBJECT NAME"As you see in the above example, the link on the "Object Name" column could either redirect to page 183 or to page 162 based on the "Object Type Description" column.
The column attribute of the "Object Name" column has "Display Type" set to "Standard Report Column". That works perfectly fine in the UI of the report. However, if I download the IR data (in any format) from the Actions -> Download menu, the object name column values are downloaded with the HTML characters as:
< href="f?p=15548:183:6072319179284::::P183_OBJECT_ID:255245470513999672860510787772603748464">JP010000</>where JP010000 is the object name.
Is there a way I can strip the HTML from the column values in the downloaded files?I am using Apex 4.1.
Sysaux Tablespace is running low. WE SET AWR RETENTION TIME=60 DAYS. WE ARE NOT INTEREST TO EXTEND SYSAUX TABLESPACE SIZE. Usually we take AWR weekly once. Some times we did ADDM report and ASH.
CODEsql>select TABLESPACE_NAME, FILE_NAME, BYTES/(1024*1024), AUTOEXTENSIBLE, MAXBYTES/(1024*1024) from dba_data_files where tablespace_name = 'SYSAUX';
1. What's the best SOLUTION ? 2. Can i shrink sysaux tablespace ? 3. I think , The size for all occupants in sysaux tablespace is less than 200 MB => how to find actual content of sysaux tablespace ? 4. What could be the reason for growth? Is there any way to free the space from sysaux table space?
How to use a table type variable with a regular query? For example, in my PL/SQL proc I have a table of employee names.
v_emp_tbl; --contains 'John','Sally','Ted'
Then I want to get names in a table called tbl_employees which are not in the pl/sql table. So if the table contains 'John','Sally','Ted',and 'Don' then I want to see 'Don'.
Not sure how to do this. Essentially I want something like:
Select emp_name into v_single_emp from tbl_employees where emp_name NOT IN v_emp_tbl;
I know I can loop through the pl/sql table but I wanted to see if there is some other way.
I am needing to select GUIDS from a table and for this, I need the Regular Expression. My Perl is not good and not good Regular Expression. My database is Oracle 11.2.0.2.0 and the Operating System of the Machine is Linux (Oracle Version 6).
I have this remote database A and database B. DB A has 10 views and DB B has 10 tables. I have to pull out data from views of DB A and load into tables of DB B at regular intervals. How do I do this job?
I am attempting to perform regular updates on several Oracle tables. The scripts performing the updates are scheduled to run every two minutes, get a value and update the table with that value.
The value doesn't always change but the scripts will still attempt to perform an update.
The same script is part of 7 objects, all of them are scheduled to run at the same time. They update the same table but never the same row.Even though the script is mostly the same on the 7 objects, they run completely independently of each other. The first object will usually perform the update without any problems but when it comes to the second object the script will time out.
It displys the Google page in another window. How can size the wiindow? For example adding width=200, height=100 to the href tag doesn't work.... Do I need to use JavaSvript?If yes, any example?.