Removing Illegal Characters

Dec 27, 2006

I am working with Oracle 10G, and have been working on setting up little pl/sql checks to make sure that the data that is imported is in the correct format.

The wall I have hit is removing illegal characters from the data I import. I have started to set something up where the string for a certain column must be be made of only there characters:

"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-" (note that there is a - besides just letters) and I may want to add some other characters later. So basically the script will drop or replace any character not found in my definitions with "", thus removing the illegal character and joining the previous and next characters.

I thought for sure there would be a script posted somewhere online that did this but I can't find it and my syntax skills are lacking.

View 8 Replies


ADVERTISEMENT

SQL & PL/SQL :: Removing Special Characters And Get Desired Characters From Column Values

Jul 23, 2013

create table test
(
name varchar2(50),
descd varchar2(50)
)
insert into test values ('kethlin','da,dad!tyerx');
insert into test values ('tauwatson','#$dfegr');
insert into test values ('jennybrown','fsa!!trtw$ fda');
insert into test values ('tauwatson','#$dfegr ,try');

how do I get the first three characters and last three characters from name field and remove all the junk characters from descd field?

so my o/p be like;

Quote:('ketlin','dadadtyerx')
('tauson','dfegr')
('jenown','fsatrtw fda')
('tauson','dfegr try')

View 6 Replies View Related

CLOB Removing Newline Characters

Dec 13, 2008

I am persisting xml with below mention tag which contains preformatted text data.

