PL/SQL :: ORA-00001 / Unique Constraint Because ID Is Primary Key On TABLE1

Jun 27, 2012

I have in a plsql block somewhere a statement like

INSERT INTO TABLE1( id , col)
SELECT id, col
FROM TABLE2;

This statement returns an error ORA-00001: unique constraint because id is a primary key on TABLE1. I would like to know what is the value of id that raised the exception.

View 15 Replies


ADVERTISEMENT

ORA-00001 - Unique Constraint Violated

May 14, 2010

I have faced an error as below:-

1 : 23000 : java.sql.BatchUpdateException: ORA-00001: unique constraint (SDS1.PK_EXP_TXT) violated
1 : 23000 : java.sql.SQLException: ORA-00001: unique constraint (SDS1.PK_EXP_TXT) violated
java.sql.BatchUpdateException: ORA-00001: unique constraint (SDS1.PK_EXP_TXT) violated
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9119)
[Code] ......

After i check data in all_indexes table, i have found some old data which are belongs to 2008 and 2009. The sample as below:-

OWNER INDEX_NAME LAST_ANALYZED
SDS1PK_ACTION 31-OCT-09 07:04:49
SDS1AK_ACTION 31-OCT-09 07:04:49
SDS1PK_COND 31-OCT-09 07:04:50
SDS1AK_COND 31-OCT-09 07:04:50
SDS1COND_FK1 31-OCT-09 07:04:50
SDS1COND_FK2 31-OCT-09 07:04:50

is it the problem due to the old data not remove from the all_indexes table ?.. if YES is it I have to delete the old data manually from the all_indexes table ?

View 7 Replies View Related

Forms :: ORA-00001 - Unique Constraint?

Mar 15, 2011

I have disabled the primary key on a table using this...ALTER TABLE C_LOV_BOROUGH DISABLE CONSTRAINT CLOVBOROUGH_PK CASCADE;

but now when I try to insert duplicate value. It gives this error.

ORA-00001: unique constraint (LOT_DBA.CLOVBOROUGH_PK) violated

View 5 Replies View Related

Replication :: ORA-00001 - Unique Constraint Violated

Aug 3, 2008

I got this error message in my replication environment.

ORA-12012: error on auto execute of job 2182370
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (TE.S_TE_MTH_DBASE_SALES_INFO_A_U1) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 189

Materialized view and Base table having only one unique index. There are no referable constraints in my base table. Because source table not refer any other tables.

Even; materialized view log created using rowid because there are no primary key constraints in my base table.When I manually refresh materialized view I got the below error message

ORA-00001: unique constraint (TE.S_TE_MTH_DBASE_SALES_INFO_A_U1) violated

How it's possible? Because there is parent/child relationship in my source table and there is no way to enter duplicate records it's unique index.

View 8 Replies View Related

Server Utilities :: ORA-00001 - Unique Constraint Violated Error During Impdp?

Oct 17, 2011

I am trying to import the dump using the impdp utility and followed the below steps I have disabled all the constraints and executed the below command

impdp DIRECTORY=EXPDP_DAILY_BACKUP_DIR DUMPFILE=expdp_QA_full_11102011_214501.dmp
logfile=imp_EXPDP_QA_full_12102011_203254.log remap_schema=prod:prod remap_tablespace=prod:prod
schemas=prod TABLE_EXISTS_ACTION=truncate content=data_only.

but I am getting the below error like this for 1 or 2 tables . and If I import those tables seperately its getting imported successfully. i am not getting the below error always .

ORA-31693: Table data object "PROD"."DAS_ID_GENERATOR" failed to load/unload and is being skipped due to error:
ORA-00001: unique constraint (PROD.DAS_ID_GENERATOR_P) violated
ORA-31693: Table data object "PROD"."TKT_DIST_SRV_STAT" failed to load/unload and is being skipped due to error:
ORA-00001: unique constraint (PROD.SERVER_STATS_P) violated

View 8 Replies View Related

