PL/SQL :: Is Updating A Non-indexed Column Slower

Oct 7, 2013

I have learnt that indexes slow down the DML operations. My question is specific to an update statement. Is it going to be slower if Im trying to update an indexed column on my table or it is slower overall (even when a non-indexed column is getting updated in the table) How does it behave in case of inserts & delete operation. 

View 4 Replies


ADVERTISEMENT

PL/SQL :: ORA-01408 - Such Column List Already Indexed?

Feb 28, 2013

when am trying to add constraint in my table am geting this error ORA-01408: such column list already indexed

View 2 Replies View Related

SQL & PL/SQL :: Updating Column In Every Row Except For The First

Jan 16, 2012

I am trying to find a way to update all of the rows in a table for a column EXCEPT for the very first row. I am not sure if this can be done while I enter my SET parameter or not. I have also thought about using an EXCEPTION in a stored procedure. For example, say I have the table listed below:

SQL> select * from example1;

CODE1 I_ID CODE2 J_ID NAME1 DATE1
----- -------------------- ----- -------------------- -------------------------------- ---------------
A 100 A 200 John 20111225
A 100 A 300 John 20111225
A 100 A 500 John 20111225
A 100 A 400 John 20111225
A 100 A 250 John 20111225
A 100 A 700 John 20111225
A 100 A 800 John 20111225
A 100 A 900 John 20111225
A 100 A 1000 John 20111225
A 100 A 1150 John 20111225
A 100 A 1275 John 20111225
A 100 A 3000 John 20111225

12 rows selected

I am wanting to update the table so that if there were more than 3 J_id's on the table for the same I_id then it will set all of the code1's and code2's to a C except for the very first one. Such as:

SQL> select * from example2;

CODE1 I_ID CODE2 J_ID NAME1 DATE1
----- -------------------- ----- -------------------- -------------------------------- ----------------
A 100 A 200 John 20111225
C 100 C 300 John 20111225
C 100 C 500 John 20111225
C 100 C 400 John 20111225
C 100 C 250 John 20111225
C 100 C 700 John 20111225
C 100 C 800 John 20111225
C 100 C 900 John 20111225
C 100 C 1000 John 20111225
C 100 C 1150 John 20111225
C 100 C 1275 John 20111225
C 100 C 3000 John 20111225

12 rows selected

I have done some searches and haven't seen any results.

View 12 Replies View Related

SQL & PL/SQL :: Updating Nth Row And Adding Column

Aug 7, 2012

I had created a table which have 100s' of entries in it.

create table reg_user
(
USERNAME VARCHAR2(50),
PASSWORD VARCHAR2(20)
)
***

[Code]..

1. In this table, how to update the Nth row, how can I do it

2. Now I need to add USERID in this table,which will get value from 1 to max no. of rows. I do not want to drop the table and again re create it adding USERID or update each row manually. Is there any other way to add USERID and have IDs from 1 to max IDs.

View 30 Replies View Related

PL/SQL :: Updating Column Value If Any DML Operations Done

Apr 12, 2013

I created a table with a column "id" and values for this column is attached a sequence. And now i need, if any value deleted from the table the column "id" will need to be sequence.

ex:

id name
-- -------
1 xxxx
2 yyyy
3 zzzzz
4 pppp
5 rrrrrr

if i delete

delete from test where id=4;

then automatically.. "id" column values will again in sequence... like this

id name
-- -------1 xxxxx
2 yyyyy
3 zzzzzz
4 rrrrrr

note: in the above if i delete the id=4 from the table again it will have be in sequence and if i inserted the again it has to take the next value continue to sequence....

ex : insert to test values(seq_name.nextval,'tttt');

id name
-- -------
1 xxxxx
.
.
.
4 rrrrr
5 ttttt

View 5 Replies View Related

Why Production Server Slower Than Development Workstation

Jun 24, 2008

I have a JSP that works with an Oracle 9i database.

On my local windows workstation where I developed the JSP the application processes very quickly working with the Oracle database. The JSP application on the Production Intranet web server connecting to the same Schema processes very slow sometimes during the day. During off hours the Production Intranet JSP with Oracle processes quicker.

There is only one user for the application and I dont understand why the same application using the same database runs so much slower sometimes on the production server compared to my local workstation.

View 1 Replies View Related

Expdp Slower After 11gR2 Database Upgrade?

Aug 6, 2012

After upgrading 11gR1 database (11.1.0.7.0) to 11gR2 (11.2.0.3.0), the datapump exports have been taking quite a bit longer. When database was 11gR1, a full expdp took approx. 40-45 minutes. After upgrade, it takes approx. 1 hour 40-50 minutes. These times were with parallel=4. I tried with parallel=8 and parallel=12, both of these took around 1 hour 5-10 minutes, better but still quite a bit slower than pre-11gR2 upgrade. I tried with exclude=statistics, index_statistics, indexes; it still took approx. 1 hour 40-45 minutes. This is a PeopleSoft database so there are many, many objects to be exported. The database was upgraded using dbua.

