Delete wrong commitment from COOI table
Hi,
I have a commitment on COOI table which is wrong.The commitment has Purchase Order whose line item does not exist in any MM tables.
How should i delete a commitment from the COOI table if i know only purchase order & line item as input parameter?
Thanks & Regards,
Andrew
no need to run any program or deletion from table. simple is to delete the purchase order/requistion, reverse ur funds commitement documenet. after system automtically delete from the table.
for deleting PR & PO, open the PR/PO in change mode, select the PR/PO Line item ony by one, then press the delete button .
system will not physical delete the line item. this is standard behaviour. but your commitement will be reversed.
I hope this will solve ur problem
Similar Messages
-
How to delete the data from partition table
Hi all,
Am very new to partition concepts in oracle..
here my question is how to delete the data from partition table.
is the below query will work ?
delete from table1 partition (P_2008_1212)
we have define range partition ...
or help me how to delete the data from partition table.
Thanks
Sree874823 wrote:
delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
How the table implements its structure is a physical design consideration.
Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
This is a crucial concept to understand and get right. -
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
How to restrict the user(Schema) from deleting the data from a table
Hi All,
I have scenario here.
I want to know how to restrict a user(Schema) from deleting the values from a table created in the same schema.
Below is the example.
I have created a table employee in abc schema which has two values.
EMPLOYEE
ABC
XYZ
In the above scenario the abc user can only fire select query on the EMPLOYEE table.
SELECT * FROM EMPLOYEE;
He should not be able to use any other DML commands on that table.
If he uses then Insufficient privileges error should be thrown.
Can anyone please help me out on this.Hi,
kumar0828 wrote:
Hi Frank,
Thanks for the reply.
Can you please elaborate on how to add policies for a table for just firing a select DML statement on table.See the SQL Packages and Types manual first. It has examples. You can also search the web for examples. This is sometimes called "Virtual Private Database" or VPD.
If you have problems, post a specific question here. Include CREATE TABLE and INSERT statements to create a table as it exists before the policies go into effect, the PL/SQL code to create the policies, and additonal DML statements that will be affected by the policies. Show what the table should contain after each of those DML statements.
Always say which version of Oracle you're using. Confirm that you have Enterprise Edition.
See the forum FAQ {message:id=9360002}
The basic idea behind row-level security is that it generates a string that is automatically added to SELECT and/or DML statement WHERE clauses. For example, if user ABC is only allowed to query a table on Sunday, then you might write a function that returns the string
USER != 'ABC'
OR TO_CHAR (SYSDATE, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN'So whenever any user says
SELECT *
FROM table_x
;what actually runs is:
SELECT *
FROM table_x
WHERE USER != 'ABC'
OR TO_CHAR (SYSDATE, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') = 'SUN'
;If you want to prevent any user from deleting rows, then the policy function can return just this string
0 = 1Then, if somone says
DELETE employee
;what actually gets run is
DELETE employee
WHERE 0 = 1
;No error will be raised, but no rows will be deleted.
Once again, it would be simpler, more efficient, more robust and easier to maintain if you just created the table in a different schema, and not give DELETE privileges.
Edited by: Frank Kulash on Nov 2, 2012 10:26 AM
I just saw the previous response, which makes some additional good points (e.g., a user can always TRUNCATE his own tables). ALso, if user ABC applies a security policy to the table, then user ABC can also remove the policy, so if you really want to prevent user ABC from deleting rows, no matter how hard the user tries, then you need to create the policies in a different schema. If you're creating things in a different schema, then you might as well create the table in a different schema. -
Deleting a row from parent table
Dear Guru's
I am having two table with parent - child relationship. My problem is when I am deleting a row from parent table the curresponding child row from child table also should be deleted.
My Primary table 'Employee, EMPID Primary key
Child table 'Privilage' inthis EMPID referencing the EMPID of Employee table
My need is when I am deleting a row from parent table the curresponding child row from child table also should be deleted
I issued the SQL query like,
delete from employee where empid='12345' cascade constraints;
Then it showing me error like,
ERROR at line 1:
ORA-00933: SQL command not properly ended
Please resolve my issue , Its Top urgent
Thanks & Cheers
AntonyChoosing How Foreign Keys Enforce Referential Integrity
Oracle Database allows different types of referential integrity actions to be enforced, as specified with the definition of a FOREIGN KEY constraint:
Prevent Delete or Update of Parent Key The default setting prevents the deletion or update of a parent key if there is a row in the child table that references the key. For example:
CREATE TABLE Emp_tab (
FOREIGN KEY (Deptno) REFERENCES Dept_tab);Delete Child Rows When Parent Key Deleted The ON DELETE CASCADE action allows parent key data that is referenced from the child table to be deleted, but not updated. When data in the parent key is deleted, all rows in the child table that depend on the deleted parent key values are also deleted. To specify this referential action, include the ON DELETE CASCADE option in the definition of the FOREIGN KEY constraint. For example:
CREATE TABLE Emp_tab (
FOREIGN KEY (Deptno) REFERENCES Dept_tab
ON DELETE CASCADE); Set Foreign Keys to Null When Parent Key Deleted The ON DELETE SET NULL action allows data that references the parent key to be deleted, but not updated. When referenced data in the parent key is deleted, all rows in the child table that depend on those parent key values have their foreign keys set to null. To specify this referential action, include the ON DELETE SET NULL option in the definition of the FOREIGN KEY constraint. For example:
CREATE TABLE Emp_tab (
FOREIGN KEY (Deptno) REFERENCES Dept_tab
ON DELETE SET NULL);
SQL> conn scott/tiger
Connected.
SQL> create table ppk ( no number primary key);
Table created.
SQL> begin for inn in 1..10 loop insert into ppk values (inn); end loop; end;
PL/SQL procedure successfully completed.
SQL> create table ffk ( no number references ppk(no));
Table created.
SQL> begin for inn in 1..10 loop insert into ffk values (inn); end loop; end;
PL/SQL procedure successfully completed.
SQL> drop table ppk cascade constraints;
Table dropped.Message was edited by:
user52
Message was edited by:
user52
Message was edited by:
user52 -
Deleting a row from a table containing CLOB as one of the columns
When i delete a row from a table which contains a CLOB (internal clob) i.e. CLOB or BLOB column, Will the CLOB data will also be deleted ? I understand that what exactly stored in the CLOB column is the clob locator which points to the actual data.
So, when I delete this row, the clob locator will be deleted, but will the actual data what this locator is pointing to is also deleted ??? if not what is the process to delete the data the locator is pointing to when the row containing the locator is deleted ? If this is not happening then the actual data might become an orphan data which nobody has access to, will automatic garbage cleaning occurs on a frequent intravels to delete unaddressed data residing on the database server ?
Thanks in advance for the help, can email me at [email protected] alternatively.
Regards,
Srinivasa C.Michael,
Thanks very much for your inputs, here are the results i got when i tried the way you explained in your answer, the TRUNCATE command made the actual size back to normal, but the delete is not the same, so, how can i delete the data that a particular clob locator may point to ?
truncate would delete all the rows of the table, which might not serve my purpose, i would like to delete a row and also it's associated clob data from the database! is there anyway to do this ?
is there any limitation on the ool_sample size? i am basically a c++ programmer, i am looking for some function like FREE which would free the allocated memory to the clob once the locator is deleted.
your help is greatly appreciated - Thanks!
:-) Srini.
==========================
My Results:
==========================
SQL> create table sample (
2 id integer primary key,
3 the_data CLOB default empty_clob() )
4 lob (the_data) store as ool_sample;
Table created.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
20K
SAMPLE
10K
SQL> select count(*) from sample;
COUNT(*)
0
SQL> begin
2 for i in 1..1000
3 loop
4 insert into sample values (i, RPAD('some data', 4000) );
5 end loop;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
6420K
SAMPLE
70K
SQL> delete sample;
1000 rows deleted.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
6420K
SAMPLE
70K
SQL> commit;
Commit complete.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
6420K
SAMPLE
70K
SQL> begin
2 for i in 1..1000
3 loop
4 insert into sample values (i, rpad('some data', 4000));
5 end loop;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
9616K
SAMPLE
70K
SQL> truncate table sample;
Table truncated.
SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
2 from user_segments
3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
4 group by segment_name;
SEGMENT_NAME
SOTRAGE_CONSUMED
OOL_SAMPLE
20K
SAMPLE
10K -
Issue while deleting a row from a table
Dear friends,
i am getting an issue while deleting a row from a table, pls check screen shots , the first screen shot is my table contents
when i delete 2 row , the second row is deleting properly like below screen shot
but i want like below screen shot , Col1 contents should be like pic 1 . could any one pls let me know how to solve this issue.
Thanks
VijayaHi vijaya,
please try this code, it will help you.
DATA : it_rows TYPE wdr_context_element_set,
wa_rows LIKE LINE OF it_rows.
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lt_table TYPE wd_this->elements_table.
DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA ls_vbap TYPE wd_this->element_table.
DATA: ld_index TYPE i.
data value TYPE sy-index.
* navigate from <CONTEXT> to <table> via lead selection
lo_nd_table= wd_context->get_child_node( name = wd_this->wdctx_table ).
* @TODO handle non existant child
* IF lo_nd_table IS INITIAL.
* ENDIF.
* get element via lead selection
* alternative access via index
* lo_el_table = lo_nd_table->get_element( index = 1 ).
* @TODO handle not set lead selection
IF lo_el_table IS INITIAL.
ENDIF.
* navigate from <CONTEXT> to <table> via lead selection
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
* @TODO handle non existant child
* IF lo_nd_table IS INITIAL.
* ENDIF.
lo_nd_table->get_static_attributes_table( IMPORTING table = lt_table ).
* @TODO handle non existant child
* IF lo_nd_table IS INITIAL.
* ENDIF.
** @TODO compute values
** e.g. call a model function
* navigate from <CONTEXT> to <table> via lead selection
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
* @TODO handle non existant child
* IF lo_nd_table IS INITIAL.
* ENDIF.
** @TODO compute values
** e.g. call a model function
it_rows = lo_nd_table>get_selected_elements( ).
CALL METHOD lo_nd_table->GET_LEAD_SELECTION_INDEX
RECEIVING
INDEX = value .
LOOP AT it_rows INTO wa_rows.
CALL METHOD wa_rows->get_static_attributes
IMPORTING
static_attributes = ls_table.
READ TABLE lt_table INTO ls_table WITH KEY col1 = ls_table-col1.
ld_index = value.
ENDLOOP.
CLEAR : ls_table-col2,
ls_table-col2.
MODIFY lt_table INDEX ld_index FROM ls_table.
lo_nd_table->bind_table( new_items = lt_table set_initial_elements = abap_true ). -
Delete a user from a table whose name is a foreign key in other tables
Dear All;
I am trying to figure out an easy way to do this. I just recently took someone application who utilized 500 tables. I am trying to delete a user from a table called member_table. However, I am having problems doing so because the user name is a foreign key in other tables which has a relationship with this member_table. I really can't naviagte through all 500 different tables and start deleting the user from each table . hence, I would like to figure out a way to delete the user from the member_table without getting the error message
ORA - 02292 "Integrity Constraint (....) violated child record foundUnless you want to find and re-create all of the FK's that point to that field so you can make them ON DELETE CASCADE (note it is the FK not the PK that has that attribute), you will need to either delete that member id from each of the child tables individually or update each one individually to either null or some valid value in member_table before you can delete the id from member_table.
You can find all of the tables, and the corresponding column_name that have an FK relationship to memeber_table with the following:
SELECT c.table_name, col.column_name
FROM user_constraints c, user_cons_columns col
WHERE c.constraint_name = col.constraint_name and
c.r_constraint_name = (SELECT constraint_name
FROM user_constraints
WHERE table_name = 'MEMBER_TABLE' and
constraint_type = 'P') and
c.constraint_type = 'R';If there are a lot of these, you could use something similar to generate the set of delete/update statements that would be needed.
John -
Best practice for deleting multiple rows from a table , using creator
Hi
Thank you for reading my post.
what is best practive for deleting multiple rows from a table using rowSet ?
for example how i can execute something like
delete from table1 where field1= ? and field2 =?
Thank youHi,
Please go through the AppModel application which is available at: http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
The OnePage Table Based example shows exactly how to use deleting multiple rows from a datatable...
Hope this helps.
Thanks,
RK. -
How to delete a record from BSEG table
Dear Experts,
How to delete a record from BSEG table.
If there possible to delete some records from transparent table ?
Please help.
Regards,
TanHi,
Deleting a record from a standard table can be done only if table maintenance exists - Cehck tcode - SM30. But it is not advisable to delete records, coz the records may be dependent on many other tables. If u delete in a single place, there may be chance that inconsistency in the data happens and hence will affect ur financial statements.
Pls. assign points, if useful
Regards,
Sridevi -
Delete a column from the table
Hi.
I would like to delete a column from a table. I want to drop the table and recreate it later. But this table has a primary key which
is a foreign key of other tables. So after I recreate the table I must recover the relationship of this table and other tables.
How do I get the information about the primary key of this table as a foreign key of other tables from data dictionary?
Thanks in advance
nullFor ur query the reply whay u have got is correct one. For further quries similar to one u had u can download a tool named TOAD (Tools for Oracle Application Developer) from quest site (www.quest.com). Install it a proceed.
Do let me know how and what u feek about TOAD. -
Delete many rows from one table at once URGENT
Assume we have table called emp.
table desription:
SQL> desc emp
Name Null? Type
EMPNO NOT NULL NUMBER(6)
DIVISION NOT NULL NUMBER(3)
JOB_NO NOT NULL NUMBER(4)
START_DATE NOT NULL DATE
select * from emp;
EMPNO--------DIVISION--------JOB_NO------------START_DATE
1111------------------011-------------8181--------------04/10/1999
1111------------------011-------------8181--------------04/10/2004
2222------------------011-------------3131--------------05/11/2005
3333-----------------022-------------8181--------------06/09/2001
3333-----------------044-------------8181--------------06/08/1988
5555-----------------011-------------8066--------------01/01/2001
6666-----------------033-------------9600--------------01/01/1999
7777-----------------044-------------8181--------------06/24/1996
7777-----------------033-------------8181--------------12/02/1991
7777-----------------033-------------8181--------------03/01/2002
9999-----------------044-------------9191--------------03/05/1980
9999-----------------055-------------9191--------------03/06/1989
My goal is to delete employee records for those employee which contains multiple values for JOB_NO
equal to 8181, (JOB_NO= 8181) with new start_dateS.
We need to keep only one record for JOB_NO 8181 which contains oldest start_date.
Here is the delete statement for the single record.
delete from emp
where empno = 7777 and job_no = 8181 and start_date in ('03/01/2002','06/24/1996);
So how could I delete thousands records from the table with this logic?
After deleting multiple records table should be as below:
select * from emp;
EMPNO--------DIVISION--------JOB_NO---------START_DATE
1111-----------------011-------------8181--------------04/10/1999
2222-----------------011-------------3131--------------05/11/2005
3333-----------------044-------------8181--------------06/08/1988
5555-----------------011-------------8066--------------01/01/2001
6666-----------------033-------------9600--------------01/01/1999
7777-----------------033-------------8181--------------12/02/1991
9999-----------------044-------------9191--------------03/05/1980
9999-----------------055-------------9191--------------03/06/1989Here's one way to do it. I think this fits your business rules. At least it matches the output for your first example. It uses an analytic. I just like using them.
SQL> select * from employees;
EMPNO DIVISION JOB_NO START_DATE
1111 11 8181 10-APR-1999
1111 11 8181 10-APR-2004
2222 11 3131 11-MAY-2005
3333 22 8181 09-JUN-2001
3333 44 8181 08-JUN-1988
5555 11 8066 01-JAN-2001
6666 33 9600 01-JAN-1999
7777 44 8181 24-JUN-1996
7777 33 8181 02-DEC-1991
7777 33 8181 01-MAR-2002
9999 44 9191 05-MAR-1980
9999 55 9191 06-MAR-1989
12 rows selected.
SQL> delete employees
2 where rowid in
3 (select rowid
4 from
5 (
6 select empno
7 ,job_no
8 ,start_date
9 ,row_number() over (partition by empno, job_no order by start_date) rn
10 from employees
11 where job_no = 8181
12 )
13 where rn > 1
14 )
15 ;
4 rows deleted.
SQL> select * from employees;
EMPNO DIVISION JOB_NO START_DATE
1111 11 8181 10-APR-1999
2222 11 3131 11-MAY-2005
3333 44 8181 08-JUN-1988
5555 11 8066 01-JAN-2001
6666 33 9600 01-JAN-1999
7777 33 8181 02-DEC-1991
9999 44 9191 05-MAR-1980
9999 55 9191 06-MAR-1989
8 rows selected. -
Delete a record from a table in a Database with Database Connectivity
I can't find the function from the Database Connectivity library that allows me to delete a record from a table of the database. I tried to use DB Tools Free Object.vi function but this one deletes only the table created with a query.
ThankyouI have used the sql query as described above and it works fine with access DB and the DB toolkit, the free object vi only deallocated a recordset's references this will noty alter the database since the record is a copy of the databases information. The SQL delete function is very versatile and you should be able to delete records with no problem.
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA -
Is it safe to purge / delete older records from AUD$ table in SYS schema
Hi,
Can we purge / delete older records from AUD$ table in SYS schema.
Please advice.
Thanks
NaveenPl see MOS Doc 73408.1 (How to Truncate, Delete, or Purge Rows from the Audit Trail Table SYS.AUD$) fro details on how to do so.
HTH
Srini -
Deleting Multiple Rows From Multiple Tables As an APEX Process
Hi There,
I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
BEGIN
UPDATE tblDebitNotes d
SET d.Paid = 0
WHERE 1=1
AND d.DebitNoteID = :P7_DEBITNOTEID;
INSERT INTO tblDeletedPayments
( PaymentID,
DebitNoteID,
Amount,
Date_A,
SupplierRef,
Description
VALUES
( :P7_PAYMENTID,
:P7_DEBITNOTEID,
:P7_PAID,
SYSDATE,
:P7_SUPPLIERREF,
:P7_DESCRIPTION
DELETE FROM tblPayments
WHERE 1=1
AND PaymentID = :P7_PAYMENTID;
END;
The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
However this process is not doing anything!! Any insights greatly appreciated.
Many thanks,
Gary....the "button" is using a page level Target,...
I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
Scott
Maybe you are looking for
-
How to i write a script that makes multiple selections in a pdf and exports them to excel?
I have a large number of PDFs Not all the PDFs contain information we need. We want to be able to automate a script that extracts certain info from the PDFs and opens them in a certain format in excel. Acrobat allows me to make a single selection and
-
I can't download ios7 I have a message under the software update saying I need at least 3.4gb of space, I have more than that!
-
No sound w/any game apps. Suggestions?
All games I've downloaded open w/o sound. Volume works fine w/music, videos, youTube, etc. Suggestions?
-
Hi Experts, I am not able to see the standard ALV toolbar to download the output to an Excel or local file..etc. I placed my ALV container on a screen below some I/O text boxes in display mode only. I also need to download the I/O text boxes. Can som
-
Final cut express 3 vs. final cut express 4??
I have an old ibook G4 with a 1.07 Ghz processor. I am currently updating my operating system from panther to tiger and installing about 512MB ram so that I can get final cut express. I am a student who is used to using final cut pro in class... but