Unique Constraint Violated?

Mar 26, 2007

From a step by step instructions I'm asked to put the following into sql*plus:

CREATE TABLE Lab2Lecturer
(staffNO VarCHAR2(10) NOT NULL,
title VARCHAR2(3),
fName VARCHAR2(30),

[code]...

Then the following:

INSERT INTO Lab2Lecturer
(staffNO, title, fName, lName, streetAddress, suburb, city, postCode, country, lecturerLevel, bankNO, bankName, salary, workLoad, researchArea)
VALUES
('1000', 'Dr', 'Johanna','Santoso',
'3 Robinson Av', 'Kew', 'Melbourne', '3080', 'Australia', 'C', '1000567237', 'CommBank', 65000.00,1.0, 'O-R DB');

and finally,

INSERT INTO Lab2Lecturer
(staffNO, title, fName, lName, streetAddress, suburb, city, postCode,country, lecturerLevel, BankNO,bankName, salary, workLoad, researchArea)
VALUES
('1000', 'Dr', 'Justine', 'Martin', '6 Algorithm AV', 'Montmorency', 'Melbourne', '3089', 'Australia', 'D', '1000123456', 'CommBank', 89000.00, 1.0, 'CBR');

when I try entering in the second one I get an error 'unique constraint violated'.So whats wrong exactly?

View 1 Replies View Related

PL/SQL :: Unique Constraint Violated

Oct 4, 2013

My DB version is

BANNER                                                     
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production                       
CORE 10.2.0.4.0 Production                                     
TNS for Linux: Version 10.2.0.4.0 - Production               
NLSRTL Version 10.2.0.4.0 - Production  

These error codes I'm getting in production.First of all, I've no duplicates present in that table for which this error has been raised.I've checked the index and related columns as well. NO DATA is there.So NO CHANCE for unique constraint violation.

SELECT * FROM ORDER_OCC_REQUISITION_X_REF WHERE LAB_ORDER_OCC_TEST_ID IN(SELECT LAB_ORDER_OCC_TEST_ID FROM LAB_ORDER_OCC_TEST WHERE LAB_ORDER_OCC_ID = 7944858);

no rows selected

 Now when I'm trying to insert one row inside this table I'm getting this error, as you are seeing no records for this occurrence_id. 

SELECT * FROM USER_INDEXES WHERE INDEX_NAME = 'ORD_OCC_REQ_UQ_TEST_IX_04';
--ORDER_OCC_REQUISITION_X_REF (Table name)
--MERGE_DT, LAB_ORDER_OCC_TEST_ID, TEST_ID, ACTIVE_YN (columns for the index 'ORD_OCC_REQ_UQ_TEST_IX_04')
As you can see there is no data then this error should not be raised.  Update procedure.
/*******************************************************************************************************************
     * Name                    : UPDATE_REQUISITION_X_REF
     * Description             : This Procedure update ORDER_OCC_REQUISITION_X_REF table with requisition_id
     *                           that was generated due to merge process.
     * In  parameters          : IN_merge_id         NUMBER   The order_ref_no of the orders to be merged (comma seperated)
     ***********************************************************************************************************************/
    PROCEDURE   UPDATE_REQUISITION_X_REF ( IN_merge_id  IN TT_ORD_REQUISITION_WORK_AREA.merge_id%TYPE)
    IS
  
[Code]....

View 8 Replies View Related

RMAN Unique Constraint Violation

Aug 23, 2011

Our RMAN backup failed because of the error:

starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 08/22/2011 22:19:07
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 08/22/2011 22:19:07
ORA-00001: unique constraint (ODBA.DF_U2) violated

Searching metalink, its related to bug 6014994 and the proposed workaround is to delete the constraint:

Cause:
Dropping a datafile from a tablespace followed immediately by adding
another datafile to the same tablespace will cause this Unique Key violation.
Taking a RMAN debug trace will show the file# related to the error
This is reported as bug <<6014994>> Unpublished on Metalink and fixed in 11g
RMAN RESYNC catalog signals DF_U2 violated constraint when a file# is reused in
the same tablespace
Solution
WORKAROUND: Drop df_u2 constraint

where can I delete the constraint, is it possible to do in RMAN or in the target instance?

View 1 Replies View Related

How To Handle Unique Constraint Violation

Feb 5, 2013

I've set up Oracle Streams replication between multiple N-way zones like this:

CODE------------------------------
Nway1 |Intersect| Nway2
DB1 --|-- DB3 --|-- DB5              DB1, DB2, DB3, DB4 - N-way1
  |   |    |    |    |               DB3, DB4, DB5, DB6 - N-way2
DB2 --|-- DB4 --|-- DB6              DB3, DB4 - intersection zone
      |         |  
-------------------------------

Physically DB1 .... DBN connected sequentially, so I want to prevent segmentation if some DB is unaccessible, but at the same time fight unneeded redundancy which uses too much link bandwidth to send N-1 LCR-s to all members of a single N-way group (so I want to split one big N-way zone into smaller ones and sequentially connect them into chain - it significantly reduces load on link if N is big enough (>10)). Also I want to have 2 DB in intersection zone to prevent single point of failure.

This scheme has one drawback - if change originated on DB3 or DB4, then it will be propagated (more correctly - applied and captured again) to DB5 and DB6 by both DB1 and DB2 (and, as far as I know, I have no means in capture rules to detect state of DB2 from DB1 and vise versa), so on DB5 and DB6 I get:

CODEORA-00001: unique constraint (DUMMYUSR.UNIQUE_RECORDS) violated error

I've set up standard conflict handler for apply process:

CODE

declare                                                                                        
    cols DBMS_UTILITY.NAME_ARRAY;                                                              
begin                                                                                          
    cols(1) := 'no';                                                                          
    cols(2) := 'name';                                                                        
    cols(3) := 'ddate';                                                                        
    dbms_apply_adm.set_update_conflict_handler(                                                
        object_name       => 'DUMMYUSR.DUMMYTBL',                                              
        method_name       => 'DISCARD',                                                        
        resolution_column => 'no',                                                            
        column_list       => cols                                                              
    );                                                                                        
end;

but it seems that it does not handle uniqueness conflicts. What is the best way to handle uniqueness conflict (is there a better way than to write custom error handler) and how serious is the impact on insert performance of having unique constraint and corresponding error handler. (In real world I will have to deal with tables with metainformation and without any keys).

Also, how to proceed with no error or raise exception from apply error handler with error that caused this handler to run? In oracle docs I can find only example that modifies LCR and runs lcr.EXECUTE(TRUE), but what to do if I don't want to reexecute LCR, but merely check error code and propagate error if it is not ORA-00001?

View 1 Replies View Related

SQL & PL/SQL :: Unique Constraint When 1 Column Is Not Null

Jun 15, 2012

I have 3 columns in a table: colX, colY, colZ.

Trying to find a way to prevent duplicates with these, but only if colX is not null.

For example, if there are already values for: colX = 1, colY = 1, colZ = 1

then:

Allowed: colX = null, colY = 1, colZ = 1
Not allowed: colX = 1, colY = 1, colZ = 1

I can't create a unique constraint on these columns because there are many null values for column colX, and as mentioned, when colX is null, colY and colZ can be any values.

I also tried using a before insert trigger to find duplicates before posting and raise an error if found, but this causes an ORA-04091 mutating error since the trigger in the table is referencing itself to check for duplicates.

Also, I know there is something called a function based index, but I cannot use those with my code, so I need another solution if possible.

View 4 Replies View Related

SQL & PL/SQL :: ORA00001 Unique Constraint Violated

Nov 4, 2012

I also put in the relevant code in case it's needed.

SQL> @lab_05_01.sql
SQL> -- Oracle Database 10g: Administration Workshop II
SQL> -- Oracle Server Technologies - Curriculum Development
SQL> --
SQL> -- ***Training purposes only***
SQL> -- ***Not appropriate for production use***
SQL> --
SQL> -- This script performs a batch promotion update.
SQL> -- The logic of the updates is not important -

[code]....

View 2 Replies View Related

SQL & PL/SQL :: Unique Constraint Versus Distinct?

Apr 30, 2013

about the functionalty w.r.t. unique constraint and Distinct clause. Below is the example which is confusing me lot.

--Below statement will create table and unique constraint
Create Table A (A Varchar2 (10) Unique);
Insert Into A Values (Null);
Insert Into A Values (1);
Insert Into A Values (2);

[code]...

If we are saying each null value is having a unique value, then why oracle distinct showing records.

View 3 Replies View Related

Creating Unique Constraint That Excludes Null

May 22, 2013

I have a table where I want user to fill in unique values for a field which is easy to do.

Problem is sometimes the values can be null so an ordinary unique constraint does not work because multiple null records. Is there a way of validating only non null values to ensure all data entered that is non null is unique?

View 1 Replies View Related

SQL & PL/SQL :: Local Unique Constraint On Partition Table

Aug 2, 2011

I have created a table below, my TL asked me to create a local unique constraint for the below table.

I went through all sites and could not find the correct solution, how to create LOCAL UNIQUE CONSTRAINT ON SUB PARTITION TABLE and LOCAL UNIQUE INDEX ON PARTITION TABLE. Creating Local Unique constraint should take care of creating local unique index creation.

Unique key columns are DET,GDS,ARRIVE_DT

CREATE TABLE SUB_PAR_TAB
(
ID VARCHAR2(100) NOT NULL,
REGION VARCHAR2(40) NOT NULL,
SOURCE VARCHAR2(80) NOT NULL,
DET VARCHAR2(80) NOT NULL,
GDS VARCHAR2(40) NOT NULL,
ARRIVE_DTDATE,
SYS_SOURCE VARCHAR2(25) ,
[code]........

View 5 Replies View Related

SQL & PL/SQL :: Unique Constraint Error Due To Multiple Insert By Java?

Apr 18, 2010

I have two different java process trying to insert in the same time in the same table for the same trade. The structure of the table Report is

create table report
( TRADE_ID NUMBER,
VERSION NUMBER,
MESSAGE_TIME TIMESTAMP)

There is a unique key on (TRADE_ID and VERSION) So if a new trade_id is inserted, the version is set to 1 and the second becomes 2 and so on. The version is calculated as last version of the trade_id ie. version + 1. It was woking fine till a new Java process was build that fired inserts through ten different java instances at the same time resulting in unique key error. So in detail what is hapenning is if three records of trade_id's comes in at the same time it should allocate versions in a first come first serve basis and there should be three versions of trade id 1,2 and 3. Now due to the multiple instances they all seems to get fired at once and all ending up with version one and thus resulting in unique key constrain error while trying to insert into the table.

View 3 Replies View Related

SQL & PL/SQL :: Name Of Primary Key Constraint Is ID_PK

Jul 31, 2010

I have a table say EMP with 2 fields ID and Name, with ID being the primary key. The name of the primary key constraint is ID_PK.Now my scenario is :

1. Rename the table EMP to EMP_TEMP;
2. Create an empty table EMP
3. If (data successfully loaded into EMP)
{
Drop EMP_TEMP;
}
else
{
Drop EMP;
Rename EMP_TEMP to EMP;
}

The problem here for me is the primary key constraint. When I am in 2, I cannot create the primary key constraint again since the old one is still in tact. If I go ahead to drop the original pk constraint and re-create a new one in 2, then in case of else part , I need to get the constraint again while renaming the original table.

View 6 Replies View Related

SQL & PL/SQL :: Difference Between Primary Key And Unique / Not Null

Dec 10, 2010

what is difference between primary key and unique+not null

View 12 Replies View Related

Forms :: Create Unique Primary Key

Nov 28, 2010

A Master form in a tabular format. Id is a display item. I want to auto generate Id with following query.

select nvl(max(issue_id),0)+1 into :issue_mt.issue_id from issue_mt;

It works:

1)When each record is saved before creating new record.

It doesn't work:

2)If multiple records are entered with out saving each record.