<SECTION>
<HDG><![CDATABusiness Summary]></HDG>
<BODY>
<![CDATA[(C) 2008 D&B
COPYRIGHT 2008 DUN & BRADSTREET INC. - PROVIDED UNDER CONTRACT
FOR THE EXCLUSIVE USE OF SUBSCRIBER 263763803.
ATTN: null
[code]....

Now, when i retrieve this xml from oracle CLOB column, i am getting data in body tag as below:

(C) 2008 D&B COPYRIGHT 2008 DUN & BRADSTREET INC. - PROVIDED UNDER CONTRACT FOR THE EXCLUSIVE USE OF SUBSCRIBER 263763803. ATTN: null US TEST COMPANY 984 DUNS: 36-252-8379 RATING DS US FICTITIOUS COMPANY 984 BUSINESS SERVICES EMPLOYS UNDETERMINED 899 EATON AVE SIC NO. BETHLEHEM PA 18025 7389 TEL: 610 882-0005 RICHARD DOE, MANAGER RECORD TYPE: DUNS SUPPORT THE "DS" INDICATOR ASSIGNED TO THIS BUSINESS MEANS THAT THE LIMITED INFORMATION CURRENTLY IN THE D&B FILE DOES NOT ALLOW US TO CLASSIFY IT WITHIN OUR RATING SYSTEM. WE ARE PROVIDING THIS INFORMATION TO YOU IN THE INTEREST OF SPEED WITHOUT HAVING COMPLETED AN INVESTIGATION. THEREFORE, THIS REPORT MAY NOT REFLECT THE CURRENT STATUS OF THIS BUSINESS. D&B CAN INVESTIGATE THIS BUSINESS AND UPDATE THIS INFORMATION BASED ON THE RESULTS OF THAT INVESTIGATION.

All text formatting goes for a toss (newline, trailing tab characters are getting trimmed).provide any inputs on how to avoid this. Text formatting needs to be preserved.

View 1 Replies View Related

PL/SQL :: Illegal Use Of LONG Datatype

Aug 31, 2012

I've this problem:

create table t1 ( x long );
Table created.

create table t2 ( x long );
Table created.

insert into t1 values ( 'test long type' );
1 row created.

insert into t2 select * from t1;
                      *
ERROR at line 1:
ORA-00997: illegal use of LONG datatype

How can I issue this error, I need use also dblink with long type.

I do not want to use the copy command.

I know that you can solve this problem with a stored procedure or anonymous block.

View 8 Replies View Related

ORA-00997 / Illegal Use Of LONG Datatype

Aug 13, 2013

We also face the same in oracle 9i version. we tried to re-org some tables for performance issue.But our tables have long and long raw datatype. then we approached the traditional way i.e 1. Export tables.2.Truncate tables.3.import tables.(use ignore=y).4.check the index validation.5.gather stats. Above was successfully done in our production environment.but some application downtime is required. 

View 1 Replies View Related

Forms :: Illegal Restricted Procedure Error

Aug 25, 2011

I have data block, after inserting records, in post insert i am using 'GO_ITEM' built_in as i have to move cursor to particular item in another block.

It's giving 'Illegal Restricted procedure' error. How to move cursor to particular item of another block after inserting record?

View 5 Replies View Related

SQL & PL/SQL :: ORA-38818 Illegal Reference To Edition Object

Jul 2, 2012

When I am trying to create a public synonym for a package then I am getting this error. This error tells us that non editioned object(Public Synonym) can not refenrence the editioned object(Package in this case).One of the solution provided on one of t he site is to create local synonym instaed of public synonym but I need to create public synonym only.

View 6 Replies View Related

Forms :: ORA-01036 - Illegal Variable Name / Number

May 30, 2012

I have developed a form which is running fine most of the time,

but some time it gives error

unable to insert record and if we see detail it shows

ORA-01036: illegal variable name/number

error.jpg is attached. if there is some problem, it should not pass any entry and if there is no problem then why it gives error of illegal variable?

View 3 Replies View Related

Replication :: ORA-00997 / Illegal Use Of LONG Datatype

May 5, 2010

I've got a dblink between two Oracle databases. There are one view that I specify a join between four remote tables.

One of the tables does have a column defined as a long raw. I do not need that column; the query doesn´t make reference to it.However, when I specify the query, I get this error: ORA-00997; illegal use of LONG datatype.

"how can I accomplish this query, over a dblink, given that one table has a long raw that is not part of my query ?

View 1 Replies View Related

SQL & PL/SQL :: ORA-02065 / Illegal Option For ALTER SYSTEM

Sep 8, 2012

SQL> ALTER SYSTEM SET NLS_LANG='AMERICAN_AMERICA.AR8MSWIN1256'SCOPE=SPFILE;
ALTER SYSTEM SET NLS_LANG=' PORTUGUESE_PORTUGAL.WE8MSWIN1252'SCOPE=SPFILE
*
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM

View 9 Replies View Related

Oracle 11g Client / ORA-12533 Illegal ADDRESS Parameter

Jul 10, 2011

I am working on a database application which works as a data access layer. The application uses OCI interface to connect and query to the Oracle Database. This application is certified on Oracle 9i and 10g client and works fine without any issue, but when I am certifying the application on Oracle 11g client, I am getting connection failed problem and following Oracle Error is displayed.

ORA-12533 illegal ADDRESS Parameter.

There is no change in the environment setting between Oracle 10g and Oracle 11g.

Following are the details of the environment

Version of Oracle 11g client is 11.1.0.6.0
Version of Oracle Database is 11.1.0.6.0.
Platform - Solaris 5.9 on sparc v9

On enabling client trace with support level also does not work. It shows TNS error TNS-12533 illegal ADDRESS Parameter.

what could be the possible reasons that the connection is failing with Oracle 11g client, while the same is working with Oracle 10g client. As I said there is no environmental difference when performing this test. The only change is ORACLE_HOME setting for the corresponding Oracle client version.

View 2 Replies View Related

Server Administration :: Long Data Type Illegal?

Dec 26, 2012

when I try comnd create table a as select * from b where 1=2; it says illegal datatype long..i m bemused what sin has the long datatype done?

View 4 Replies View Related

SQL & PL/SQL :: Find All Partition Names - Illegal Use Of LONG Datatype

Mar 5, 2012

I need to find all the partition names below or equal given value.

select
partition_name
from
user_tab_partitions
where
table_name = 'RB' and
HIGH_VALUE <= 1234

Above Query is giving error "ORA-00997: illegal use of LONG datatype"

Any other alternative ? (I know its because of LONG Datatype of HIGH_VALUE ) ...

View 9 Replies View Related

Server Utilities :: Export Illegal Parameter Value In OCI Lob Function?

Jan 21, 2011

We are trying to export our production data .We got this error

. . exporting table EA_BLOB
EXP-00056: ORACLE error 24801 encountered
ORA-24801: illegal parameter value in OCI lob function

how to overcome this error ?

View 2 Replies View Related

Application Express :: ORA-00997 / Illegal Use Of LONG Datatype

Jul 26, 2012

I am trying to copy structure of table through database link but getting an error while running the command :

SQL> create table TOAD_PLAN as select * from TOAD_PLAN_@db_link where 1=2;
create table TOAD_PLAN_TABLE as select * from TOAD_PLAN_TABLE@to_paceview where 1=2
*
ERROR at line 1:
ORA-00997: illegal use of LONG datatype

how can i create it through database link or through any other utility.

View 2 Replies View Related

Networking And Gateways :: ORA-01741- Illegal Zero-length Identifier For DBlink

Mar 7, 2010

I tried to create a DB link that connects to SQL server.Right now I could connect the SQL server and able to test the connection by tnsping. When I tried to create a dblink, it failed and the message shows

CREATE PUBLIC DATABASE LINK "ODBC" CONNECT TO "user" IDENTIFIED BY "" using 'hsodbc'

ORA-01741: illegal zero-length identifier

The problem is that our sql server does not have any password while identified by is a required field.

View 1 Replies View Related

SQL & PL/SQL :: Find Constraint Name From User Table - Illegal Use Of LONG Datatype

Apr 30, 2010

I want to find the constraint name from User_Constraints table using the following query:

Select * From User_Constraints Where Table_Name='CHARGECODE' and Constraint_Type='C' And Search_Condition = '"PERCENTAGE" IS NOT NULL';

Then it shows "ORA-00997: illegal use of LONG datatype" error.

Is there any way to compare with long type value.

View 11 Replies View Related

Direct Path Exported Dump File Contains Illegal Column Length

Apr 28, 2011

I am trying to import the database and i see the following error:

IMP-00051: Direct path exported dump file contains illegal column length imp abruptly stops. my source and destination database is as follows:

Source: 9.2.0.8
Destinatin: 11g-r2.

I used exp with the following options:

direct=y
buffer=899989898
recordlength=64000
File=1.dmp,2.dmp,3.dmp,4.dmp,5.dmp,6.dmp,7.dmp,8.dmp,9.dmp,10.dmp,11.dmp,12.dmp,
13.dmp,14.dmp,15.dmp,16.dmp,17.dmp,18.dmp,19.dmp,20.dmp,21.dmp,22.dmp,23.dmp,24.
dmp,25.dmp,26.dmp,27.dmp,28.dmp,29.dmp,30.dmp
grants=y
compress=y
FILESIZE=25g
owner=BRM

Using imp with the following option:

indexes=n
buffer=99989898
recordlength=64000
File=1.dmp,2.dmp,3.dmp,4.dmp,5.dmp,6.dmp,7.dmp,8.dmp,9.dmp,10.dmp,11.dmp,12.dmp,
13.dmp,14.dmp,15.dmp,16.dmp,17.dmp,18.dmp,19.dmp,
20.dmp,21.dmp,22.dmp,23.dmp,24.dmp,25.dmp,26.dmp,27.dmp,28.dmp,29.dmp,30.dmp
analyze=n
grants=y
fromuser=brm
touser=brm
statistics=none

why my imp failing?

View 4 Replies View Related

Data Guard :: ORA-00274 / Illegal Recovery Option SESSION Physical Standby DB

May 6, 2011

oracle version: 10gr2
os:windows 32

I have configured a physical standby database.

I have set the physical standby database to open read mode for a short while.

according to [URL] in order to set db in for from open read-only to applying redo data

Quote:

To change the standby database from being open for read-only access to performing Redo Apply:

Terminate all active user sessions on the standby database. Restart Redo Apply. To start Redo Apply, issue the following statement:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;

To enable real-time apply, include the USING CURRENT LOGFILE clause:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> USING CURRENT LOGFILE;

this is what happen

SYS@ngdr> alter database recover managed standby database disconnect session;
alter database recover managed standby database disconnect session
*
ERROR at line 1:
ORA-00274: illegal recovery option SESSION
SYS@ngdr> alter database recover managed standby database using current logfile;

okay since I encountered the illegal recovery options session, I decided to use alter database recover managed standby database using current logfile; now the session seems to be hanging forever.

View 3 Replies View Related

PL/SQL :: Removing Duplicates Except One

Sep 19, 2013

db and dev 10g rel2 ,suppose that i have a table with a lot of duplicate rows ,what i need is to delete the duplicates and retain one row of these duplicates . likecolumn -- with those values...how to delete two (hi's) and retain the third , ?it is all applied to all the duplicate values in the column.

View 5 Replies View Related

Removing Duplicate Keys

Jul 3, 2008

Trying to delete duplicate rows from a table. The problem is, they aren't exactly duplicate rows. Let me explain.

I am migrating data from a Oracle 8.1.7 db to a 10.2.1 db. In the older db, this certain table does not have a PK/Unique Index, but in the new db there is a unique index. The fields that the index is unique on are:

SUBSCR_NO, SUBSCR_NO_RESETS, EXTERNAL_ID, EXTERNAL_ID_TYPE, ACTIVE_DATE.

In the old db, when I run this query I get 1229 rows. With a count of 2 each.

select SUBSCR_NO, SUBSCR_NO_RESETS, EXTERNAL_ID, EXTERNAL_ID_TYPE, ACTIVE_DATE, count(*)
from customer_id_equip_map
group by SUBSCR_NO, SUBSCR_NO_RESETS, EXTERNAL_ID, EXTERNAL_ID_TYPE, ACTIVE_DATE
having count(*)>1;

They are duplicates on those fields, but they are not totally duplicate rows because there is a field called is_current that has 0 in one row and has 1 in the other. What I need to do, is delete the 1229 rows with is_current=0.

View 4 Replies View Related

SQL & PL/SQL :: Removing Table Fragmentation?

Aug 5, 2012

To remove fragmentation which is the best method.

First one :
-----------------
1)Created a backup table from the Fragmented table (This table is a partitioned one).
2)Analyzed this table.
3)DROP the Fragmented table
4)Inserted the backuped up data from backup table to the Re-created table.
5)Analyze this table.

