PL\SQL to delete column base on dates and volume
I will like to delete from a perticular table base on dates and number of lines. I will appreciate a little help to write a simple stored procedure (plsql) to accomplish this?
Something like this:
delete from deleted_tables where STARTTIME = '01-SEP-09' AND ENDTIME = '01-JAN-10' AND NUM_of_LINES > 10000;
Hi
create or replace procedure delete_something ( p_start_date in date ,
p_end date in date ,
p_num_lines in number ) is
begin
delete
from deleted_tables
where STARTTIME = p_start_date AND ENDTIME = p_end_date AND NUM_of_LINES > p_num_lines ;
end;This could be according to your requests -- which are not enough defined in fact --
T
Similar Messages
-
I just got a new iPhone and i set up iCloud on my girlfriend's account. To change it on settings it says delete account. Will this delete her all her data and back up data for iCloud on her iPhone and iPad? Can i change it without deleting it? Please help.
Delete the account on your phone. This will not delete any data on her phone or iPad, or data stored in iCloud.
-
SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string. 'Received Alerts' (OAIB)
SELECT
CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
WHEN T0.DocStatus = 'C' THEN 'CLOSED' END AS 'Document Status',
T0.DocDate AS 'Posting Date',
T0.DocNum AS 'Doc.No',
T0.NumAtCard,
T0.TransId AS 'Trans. No.',
T0.Comments AS 'Remarks',
T0.CardCode AS 'Offset Acct',
T0.CardName AS 'Offset Acct Name',
sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
T3.DueDate AS 'Cheque Date',
T3.CheckSum AS 'Amount'
FROM ODPO AS T0 LEFT OUTER JOIN
VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
VPM1 AS T3 ON T2.DocEntry = T3.DocNum
where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'Hi,
Try this:
SELECT
CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
WHEN T0.DocStatus = 'C' THEN 'CLOSED' END AS 'Document Status',
T0.DocDate AS 'Posting Date',
T0.DocNum AS 'Doc.No',
T0.NumAtCard,
T0.TransId AS 'Trans. No.',
T0.Comments AS 'Remarks',
T0.CardCode AS 'Offset Acct',
T0.CardName AS 'Offset Acct Name',
sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
T3.DueDate AS 'Cheque Date',
T3.CheckSum AS 'Amount'
FROM ODPO T0 LEFT OUTER JOIN
VPM2 T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
LEFT OUTER JOIN
OVPM T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
VPM1 T3 ON T2.DocEntry = T3.DocNum
where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
group by T0.DocStatus,T0.DocDate ,
T0.DocNum ,
T0.NumAtCard,
T0.TransId ,
T0.Comments ,
T0.CardCode,
T0.CardName ,
T0.WTSum ,
T3.DueDate ,
T3.CheckSum
Thanks & Regards,
Nagarajan -
How do I delete duplicate songs? (date and time stamp are identical
I put my cd collection in itunes and now have duplicates of most songs (don't know how I did that). The duplicates have the exact same date and time, so the method to delete a "newer" duplicate will not work. Is there a simple way to delete exact duplicates from the itune library?
This application can help. It's US$15. http://dougscripts.com/apps/dupinapp.php
-
Deleted my "microsoft user data" and emptied trash! how to recover!!
I deleted my "microsoft user data" which contains everything to do with my entourage and then emptied the trash (not secure though). I know what was I thinking....I am running filesalvage. What do i do next in order to recover everything?? thanks!
First, you need to understand that it's highly unlikely the recovered data will be intact. The longer it's been since you deleted it and the more you've used the computer during that time, the less likely it is that you'll be able to recover 100% of the data.
This is because it's likely that the computer has written new data over the same sections of the hard drive that the old data used to occupy. This means that you may recover the folder only to find that Entourage tells you the database is "corrupt" or "unreadable" or something similar.
(Also - I encourage you to switch to Apple Mail and IMAP accounts for your email. Using IMAP, everything stays stored on your server so that you never lose your email, no matter what happens to your computer. For more information, google IMAP and read about it.)
Having said that, you'll find instructions for how to use FileSalvage at this website, roughly 2/3rds of the way down:
http://subrosasoft.com/OSXSoftware/index.php?mainpage=product_info&productsid=1
Good luck! -
I've been trying to delete things to make room for more storage but nothing is happening, it keeps saying that iCloud won't backup because there is too much storage. I only have a few apps and I've deleted things I don't use, but nothin is working. How do I fix this?
http://support.apple.com/kb/ht4847
-
In Oracle SQL, cannot use column in select statement and order by
Hi,
Is there a work around for this.
Thanks in advance
Pablo.Hi,
943981 wrote:
Hi All,
This is the error I get:
ORA-00960: ambiguous column naming in select list
00960. 00000 - "ambiguous column naming in select list"
*Cause: A column name in the order-by list matches more than one select
list columns.
*Action: Remove duplicate column naming in select list.
Error at Line: 6 Column: 17That error message looks pretty clear to me. What don't you understand?
Either
(a) use aliases, so each column has a unique name, or
(b) remove duplicate columns from the SELECT clause.
Post your query. It's hard to say exactly what you're doing wrong when we don't know exactly what you're doing.
For best results, post a complete test script (including CREATE TABLE and INSERT statements, if necessary) that people can to re-create the problem and test their ideas.
See the forum FAQ {message:id=9360002} -
Does deleting and recreating a iCloud account also deletes all it's Data and stuff?
If I sign in from another account, will all the paid apps be erased? Can I retrieve them? I doubt so because from my knowledge, when I updated for iOS 6 from 5, all my apps are gone.(my version is 7.0.3)
Correct -- a different account would have to start over regarding apps.
-
How to get SQL to read numbers as a date?
Hi
I have a database of orders. Each order has sub orders with date information, but in separate columns: day, month and year.
E.g. a sub order will have day = 1, month = 10, year = 2007 each in a different column
I want SQL to be able to concatenate the three columns into a date and then be able to select the 'min' of the dates.
Eventually I will group sub orders together into orders and want each order to also show the earliest sub order date.
Is there anyway I can do this? I'm not very experienced with SQL but it seems like it should be possible.
Thanks any help greatly appreciated.This is an Oracle SQL forum, it doesn't cover other flavors of SQL like MySQL, MS SQL etc. The function TO_DATE is an Oracle SQL function so if it doesn't exist then you must be using some other kind of SQL.
-
Steps to move Data and Log file for clustered SQL Server
Hi guys
we have Active'passive SQL 2008R2 cluster environment.
looking for steps to move Data and log files from user Database and System Database for SQL Server Clustered Instance.
Currently Data and log files resides on same drive for user and system Databases..
Thanks
Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.ShahTry the below link
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/468de435-3432-45c2-a50b-23519cd2686e/moving-the-system-databases-in-a-sql-cluster?forum=sqldisasterrecovery
-Prashanth -
Date and Days for all year come in column
Dear all
I have 2 Column 1 is Date and 2nd is Day
And i have one Button i need when i enter button then its show all year date in date column and day in day column for example
Date---------Day+
*1-jan-2009-Thursday*
*2-jan-2009-Friday*
*3-jan-2009-Saturday*
And As on
I hope you guys understand
Regards
Shahzaib ismailHai,
That means, You need to fill the multi record block which has 2 columns ( 1 is date, and the other is day.).
For that Try this in the WHEN-BUTTON-PRESSED Trigger of the Button.
DECLARE
Dt_Date DATE;
BEGIN
GO_BLOCK ('<block_name>');
CLEAR_BLOCK(NO_VALIDATE);
FIRST_RECORD;
Dt_Date := TO_DATE('01-JAN-2009');
LOOP
:<block_name>.TI_DATE := TO_CHAR(Dt_Date, 'DD-MON-YYYY');
:<block_name>.TI_DAY := TO_CHAR(Dt_Date, 'DAY');
EXIT WHEN TO_CHAR(Dt_Date, 'YYYY') <> TO_CHAR(Dt_Date + 1, 'YYYY'); -- If next year reaches, exit from the loop.
Dt_Date := Dt_Date + 1;
NEXT_RECORD;
END LOOP;
END; Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks. -
Behaviour of "Disable/Delete User After End Date" Task
Hi Expert,
We ran the given OOTB task "Disable/Delete User After End Date" and the behavior is always delete. How,if possible, to change the behavior to disable?
Thanks in advance.
SKIn order to change the behavior, you have to set the system manager preference called "Period to Delay User Delete" to something bigger than the task will make the user disabled and will automatically delete them at a future date.
-
SQL statement to compare dates and return boolean (yes/no)
I am looking for a SQL statement that can compare 2 dates and return a boolean. 1 (yes) if date 1 is => date2-threshold or 0 (No) if date < date2-threshold
Ie
date1=20130603
threshold=2 days
date2=sysdate-threshold
if [ 20130603 > sysdate-$threshold ]
then
return 1
else
return 0
fi
Thanks to all that answer.Assumming I want to get "date1" from some other table instead of from
dual will this syntax be valid
I was going to invoke another SQLPLUS from my shell script and pass it in
as a variable but if I can do it on one shot it would be better.
In addition, if "no rows" are found for date1 from the below query, would
I need code to handle that
with xx as
select TO_DATE(last_date','yyyymmdd') date1, from dba_audit_table where ...;
select TO_DATE('20130603','yyyymmdd') date1, sysdate date2 from dual;
Thanks to all who answer
[/code1] -
Date and Time column in custom lists - is default time possible?
I've created a custom list and included a column using the Date and Time field. I have this set up to default to "Today's Date." But, is there any way to also have this default to today's time? While the date will default, the time must be manually
selected using dropdown boxes.
We want this field to default to the date and time but also allow users to change the date and time if necessary. This is why we're using this instead of the "Created by" field, which is not editable.
Has anyone found a solution to this?
Thanks!Set calculated option for default value, and set =NOW():
[custom.development] -
Geting and setting date and time in oracle using jdbc
can u send me a sample snippet which shows me how to set date and time to a column in oracle database where the column datatype is date.
and also send me the sample code to get the date and time from the above said column
thanks in advanceIf you want DATE with time normalized to midnight, use java.sql.Date. If you really want time, with hours/minutes/seconds/millis, use java.sql.Timestamp.
As for the best way to interact with the database, use java.sql.PreparedStatement and its get/setDate and get/setTimestamp methods. Those will escape dates for you properly.
Look for a JDBC tutorial on-line to see how to do this, or http://www.javaalmanac.com for the java.sql package examples.
%
Maybe you are looking for
-
Opening Adobe Acrobat/Reader (1:1) in Firefox
Hello all, I realise this thread is very similar to others on this forum but having followed the posts and possible solutions I still cannot come to a successful outcome. Hopefully someone can help. Firstly the error: There is a problem with Adobe Ac
-
Getting started UCM webservice XML
I am at a loss. I have this 400 and some page PDF as a guide for UCM and I do not remotely know how to successfully search for documents stored in UCM using the webservice interface. I can retrieve a document if I know the dID but my users won't know
-
How to pass Shopping cart currency to PO SRM 7.0
Hi , How to pass Shopping cart currency to Po(insted of vendor master currency). Please help if there is a BADI or work around for solving the issue. Thanks & Regards, Sai
-
Session bean with 2 entity bean
i have a phonebook manager (session bean) taht controls the category of contacts such as group a , group b, group c and group d. where group a b c and d are all entity beans. may i know how to control a session bean so that it can diferent which enti
-
As a complete newcomer to apple, I'm struggling to load my kids Sims games onto the new computer. Is it possible? Do I need a patch? Or do I need a whole lot of new games just for the mac? Please tell me its not the latter.