what is the difference between TRUNCATE and DELETE command
in SQL

Answer Posted / padmapriya

1) Delete create log files when it is deleted and occupy
more space of memory

Whereas Truncate will not create any log files and hence
much faster than delete.

2) Delete can be roll back whereas Truncate is autocommit.

3) When there is foreign key constraint even though there
is no data in child table Truncate cannot be done. only
when the constraint is dropped truncate can be executed.

Whereas though we have foreign key constraints if the child
table is deleted, then parent table can be deleted.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

if i write the procedure.. and other person make the changes in that code then where i find who is changing my procedure

1540


as a technical developer in oracle applications which type errors feced in your experience sofar

1905


What is auto invoicing? Explain : oracle accounts receivable

612


What are the standard concurent programs for auto invoice interface and customer interfaces? : oracle accounts receivable

624


What is Tax Categories?

1624






Could you please let me know the interfaces in OM / FA??

1734


Differentiate between transaction type and transaction source? : oracle accounts receivable

677


1)After defining value set we define list of values, I need to enter 1000 values with out entering manually, how will you do that? 2)what are the parameters we use in a concurrent program? 3)what is payroll processing? 4)In organization window after defining an organization and organization classification how to create a new item in the others button? 5)If there are 10 users, How to restrict the selected users not to access the forms?

1644


CREATE OR REPLACE procedure XXPROC_OPENINT(errbuf OUT VARCHAR2, retcode OUT VARCHAR2) AS --Cursor Declaration cursor inv_cur IS SELECT INVI.INVOICE_ID ,INVI.INVOICE_TYPE_LOOKUP_CODE ,INVI.INVOICE_DATE ,INVI.VENDOR_ID ,INVI.VENDOR_SITE_ID ,INVI.INVOICE_AMOUNT ,INVI.INVOICE_CURRENCY_CODE ,INVI.STATUS ,INVI.GROUP_ID ,INVI.SOURCE ,INVI.ORG_ID ,INVI.DESCRIPTION ,INVI.CREATION_DATE ,INVI.CREATED_BY ,INVL.INVOICE_ID ,INVL.LINE_NUMBER ,INVL.LINE_TYPE_LOOKUP_CODE ,INVL.DESCRIPTION ,INVL.ORG_ID ,INVL.INVENTORY_ITEM_ID ,INVL.ACCOUNTING_DATE ,INVL.AMOUNT ,INVL.CREATION_DATE ,INVL.CREATED_BY ,INVL.PO_HEADER_ID ,INVL.PO_LINE_LOCATION_ID ,INVL.ITEM_DESCRIPTION FROM XXAP_INVOICES_INTERFACE_STG INVI ,AP_INVOICE_LINES_INTERFACE_STG INVL WHERE INVI.INVOICE_ID=INVL.INVOICE_ID AND INVI.ORG_ID=INVL.ORG_ID; l_currency_code varchar2(25); l_flag varchar2(2); l_error_msg varchar2(100); l_err_msg varchar2(100); l_err_flag varchar2(10); l_count number(9) default 0; BEGIN for rec_cur in inv_cur loop l_count:=l_count+1; --Currency Code Validation BEGIN SELECT currency_code INTO l_currency_code FROM FND_CURRENCIES WHERE currency_code ='USD'; EXCEPTION WHEN others THEN l_flag:='E'; l_error_msg:='Currency Code Does not Exists'; fnd_file.put_line(fnd_file.log,'Inserting Data Into The Interface Table'||'-'||l_count||' '||l_error_msg); END; IF l_flag!='E' THEN fnd_file.put_line(fnd_file.log,'Inserting Data Into The Interface Table'); INSERT INTO AP_INVOICES_INTERFACE( INVOICE_ID ,INVOICE_TYPE_LOOKUP_CODE ,INVOICE_DATE ,VENDOR_ID ,VENDOR_SITE_ID ,INVOICE_AMOUNT ,INVOICE_CURRENCY_CODE ,STATUS ,GROUP_ID ,SOURCE ,ORG_ID ,DESCRIPTION ,CREATION_DATE ,CREATED_BY) VALUES (rec_cur.INVOICE_ID ,rec_cur.INVOICE_TYPE_LOOKUP_CODE ,rec_cur.INVOICE_DATE ,rec_cur.VENDOR_ID ,rec_cur.VENDOR_SITE_ID ,rec_cur.INVOICE_AMOUNT ,rec_cur.INVOICE_CURRENCY_CODE ,rec_cur.STATUS ,rec_cur.GROUP_ID ,rec_cur.SOURCE ,rec_cur.ORG_ID ,rec_cur.DESCRIPTION ,rec_cur.CREATION_DATE ,rec_cur.CREATED_BY); INSERT INTO ap_invoice_lines_interface ( INVOICE_ID ,LINE_NUMBER ,LINE_TYPE_LOOKUP_CODE ,DESCRIPTION ,ORG_ID ,INVENTORY_ITEM_ID ,ACCOUNTING_DATE ,AMOUNT ,CREATION_DATE ,CREATED_BY ,PO_HEADER_ID ,PO_LINE_LOCATION_ID,ITEM_DESCRIPTION) VALUES (rec_cur.INVOICE_ID ,rec_cur.LINE_NUMBER ,rec_cur.LINE_TYPE_LOOKUP_CODE ,rec_cur.DESCRIPTION ,rec_cur.ORG_ID ,rec_cur.INVENTORY_ITEM_ID ,rec_cur.ACCOUNTING_DATE ,rec_cur.AMOUNT ,rec_cur.CREATION_DATE ,rec_cur.CREATED_BY ,rec_cur.PO_HEADER_ID ,rec_cur.PO_LINE_LOCATION_ID ,rec_cur.ITEM_DESCRIPTION); END IF; l_flag:=NULL; l_err_MSG:=NULL; END LOOP; COMMIT; END XXPROC_OPENINT; / PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names

2488


Difference between transaction type and transaction sources. : oracle accounts receivable

571


Differentiate between earned discounts and unearned discounts? : oracle accounts receivable

668


QUESTION IS THAT DURING UPLOADING DATA IN PROD SERVER,OUR EQUIPMENT TAG NUMBERS ARE NOT MATCHING WITH SAP TAG NUMBERS SO DUE TO THIS WE ARE FACING PROB, BECAUSE WHENEVER ALARM IS COMING FROM SCADA DUE MISMATCH THE NOTIFICATION IS NOT CREATED IT IS GIVING ERROR. PLEASE SUGGEST THE METHOD SO THAT THE TAG NUMBERS OF BOTH (SCADA EQUIPMENT AND SAP EQUIP) SHOULD CONCIDE.OTHERWISE WE HAVE TO GO FOR LONG PROCESS EITHER BY INTERFACE TABLE OR BY EXPORTING ALL DATA AND MAKING RIGHT CHANGES.DO YOU HAVE ANY SHORTCT METHOD PL WRITE ME. THANKS

1641


How would you determine what sessions are connected and what resources they are waiting for?

1612


What is Restricted Mode of Instance Startup in Oracle?

673


My requirement is like in database some defects are present and i need to clean them.To be brief for example every employee should have active assigments.So for those records which are not having status as active or null ,i need to update the roecords using API with the correct value. Client will provide a flat file for the records whch are defected.So i need to run the API for those records (flat file)and update the data in database. So my question is how to handle this requirement.Is there any existing API for this purpose?If yes then please send me the NAME. How to update the records in the database using flatfile. Any pointer will be appreciated.Thanks in advance.

1741