Second method
-------------------
1) Create a backup table newly, with PCTFREE =0
2) Inserted the data from Fragmented table ( This is a partitioned table) to backup table
3) Analyzed this table.
4) Truncate Fragmented table
4) Did Exchange partition of Fragmented table with Backup table.

The second method is not found to be removing the Fragmentation. Before the fragmentation was 28% after Second method the fragmentation is still the same. While the first method the fragmentation reduced to 16%.

Query used to find Fragmentation.
select table_name,
round((blocks*8),2) "table size kb",
round((num_rows*avg_row_len/1024),2) "actual data in table kb",
round((blocks*8),2)- round((num_rows*avg_row_len/1024),2) "wasted space kb",

[code]...

View 9 Replies View Related

SQL & PL/SQL :: Removing Array Index

Sep 10, 2010

TYPE CashRecord IS RECORD(client_id VARCHAR2(100),
account_letter VARCHAR2(100),
cash_amount VARCHAR2(100),
cash_amount_ccy VARCHAR2(100) );

TYPE CashRecordTable IS TABLE OF CashRecord INDEX BY VARCHAR2(100); -- Indexed by client_id~account_letter~ccy

So if I did something like this;

l_cash_records CashRecordTable;

-- say for example that l_cash_rec/l_cash_rec2 has been defined..