View 1 Replies View Related

SQL & PL/SQL :: Query Gets Slower By Adding Order By Clause

Apr 14, 2010

I have a query, running the query with order by and without orderby clasue casues big performance difference.

here without order by it takes 5 sec
.
SELECT
audit_number,
formatted_audit_number,
ag.sys_audit_id,
audit_begin_date,
audit_end_date,

[Code]....

here with order by it takes 2 min

SELECT
audit_number,
formatted_audit_number,
ag.sys_audit_id,
audit_begin_date,
audit_end_date,
auditee_name,
ein,

[Code]....

I have like 10,000 records.

View 16 Replies View Related

Updating A Table Column Which Is XML Datatype

Nov 1, 2011

I am updating a table column which is xml datatype and am getting above error.Below is the process what i did. since the xml is too large i split them into small chunks.

DECLARE
conditionXML CLOB;
ls_xml_2 Clob;
ls_xml_3 clob;
ls_xml_4 Clob;
ls_xml_5 Clob;
ls_xml_6 clob;
ls_xml_7 Clob;
[code]...

View 1 Replies View Related

Forms :: Updating BLOB Column

Mar 11, 2012

I am using Forms 6i,From my Form, user selects "sno" and upload BLOB image through OAF Upload utility. It stores the rowid of "SNO" and image...into Table "t1"...Now, i want to update the BLOB image into the original table"t2" using rowid..For this , i wrote the rowlevel trigger on Table "t1", in the trigger, i called a Procedure...In that procedure .. i am trying to update the BLOB column..It is not updating the BLOB column..But it is updating the Other values.. except BLOB column.

View 1 Replies View Related

Updating A Column Of A Table With 70,000,000 Records

Aug 1, 2012

I need to update column of a table with +,- 70,000,000 records.

If I perform an update it lasts......too much and does not finish!

View 6 Replies View Related

Updating Long Data Type Column

Aug 31, 2010

I have a task to update one of the rows in a table (having only 2 columns, number and long) which is long data type. We are on Oracle 10g. Not sure how to use update for a long data type column.

I have tried using dbms_metadata_util.long2varchar, but still not getting what I want.

View 2 Replies View Related

SQL & PL/SQL :: Updating Current Column With Previous Columns?

Dec 22, 2011

I need to update the current column with sum of the previous column values. Following are the creation scripts

DROP TABLE TEST_LOG;
CREATE TABLE TEST_LOG
(

[Code]....

Above query is working fine to retrieve the previous column values.But when we are updating the SUM_PRE_COLS column with those values it's not working fine.

I tried by using the following query

UPDATE TEST_LOG T SET SUM_PRE_COLS =
( SELECT LAG(T2.KEY0, 1, 0) OVER(ORDER BY T2.KEY0) + LAG(T2.KEY1, 1, 0) OVER(ORDER BY T2.KEY0)
FROM TEST_LOG T2 WHERE T2.ROWID= T.ROWID);

View 5 Replies View Related

Forms :: Formula Column Value Not Updating In Table?

Sep 5, 2011

I create the sample for master/detail form. In detail for prdcode,rate,qty,amount is there. When select prdcode it fetching prdcode,rate in a record and if you type the qty the amout will come based on formula(property) :qty*:rate.

It is available on screen. But when i store the data, in backend table the amount is be a null.

View 9 Replies View Related

SQL & PL/SQL :: Updating Column With Unique Values Without Using Sequences

Apr 17, 2013

i am having a table with out pk along with data.

Now , i need to add one column to that table , and update this column with the sequence no

like 1,2,3...... upto the max no of records. but i have to do this with out using a sequence.

how can i do.

View 1 Replies View Related

SQL & PL/SQL :: Updating Table With Sequentially Changing Column Name?

Aug 9, 2012

I am trying to update all rows of 100 column of a table with '0'. The column name is sequentially increasing one like EMP_1,EMP_2,EMP_3, etc. I tried using the below code but I am getting ora-06550 and ora-00927 error's.

begin
FOR i in 1..100 loop
UPDATE EMP_DETAILS SET EMP_'||i||' =0
END LOOP;
COMMIT;
END;

View 6 Replies View Related

PL/SQL :: Updating A Column Randomly With Selected Values?

Sep 26, 2013

 We've an accounts table that basically represents hotel chains & brands. an example shown below. 

account_id chain_id brand_id  service1              
NULL     NULL          111              
NULL     NULL          122              
NULL     NULL           11

 Here I want to update the chain_id & brand_id which are currently NULL in order to make every row eligible for further processing.

There is another table(say chain_brand) which maintains the relationship between chain_id and brand_id. one chain_id can have multiple brand_ids eg.,

chain_id  brand_id         
101     2011          101    
2012          102     2020 

Now I need a script that could randomly pick values from chain_brand table and update the accounts table. condition is those values should be unique for an account_id eg., 

account_id chain_id brand_id service1              
101          2011     111               101         
2011     122               102          2020     11 

so each account can be attached to only one chain_id and one brand_id.

View 2 Replies View Related

SQL & PL/SQL :: IOT Table Can Have More Than One Non-PK Indexed Columns

Jul 27, 2011

IOT Table can have more than one non-PK indexed columns.

View 6 Replies View Related

Forms :: ORA-01461 When Updating A LONG-Column Via Trigger

Jul 5, 2010

I have a non-base-table item which I want to update in the pre-update trigger of the current block.

If the content of the field exceeds 4000 characters, i get the error message

ORA-01461: can bind a LONG value only for insert into a LONG column.

The code is

update tab set long_col = :formsblock.long_col
where tab.tabpk = :formsblock.foreign_tabpk;

Workarounds would be,
1.) to delete the old dataset and insert the new one:

delete from tab
where tab.tabpk = :formsblock.tabpk;

insert into tab (tabpk, long_col) values
(:formsblock.foreign_tabpk, :formsblock.long_col);

or 2.) to change the Item from a non-database item to a database item and use the internal update of the forms-module, but both workarounds are not very satisfying.

Do you know another way to update the LONG-column within the pre-update trigger (or any other PL/SQL part of forms)?

View 2 Replies View Related

SQL & PL/SQL :: Are NULLs Indexed In BITMAP Indexes

Jul 24, 2012

Are NULLs get indexed in bitmap indexes? How can I verify that.

View 3 Replies View Related

Performance Tuning :: Full Tablescan Even Though Join Is On Indexed Field

Oct 18, 2010

I am posting the below query:

SELECT PEA.INCURRED_BY_PERSON_ID AS PERSON_ID,
PEA.EXPENDITURE_ENDING_DATE AS WEEK_END_DATE,
CASE

[Code].....

The explain is below:

SELECT STATEMENT ALL_ROWSCost: 48,287 Bytes: 18,428,818 Cardinality: 297,239
3 HASH JOIN Cost: 48,287 Bytes: 18,428,818 Cardinality: 297,239
1 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURES_ALL Cost: 2,964 Bytes: 3,506,094 Cardinality: 194,783
2 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURE_ITEMS_ALL Cost: 43,425 Bytes: 26,637,468 Cardinality: 605,397

View 9 Replies View Related

Server Administration :: How To Find Non-indexed Queries And Columns That Require Indexes

Sep 1, 2011

How to find non-indexed queries and columns that require indexes?

View 3 Replies View Related

Updating Table With Same Key?

Nov 19, 2008

I am using oracle 9i, and having trouble with updating a table.

I get ORA-00001(unique constraint) Error on executing the sql below; I know sql below is little strange( which use unique key in 'SET' statement) . but It worked on My Oracle Server. but it didn't on Client's.

why this error occurs or why this error did not occur on my PC,

[Update sql](key is CD and SDATE)
Update TBL1
set CD = 'A',

[Code]....

View 4 Replies View Related

Updating Using Subqueries

Oct 26, 2010

i was just working on one of my SQL assignments from my database management course, and thus far, this is the first that I just can't figure out. The question is:

Quote: Increase the credit limit of any customer who has any order that exceeds their credit limit. The new credit limit should be set to their maximim order amount plus $1,000. This must be done in 1 SQL statement

The bolded part is what I'm having trouble with.

What I have thus far:

UPDATE Customers
SET    CreditLimit = 1000 + (SELECT MAX(Amount) FROM Orders,  Customers WHERE Cust = CustNum)
WHERE CustNum IN (   
                   SELECT Cust
                   FROM Orders
                   WHERE Cust = CustNum
                   AND CreditLimit < Amount); 

