Truncate while Inserting

Advertisement
This is a general question, but specific to Oracle as well.
1. What happens if I truncate a table which is being inserted into?
a. Will I be able to truncate it ?
b. What if the other process has the table locked?
c. What happens if I issue a truncate command and then another process starts to insert data into this table?
d. Do I have to exclusively lock a table used by multiple processes in order to truncate it so that a,b,c do not occur?
thanks
Advertisement

Replay

1. What happens if I truncate a table which is being inserted into?
r.- if the table is not completely unlock you will not be able to perform the truncate. In other words, if the insert comes first you will not be able to truncate the table until that insert be committed and if the insert comes when the truncate is gettting processed the insert fails. when you are carrying out a truncate the table takes an exclusive lock of its complete structure.
Joel Pérez
http://otn.oracle.com/experts

Error while inserting spatial data

Hi All, I have a problem while inserting spatial data. could some one please help me in solving this. I have creatd a table with spatial index. INSERT INTO USER_SDO_GEOM_METADATA             VALUES('SDO_CA_test', 'CA', SDO_DIM_ARRAY(                

Row Level Locking while inserting a record.

It is a good practice to lock the whole table or do the row level locking while performing any DELETE / UPDATE / MODIFY actions on a database table. Is it necessary to do the same thing while inserting a record via INSERT statement? One point may ari

HT4623 i have updated my iphone to ios 6.0.1 but it is not activating so please could you help me out....while inserting in itunes it showing no sim card inserted

i have updated my iphone to ios 6.0.1 but it is not activating so please could you help me out....while inserting in itunes it showing no sim card insertedAll iPhones sold in Japan are carrier locked. The Japanese carriers do not offer unlocking. You

Issue while inserting a BDC program in Inbound Proxy.JDBC-- PI-- SAP.

The scenerio is jdbcsender-sappi-inboundproxy(ECC6.0). The issue is related to SAP Plant Maintenance Module where  We have a requirement for creating Maintenance item programmatically from (SQLDatabase)Legacy Data for one of the interface. since ther

Error while insert data using execute immediate in dynamic table in oracle

Error while insert data using execute immediate in dynamic table created in oracle 11g . first the dynamic nested table (op_sample) was created using the executed immediate... object is CREATE OR REPLACE TYPE ASI.sub_mark AS OBJECT ( mark1 number, ma

Error while inserting record in Key-Flex Values Set interface

Guys on 11.5.10.2 Actually the problem is being occurred while inserting value in Job Flex Field Value set, we have created two segment for job key flex filed, No and name, it was working fine, but since we have uploaded bulk data via api "fnd_flex_v

Iam getting error while insert .

HI every one , i getting error while doing insert data into backend table.the error is like this , could you clarify is it possible to change the lookup of sappd1db to other. Object not found in lookup of SAPPD1DB.Hi Eswar, go to J2EE perspective..ex

SQL in ODI procedure truncated while execution

My repsoitory is upgraded from Sunopsisv3 to ODI 10.1.x . I was trying to execute the package . There is a procedure with a SQL in it. While executing it works fine sometimes and sometimes it errors out saying Syntax error or table alias not found .W

Date pblem while inserting into table

hi i have table with fields USERID VARCHAR2(20) TIMEEMTRY DATE EVENTID VARCHAR2(20) TERMINALSN VARCHAR2(20) FSHIFTIN DATE while i try to insert using the following statment INSERT INTO TEmPATT VALUES ('16',to_date('19/04/2007 7:47:26 PM','DD/MM/YYYY

Short Dump while INSERTING to a DB Z table

There is one report that we are running in production. Earlier it was taking about 2hrs to run and now it's taking about 14-15 hours to run after we applied the Support Pack. I must agree that the report is not well written by the previous developers

Problem with JDBC Recever adapter while inserting the Hebrew charecters

HI All, I am using the JDBC adapter at reciver side. While I am inserting any hebrew charecters in database table all are getting converted into ?????? for this Do I need to use any specific datatype? Please suggest... Best Regards ManishHi, What it

Problem while inserting Latin characters

Hi All, Version details 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 Solaris: Version 10.2.0.4.0 - Production NLSRTL Version 10.2.0.4.0 - Production

Error while insert into database using DB adpater for Field BLOB

Hello All I am trying to tranfer data from Database A to Database B using Oracle DB adapter. Table of databse A contains field BLOB, which cotains the resume /doc file.After transformation in Database B format ,while invoking the DB adapter to insert

How to get ALL validate-errors while insert xml-file into xml_schema_table

How to get all validate-errors while using insert into xml_schema when having a xml-instance with more then one error inside ? Hi, I can validate a xml-file by using isSchemaValid() - function to get the validate-status 0 or 1 . To get a error-output

Alv out put was truncated while giving print

hi, I have developed one alv report. while giving out put for print last columns are truncating. How to handle this? Thanks in advance,Hi, There can be many reasons. What is the width of your output list? Many printers takes 255 characters width. Che

Deadlock issue in while inserting in oracle table.

I have written a procedure which copy data in to oracle tables.Other user can also start inserting in that table so to prevent these intervention. i have applied locks on these two tables and assume that my procedure will wait for other users to fini

Error while inserting into blob column through PL/SQL

Hi All, I am trying to insert into column having blob as datatype. INSERT INTO imagedb(image_name, content,description) VALUES ('logo.png', ?{file 'c:\logo.png'}, 'logo'); it gives me error Unknown JDBC escape sequence: Is there anything wrong in abo

While inserting/importing new css in main stylesheet css dialogue box

Hi, i am trying to insert/import css in main style sheet. but every time i am doing it it is showing this dialogue box. Can anybody please help me in fixing this issue? I am using dreamweaver 5.5 version. thank you kind regards swatiPlease copy & pas

Error while insert

INSERT INTO emp_hist(EMP_NO,FROM_date,TO_date,last_updated_date ) VALUES ('IS871',1,'1/1/1900','12/31/9999',SYSDATE) I am getting the error ORA-01843: not a valid month> INSERT INTO emp_hist(EMP_NO,FROM_date,TO_date,last_updated_date VALUES ('IS871',