l_cash_records('some index') := l_cash_rec;
l_cash_records('some index 2') := l_cash_rec2;
l_cash_records.COUNT would give me 2

How can I somehow remove 'some index 2' so that l_cash_records.COUNT is 1 ?

View 3 Replies View Related

SQL & PL/SQL :: How To Concatenate While Removing Nulls

Jan 26, 2012

This is a simple question, but I cannot seem to find a solution. Here's the basic query:

select distinct accountno, parcelno, streetno||' '|| predirection ||' '|| streetname||' '|| streettype||' '|| postdirection||' '|| unitname||', '|| propertycity
from tblacctpropertyaddress ....

What I want to do is add is this logic: If Predirection is null, then no space between streetno & streetname. Same for postdirection and unitname. (for example, if both postdirection and unitname are null, there are no spaces between streettype and the comma before propertycity)

Also, when unitname is not null, I want to add the string "Unit " prior to the returned value in unitname.

View 5 Replies View Related

How To Evaluate Impact Of Removing CPU

Dec 10, 2012

One of my clients need to remove three(of four) CPU to comply the licensing agreement with Oracle.

To avoid problems and also to list the possible problems that removing the CPU can bring, I wish to make a survey of the possible impacts, especially in performance, that removal can cause.

How can I get this information?

View 8 Replies View Related

SQL & PL/SQL :: Removing Duplicate In Hierarchy Level

Jul 18, 2013

I have requirement to suppress the duplicate nodes on same level in hierarchy query.
Below given is the script for it.

CREATE TABLE NODE_LVL (PARENT_NODE VARCHAR2(100), CHILD_NODE VARCHAR2(100));