What to do to generate unique Id in both cases?

View 7 Replies View Related

SQL & PL/SQL :: ORA-12014 / Table CDA_FUNCTION Does Not Contain A Primary Key Constraint

Dec 9, 2010

I am trying to create snapshot using the following script but I am getting the error

ERROR at line 22:ORA-12014: table 'CDA_FUNCTION' does not contain a primary key constraint

SQL> CREATE SNAPSHOT MEDA.cda_function
PCTFREE 10
PCTUSED 40
MAXTRANS 255
TABLESPACE users
STORAGE (
INITIAL 40960

[code]....

I check in dba_constraint data dictionary table for the constraints in the table CDA_FUNCTION.it is showing as follows

owner constraint_name constraint_type table_name search_condition status deferrable deferred validated generated
WEDA SYS_C0032310 C CDA_FUNCTION (LONG) ENABLED NOT DEFERRABLE IMMEDIATE VALIDATED GENERATED NAME
WEDA SYS_

View 4 Replies View Related

Performance Tuning :: Primary Key Constraint Is In UNUSABLE Status

Jan 20, 2012

when I check one database, I noticed that the primary key constraint is in UNUSABLE status. But when I check the table, the table DDL itself,the below query mentioned.

ALTER INDEX "COMMON_DATA"."PK_DISE_MOBILE" UNUSABLE ENABLE

suggest whether I need rebuild this index? if I rebuild this index, will it useful for me for the performance improvement? But the table has only 578234 records.

Table DDL
CREATE TABLE "COMMON_DATA"."DISE_MOBILE_INSTALLATION"
( "M_DBASE_ID" VARCHAR2(2),
"COMPANY_NUMBER" NUMBER(3,0),
"M_ACCT_ID" NUMBER(8,0),
"ACCOUNT_CREATION_DATE" DATE,
"ORDER_NUMBER" VARCHAR2(15),
"ORDER_CREATION_DATE" DATE,
"ORDER_CREATION_METHOD" VARCHAR2(1),
"CONTRACT_TERM" VARCHAR2(3),
"GROUP_ID" VARCHAR2(6),
[code]...

View 10 Replies View Related

SQL & PL/SQL :: Create Normal Primary Constraint During Table Creation

Mar 23, 2010

i'm new to oracle environment.how can i specify NONCLUSTERD INDEX on Primary cloumn during table creation.By default it will create clusterd index but i need non-clusterd index on it.

I'm using following stmt to create normal primary constarint during table creation,

CONSTRAINT PKFORM_PROPS PRIMARY KEY (FORM_PROPS_PK) USING INDEX TABLESPACE DB123_INDEX

how can i change the above query, so that it should create NONCLUSTERED INDEX on Primary key column.

View 5 Replies View Related

Utilize Cluster Key To Ensure Uniqueness / Primary Key Constraint

Oct 11, 2010

I am trying to add a primary key constraint to a cluster table on the cluster key columns whitout creating additional indexes.

Example:

CREATE CLUSTER CL1
(A NUMBER)
SIZE 100;

CREATE UNIQUE INDEX CICL1 ON CLUSTER CL1;
gives

ORA-01715: UNIQUE may not be used with a cluster index

CREATE INDEX CICL1 ON CLUSTER CL1;

CREATE TABLE CLT1 (A NUMBER,B NUMBER,primary key (A) using index cicl1) CLUSTER CL1 (A)
gives

ORA-14196: Specified index cannot be used to enforce the constraint.

CREATE TABLE CLT1 (A NUMBER,B NUMBER, primary key (A)) CLUSTER CL1 (A)

creates an additional system generated index SYS_C....

Is there any way to utilize the cluster key to ensure the uniqueness/primary key constraint of the cluster key columns of table CLT1 ?

View 3 Replies View Related

ORA-02270 / No Matching Unique Or Primary Key For Column-list

Jan 14, 2013

I'm trying to make a foreign key against a table which has a unique index instead of a primary key.

i get this error:

Error SQL: ORA-02270: no matching unique or primary key for this column-list
02270. 00000 - "no matching unique or primary key for this column-list"
*Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement gives a column-list for which there is no matching unique or primary key constraint in the referenced table.

my question is (i've searched several times with no results) can i create a foreign key with a table wich has no primary key but a unique index ?example:

CREATE TABLE TABLE1(
IDTABLE1 NUMBER(5),
NAME VARCHAR2(30)
);
CREATE TABLE TABLE2(

[code]....

or TABLE1.IDTABLE1 must be a 'Primary Key' instead of unique index ?I know it should be primary, but i need to know if it would work with the index somehow. The reason is i'm migrating a large database and the original structure in mysql uses fk with indexes and no pks in some tables (48 to be precise)

View 11 Replies View Related

Server Utilities :: ORA-02270 / No Matching Unique Or Primary Key For Column-list

Jul 6, 2010

I was cloning a schema user1 as user2 in the same database.

user1 had quota on 2 tablespaces user1_data and user1_index.

I created user with name as user2.

I created tablespace user2_data only and granted user2 unlimited quota on that tablespace only (did not grant him 'resource' role or unlimited tablespace privilege) Now exported user1 schema as follows

exp system/<passowrd> file=/u05/oradata/dump/user1_schema.dmp log=/u05/oradata/dump/user1_schema_exp.log owner=user1 rows=y constraints=y triggers=y indexes=y statistics=none recordlength=65535 compress=no consistent=n grants=y

then imported in in user2 schema as follows

imp system/<password> file=/u05/oradata/dump/user1_schema.dmp log=/u05/oradata/dump/user2_schema_imp.log fromuser=user1 touser=user2 rows=y constraints=y indexes=y statistics=none recordlength=65535 grants=y

during import i encountered following errors for so many constraints

"ALTER TABLE "table2" ADD CONSTRAINT "constraint_name1" FOREIGN KEY ("CTR_ID") REFERENCES "table1" ("CTR_ID") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 2270 encountered
ORA-02270: no matching unique or primary key for this column-list
IMP-00017: following statement failed with ORACLE error 2270:

I found that the it happened as the primary key of table1 was not created for which error was logged in the log file

. . importing table "table1" 19441 rows imported
IMP-00015: following statement failed because the object already exists:
"ALTER TABLE "table1" ADD CONSTRAINT "T1_PK79" PRIMARY KEY ("CTR_"
"ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 F"
"REELISTS 1 FREELIST GROUPS 1) TABLESPACE "USER1_INDEX" LOGGING ENABLE "
. . importing table "table5" 0 rows imported

However, I checked that the T1_PK79 does not exist in the user2 schema though it exists in user1 schema Neither the index for priamry key (T1_PK79) existed in user2 schema not the table <table1> existed before this import Then what could be the reason that I am getting an error "IMP-00015: following statement failed because the object already exists"?

I assume tablespace for index would not be an issue here as other indexes got created properly in user2_index tablespace during this import.

I tried this twice, once with user2 schema and then with user3 schema as well (with different tablespace), but result is the same.

There were no users connected to the database during export and no background jobs were modiying any data in schema user1 while export.

View 4 Replies View Related

Performance Tuning :: How Expensive (speed) Is Unique Versus Primary Key In Large Table

Aug 15, 2011

I have two design alternatives and need to understand how expensive (speed) is one of them against the other for a medium size table (100K-200K records):

create table xyz
(
f1 number not null,
f2 varchar2(20) not null,
f3 number not null,
f4 varchar2(50),

[code]....

the idea is to optimize the design by using a PK instead of the 3 keys and there is a debate that searching a unique index field(2nd scenario) is of the same speed than searching a PK field (1st scenario).

View 5 Replies View Related

SQL & PL/SQL :: Primary Constraint On Table Affecting Procedure To Insert Rest Of Rows In Table?

Jun 12, 2012

primary key constraint on transaction_dtl_bk is affecting the insertion of next correct rows.

CREATE OR REPLACE PROCEDURE NP_DB.san_po_nt_wnpg_1 (
dt DATE
)
IS
v_sql_error VARCHAR2 (100); -- added by sanjiv
v_sqlcode VARCHAR2 (100); ---- added by sanjiv added by sanjiv

[code]...

View 2 Replies View Related

SQL & PL/SQL :: ROW-00001 / Cannot Allocate Memory

Feb 28, 2012

I am facing this error in my application page

OraOLEDB(0x80040E14)
ROW-00001
Cannot allocate memory

View 5 Replies View Related

SQL & PL/SQL :: Inserting Row From Table1 To Duplicate Table2

Aug 3, 2010

there are a number of ways I can do this, but I'm just posting this here incase any of you plsql experts know of the best way to program this.

Basically I have 2 tables

INT_CASH_RECORDS

TMP_CASH_RECORDS

Both these tables have exactly the same number of fields and field types - both tables are literally the same. The primary key in both tables is a field called 'cash_id'

How can I transfer a record from INT_CASH_RECORDS into TMP_CASH_RECORDS based in a cash_id, I'm looking for the query string, something like

insert into tmp_cash_records (select * from int_cash_records where cash_id='3342' ...)

View 10 Replies View Related

Windows :: ROW-00001 / Cannot Allocate Memory

Mar 6, 2006

We are using Oarcle 10G release and IIS-6 in our web application.

After moving to oracle 10G we started getting this error

ROW-00001: Cannot allocate memory

now and then. If we restart, the problem gets resolved.

Applications stability is broken because of this.

View 11 Replies View Related

PL/SQL :: Update Two Columns In TABLE2 From TABLE1

Jan 25, 2013

I know this is a simple question for some of you, but I am new to SQLs,

I have two tables TABLE1 & TABLE2 as below, both tables contains more then 50million records:

SELECT * FROM TABLE1.
&&&&&&&&&&&&&&&&&&&&&&&&&&&
ID                        BUS_FID                WORKID                  STATIONID                 
---------------------- ---------------------- ---------------------- ----------------------
28400000117234         245                    13461428.25           16520877.8            
28400000117513         403                    13461428.25           16520877.8            
28400000117533         423                    13461428.25           16520877.8            
28400000117578         468                    13461428.25           16520877.8            
28400000117582         472                    13461428.25           16520877.8            

SELECT * FROM TABLE2.
&&&&&&&&&&&&&&&&&&&&&&&&&&&
BUS_FID                    ID                 TRPELID                RELPOS                 WORKID                 STATIONID               
---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ----------------------
114                    28400000117658         28400000035396         23.225                                                              
115                    28400000117659         28400000035396         23.225                                                              
116                    28400000117660         28400000035396         23.225                                                              
117                    28400000117661         28400000035396         23.225                                                              
118                    28400000117662         28400000035396         23.225                                                              
119                    28400000117663         28400000035396         23.225                                                              
120                    28400000117664         28400000035396         23.225                                                              

[Code]....

Now I tried to use following SQL to update WORKID & STATIONID columns in TABLE2 but failed. BUS_FID in both tables have been UNIQUE indexed and they can be used as primary keys to join these two tables.

UPDATE (
  SELECT  p.WORKID px,
          p.STATIONID py,
          p.BUS_FID pid,
          temp.WORKID tempx,
          temp.STATIONID tempy,
  
[Code]....

with above code, Oracle returned following errors:

SQL Error: ORA-00904: "TEMPID": invalid identifier
00904. 00000 -  "%s: invalid identifier"

BTW, both two tables contains over 50 million records. So, if you have a better SQL to perform the same task.

View 6 Replies View Related







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