So there's two tables that I'll be working with, Customers (the table I'm updating), and Orders (the table where the order amount is found). With the code I have so far, it does seem to be updating the correct tables at the very least, but not with the correct values. It's essentially updating the CreditLimit column with the new value of 1000 + the maximum amount in the order table, which is very close to what I want it to do, but I want it to be 1000 + the maximum amount for that specific customer.

CustNum is the primary key for the Customers table, and Cust is the foreign key that links each together.

(about the formatting, it looked much prettier in SQL Worksheet Plus)

View 8 Replies View Related

SQL & PL/SQL :: Updating CLOB Value?

Nov 9, 2011

create table top_uid(oldUID number,newUID number);

select * from top_uid;

OLDUID NEWUID
---------------------- ----------------------
1 1001
2 1002
3 1003
4 1004

create table topdUIDXML (uidinfo clob);

insert into topdUIDXML select '<filter name="test" topologyUID="1">' from dual;
insert into topdUIDXML select '<filter name="test2" topologyUID="2">' from dual;
insert into topdUIDXML select '<filter name="ftest" topologyUID="3">' from dual;
insert into topdUIDXML select '<filter name="qtest" topologyUID="4">' from dual;

select * from topdUIDXML

UIDINFO
---------------------------------------
<filter name="test" topologyUID="1">
<filter name="test" topologyUID="2">
<filter name="test" topologyUID="3">
<filter name="test" topologyUID="4">

the topdUIDXML table will contain the oldUID's in the clob XML. need to update the topologyUID in that topdUIDXML with the newUID from the top_uid.

View 5 Replies View Related

SQL & PL/SQL :: Updating CLOB

Apr 21, 2011

Ok, CLOB columns are such a hassle.

I have a variable in my script: v_field1 VARCHAR2(32000);

This is part of a cursor record:

v_mf_table IS TABLE OF mf_detail%ROWTYPE INDEX BY BINARY_INTEGER;
v_mf_record v_mf_table;

I use a FORALL to insert the data into a table:

FORALL x IN v_mf_record.FIRST .. v_mf_record.COUNT
INSERT INTO monthly_mf_snapshot VALUES v_mf_record(x);

BUT! v_field1 is > 4000 characters. Does this trash my changes of using FORALL? Do I need to deal with 4k chunks in an UPDATE instead?

View 30 Replies View Related

SQL & PL/SQL :: Updating On Select?

Jun 15, 2010

I have two tables,
CREATE TABLE repos
(
rep_key VARCHAR(10) NOT NULL,
base_term VARCHAR(100) NOT NULL,
blt_key INTEGER NOT NULL

[code]...

gloss table has the unique set of base_term as in repos. BLT_KEY will be primary_key in gloss and foreign key in repos.

Data in gloss table
BLT_KEY BASE_TERM

1 base1
2 base2
3 base3

Now, I need to update the BLT_KEY in gloss to matching entries in repos. Can I do that in a update on select statement? like,
UPDATE repos
SET blt_key = (SELECT gloss.blt_key
FROM repos,
gloss
WHERE repos.base_term = gloss.abase_term) This throws subquery returns more than one row.

And the end of update the repos table should look like,
REP_KEY BASE_TERM BLT_KEY

M001 base1 1
M002 base1 1
M003 base2 2
M004 base1 1

[code]....

Also I need a single query which can update on select as the no of records to be updated are more than 90000 in repos. So two step process would slow down the process

View 13 Replies View Related

PL/SQL :: Updating Records With Different IDs

Jun 6, 2012

Im looking for the posibility to update some records using new id with the column values with another id

example

the table contains these records:

id    gross      net

========================
7     0,1     0,0507749
8     0,2     0,1015499
9     0,5     0,2538748
10     0,83     0,4214
11     0,85     0,4315873

[Code]....

and I would like insert the same gross and net column values of ids 7 to 16 into columns with the ids 40 to 49 in the same order. therefore I would like to obtain the result that I describe below:

id    gross      net

========================
7     0,1     0,0507749
8     0,2     0,1015499
9     0,5     0,2538748
10     0,83     0,4214
11     0,85     0,4315873

[Code]....

View 4 Replies View Related

Updating Two Table Via SQL Loader

Jun 27, 2011

I am trying to write a control file that will read information from two INFILES and update two tables with the different information via SQL Loader. I am using Oracle 11g on Linux. i am not sure how to take the result from the first insert query and use it as input to the second insert query. Currently I have the following control file:

LOAD DATA
INFILE 'table1.dat'
INFILE 'table2.dat'
APPEND
INTO TABLE table1
WHEN tid='1'
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
(pid "pid.nextval", p_fname, p_lname, tid)
[code]....

The pid in the second insert query should be taken from the pid generated in the first insert query. However, I do not know how to do this. Does SQL Loader run the first insert query for all entries in the table1.dat file and then the second insert query or will it do one record at a time? Here are my INFILES:

table1.dat
,John,Doe,1
,Joe,Smith,1

table2.dat
10,,abc,1,
11,,xyz,1,

The second field in table2.dat should be taken from the result of creating a record in the table1.dat. Is this something that can be achieved using SQL Loader? The first part of the control file is successful, I can see the table being updated with the contents on table1.dat, but the second query fails.

View 1 Replies View Related

Updating 15 Million Records

Jul 12, 2012

i'm using the below query to update a VOTER table with over 15million records but it's taking ages to finish. i am using 11gr2 on linux

the query:

MERGE INTO voter dst
USING (
SELECT voterid,
pollingstation || CASE
WHEN ROW_NUMBER () OVER ( PARTITION BY pollingstation
[code]........

View 6 Replies View Related







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