INSERT INTO NODE_LVL VALUES('TBL_APL','TBL_AFL');
INSERT INTO NODE_LVL VALUES('TBL_APP','TBL_ACS');
INSERT INTO NODE_LVL VALUES('TBL_ADD','TBL_ADW');
INSERT INTO NODE_LVL VALUES('TBL_ADP','TBL_ADV');
INSERT INTO NODE_LVL VALUES('TBL_AOP','TBL_AOV');
[code]......

Table 'TBL_APP' is having 2 parent nodes i.e 'TBL_AOV' and 'TBL_ADV'
SELECT * FROM node_lvl WHERE child_node = 'TBL_APP';

At level 5 there is duplicate nodes i.e 'TBL_APP' and 'TBL_ACS' as parent_node and child_node respectively.

SELECT PARENT_NODE, CHILD_NODE, LEVEL FROM NODE_LVL START WITH PARENT_NODE = 'TBL_ACF' CONNECT BY PRIOR CHILD_NODE = PARENT_NODE;

I want to suppress such duplicates. So I added DISTINCT

SELECT DISTINCT PARENT_NODE, CHILD_NODE, LEVEL FROM NODE_LVL START WITH PARENT_NODE = 'TBL_ACF' CONNECT BY PRIOR CHILD_NODE = PARENT_NODE;

BUT requirement is to maintain the same order (of hierarchy) as it was before adding DISTINCT.

View 11 Replies View Related

SQL & PL/SQL :: Removing Subpartitions And Preserving Data?

May 3, 2012

I've a table in data warehouse production with data which is partitioned by RANGE, sub-partitioned by HASH.Later we realized that subpartitioned are not needed as volume is less.

I tried below approah in DEV DB:

1. create table ABC_BAK as select * from ABC;

2. dbms_metadata.get_ddl('TABLE','ABC')

3. Removed the subpartitions details from the output of step 2 and prepared the script of create table without subpartitions

4. Drop table ABC

5. Create table ABC from script step 3.

6. Insert into ABC select * from ABC_BAK

7. Drop table ABC_BAK

View 1 Replies View Related

SQL & PL/SQL :: Commit Interval When Removing Duplicates

May 31, 2012

I am trying to remove duplicates from a table with over 10million records. Below query is working fine but it doesnt contain any COMMIT interval. I have to commit after every 20k or 30k records deletion for which IF loop is necessary.

Query:

delete from
customer
where rowid in
(select rowid from
(select
rowid,
row_number()
over
(partition by custnbr order by custnbr) dup
from customer)
where dup > 1);

View 9 Replies View Related

Properly Removing Old Temp Files From ASM Storage

Dec 16, 2010

The other day, we had a query run amok in our 2-node production cluster. The 3 temp files for the temp tablespace were all still set to autoextend unlimited, something I forgot to change after a recent upgrade. I created 3 new temp files and tried to delete the huge temp files. I did this from sqlplus with this commad:

ALTER TABLESPACE PSTEMP DROP TEMPFILE '+DATA/isis/tempfile/pstemp.291.641298061';

The huge files are still in ASM storage. dba_temp_files reports that the status of them is AVAILABLE but they have no RELATIVE_FNO. Grid Control reports their status as OFFLINE and their size as 0. They are actually close to 20 GB each.

I tested the above alter statement in two test instances, also RACed with ASM storage and the temp files were successfully deleted, but they were much smaller in size. At this point, how do I delete the three 20GB files from ASM in our production instance? Why didn't they delete the first time?

View 1 Replies View Related

Forms :: Delete_record Not Removing Record From Screen

May 13, 2010

I am trying to select a row on the screen and delete a individual row from the screen after hitting the delete button. Whenever i select the row it gets highlighted and also the alert box comes up asking if the record needs to be deleted. When I say yes I notice that the row does not get deleted. The code behind the delete button is as follows

(P.S the block is based of a table and commit_form works and changes are saved to db but not delete_record)

begin
--
Set_Item_Property('my_block.emp_no_copy',current_record_attribute,'va_delete_record');
Set_Item_Property('my_block.emp_LName_copy',current_record_attribute,'va_delete_record');
Set_Item_Property('my_block.emp_FName_copy',current_record_attribute,'va_delete_record');
Set_Item_Property('my_block.last_worked_date_copy',current_record_attribute,'va_delete_record');
--
synchronize;
Set_Alert_Property(alert_id, ALERT_MESSAGE_TEXT, 'Do you want to delete the Highlighted record? {NOT YET}');

[Code]....

View 4 Replies View Related







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