Roll back or validation based on the number of deleted rows
HelloI have a procedure that deletes rows from the table dummy1. The requirement now is if the delete query deletes several lines then it must be restored to commit on the other.
Note: the VALUE of the column in the table dummy1 isn't a primary column.
CREATE OR REPLACE PROCEDURE P_DELETE_CHECK AS
V_VALUE NUMBER;
V_TABLE_NAME VARCHAR (100);
BEGIN
RUN IMMEDIATELY 'REMOVE'. V_TABLE_NAME | "WHERE THE VALUE OF ('|) V_VALUE |') ' ;
END P_DELETE_CHECK;
Can someone help me on this.
Thank you
Mahesh.
try to use this code snippet after your immediate execution:
if sql%rowcount > 1 then
rollback;
else
commit;
end if;
Edited by: hartmutm the 29.09.2010 04:50
Tags: Database
Similar Questions
-
Automating the validation based on the number of rows updated
Hello
Is it possible that I can, in a SQL script, restore or commit a transaction according to the number of lines have been updated?
We often receive requests for corrections of data in DBs and then must post manually, but only if the number of lines is what the developer has specified.
1 tab1 update
2. If the number of rows updated = 50, validation
3 if not, roll back
Thank you
AndreasTry this
update of tab1 set col1 = 80;
If rowcount sql = 50% then
commit;
on the other
rolback;
end if;
.... -
Calculate fees that pay based on the number of days in a month
Hello
I'm writing the BR to fresh wages, based on the number of days in the month.
Fix(Jan:DEC)
"Salary" = ("Annual salary"-> "BegBalance" / 12) * "workforce";
The existing calculation was ' wages divided by months no .of (12) ", now instead of number months wages that need to be calculated ("BegBalance"/ No..) OF DAYS IN THE MONTH) * 12.
Can someone pls guide me, how to begin writing the BR for 'No. DAYS OF THE MONTH.
You can do an admin enter number of days in the month. I remember CL reminding me the rhyme thirty days has September - Wikipedia, the free encyclopedia
Jokes aside, you can use SQL to get the number of days. You will get different options for SQL and Oracle.
If you want to continue to do this in BR then
Fix(Jan:DEC)
IF (@ISMBR (SEP) OR @ISMBR (Apr) OR @ISMBR (Jun) OR @ISMBR (Nov))
("Salary" = ("annual salary"-> "BegBalance" / 30) * 12) * "workforce";
ELSEIF (@ISMBR (Jan) OR @ISMBR (Mar) OR @ISMBR (May) OR @ISMBR (July) OR @ISMBR (Aug))
("Salary" = ("annual salary"-> "BegBalance" / 31) * 12) * "workforce";
ELSE (@ISMBR (Feb))
IF (@Remainder($CurrYr/4) == 0)
("Salary" = ("annual salary"-> "BegBalance" / 29) * 12) * "workforce";
ON THE OTHER
("Salary" = ("annual salary"-> "BegBalance" / 28) * 12) * "workforce";
ENDIF
ENDIF
ENDFIX
Concerning
Celvin
Post edited by: CelvinKattookaran
-
divide the table based on the number of lines
Hello
I am trying to split a table based on the number of lines and then treat.
Say I have a TEST_XXX table that contains 50 lines, what I would do is.
to access multiple lines of 10. How can we achieve this?
What I thought is, once the table is created and the line are filled.
Add a new column to the table and perform a procedure that inserts of 1 to 10 first lines
and 2 to 10 lines and 3 to 10 next ranks... etc. Based on this, that we can treat
the first set of lines then play next or etc...
is there a better way to do it?
Code to create the table:
Code to add lines:CREATE TABLE TEST_XXX ( A_ID VARCHAR2(10), B_ID NUMBER, c_ID VARCHAR2(10), D_ID NUMBER )
The original problem is, I have a huge table, and I write a sql query to process,DECLARE BEGIN FOR I IN 1..50 LOOP INSERT INTO TEST_XXX VALUES('ABCDE',123,'ZYXWV',321); END LOOP; COMMIT; END;
When I treat him by selecting all the values in the table, it is very slow.
But when I have treat small Coulon (say 100 rows), it works very well.
That's how I got the approach described above in mind.You can use NTILE.
See:
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions101.htm#SQLRF00680
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:47910227585839 -
Mr President.
Can we restrict the number of table rows to display on a page that is only 2 or 3 rows appear? How to do this?
Concerning
Tender,
Set the RangeSize property on the table.
See you soon
AJ
-
How to do a validation based on the SQL query?
Hello
I have a requirement to perform a validation on a field (messageTextinput) in my page OAF.
When I click the button apply, the value in this field is validated based on a SQL query (for example, the value in the field NOT IN (value1 select from table1).)
Help, please.
Best regards
Joe
1. create a SQL query based VO, XXVO. For example:-SQL query is select xx_table;
2. Enter the "Apply" button click event in the controller and run the AM method passing the value entered by the user in the given field, for example:-value is VAL1
3. in the method of the AM, get a handle of the VO, the whereClause and run.
OAViewObjectImpl vo = findViewObject ("XXVO1"); XXVO1 is the name of the instance of the VO above, XXVO
vo.executeEmptyRowSet ();
vo.setWhereClause (null);
vo.setWhereClause ("value =" + VAL1 + "'");
vo.executeQuery ();
If (VO. GetRowCount() > 0)
A record is with the value of VAL1. Perform the required action
I hope this helps.
-
How to search for an image Adobe Stock based on the number of files Adobe Stock?
Before I signed up for Adobe Stock, I took screenshots of the pictures that I wanted to buy. These plans include the official file Adobe Stock number. Now that I have a subscription, I want to buy these images. But it doesn't seem to be an option to search based on the file number. How can I get the image I want, by file number, without wasting hours of research of individual images through keywords?
Simply type the Stock number in the search. Be sure to have audited as well appropriate file types.
-
Basic conditional script based on the number of lines in a text layer?
Just received help here to write a conditional script by using the font size of a text layer. Thank you all for this.
The next hurdle is a conditional script using the number of lines in a text layer in the differential. Far as I can tell it not the layer details which specify the number of lines. Just '\r' for a return in the idTxt descriptor. Nothing seems to stand for a soft return as far as I can tell. I'll probably have to be able to count the lines with soft and hard returns.
Any thoughts?
I was playing around with this a bit and here is a small script to determine the number of rows. This is based on the self in the head, that I calculated to environ.108 times the size of the font.
#target photoshop app.preferences.rulerUnits = Units.POINTS; var doc = activeDocument var tL = doc.activeLayer var h = tL.bounds[3]-tL.bounds[1] var per = ((h/5)-(tL.textItem.size))/tL.textItem.size var num = h/(tL.textItem.size *1.108) alert(Math.round( num))
-
Checkbox validation based on the selection of the values LOV
I'm trying to validate a checkbox custom on the opportunity page, based on the selection of the values LOV.
For example only when the user selects 'rating = A', the box should be able to select and save.
If the user selects other that 'A' in the field assessment, the box should not save.
or
Is it possible to do, the READ ONLY checkbox, enable only when the side 'A' is selected.
Any thoughts / help on this.
Thank you, Kumar
Edited by: user10833334 may 4, 2010 06:43There is no function to make a read-only field based on the contents of another field, it is not an option. I will list my thoughts on how you might handle this below.
-Option 1: I recommend that you use validation to manage it. I don't know exactly to your needs, but you could write a field validation that checks to see if the flag is checked and rating <>has and sends an error message to the user, if it is not. The user would not be able to save the file until it Unchecks the box or sets the side = A.
Advantages: User gets a message explaining the problem with the data and is forced to fix it before you save it.
Cons: Requires interaction from the user to save and if they do not pay attention, the data may be lost if they cancelled without saving the changes.-Option 2: Another option would be to use the workflow to validate the registration. In this scenario, you can create a workflow that determines whether the field is out of adjustment, and if it is not correctly set, the workflow would update the box accordingly. In this scenario, you would use the 'Actions if Condition is False' also to inform the user that the flag cannot be controlled unless the side =. Then, you must set the Action "Update the values" update the uncontrolled field.
Pros: Manages the work without user interaction.
Cons: The con in this case, is that there is no workflow 'Before NEW record saved' trigger, so it is likely that the user sets the value incorrectly when creating the folder and it would stay like that until they update the record again.Some people might argue that there is another option that uses the functionality of dynamic page layout to make the field read-only, but this isn't a good option. You would need to convert using the Type of the opportunity in a way that would make use of the possibilities of lourdes for your users and I mention it only to you recommend to avoid his review completely.
Good luck and let me know if you have any questions.
Thom -
Commission on track based on the number of sales
I got a new job (yay!) and I'm trying to follow my commissions. I am paid by a combination of production and the number of sales that I produce. Here is a small picture to show what I mean.
Number of sales
Payout rate
1
6%
2
7%
3
8%
4
9%
5
10%
6
11%
7
12%
8
13%
Let's say that each sale, the customer pays $2,000 to keep things simple. The first sale, I would win $120, the second sale I now would get $140 for each because it is retroactive (does sense?) without the hat. How would actually follow it in numbers? Thanks in advance!
This may work for you:
the first line of the two tables is a header row
them 4 last lines of the table 'sales' on the right are the lines of footer
(The first line of the footer) B8 contains the formula:
= SUM (B)
shorthand is
B8 = SUM (B)
B9 = MIN (COUNTA (A), COUNTA (B))
B10 = VLOOKUP (B9, sales bonus::A:B, 2, 0)
B11 = B8 × B10
-
Formula need to count cells based on the number of week
I have a table used to track dates of contact with a client. A column calculates the WEEKNUM of the date of contact.
Week NUM
Date
First name
2
04/01/2016
Amanda
3
16/01/2016
Robert
4
17/01/2016
Rosie
6
01/02/2016
John
6
02/02/2016
Soledad
9
21/02/2016
Charles
9
24/02/2016
Mary
9
25/02/2016
Quince
12
17/03/2016
Bob
12
17/03/2016
Donald
14
03/31/2016
Cathy
14
01/04/2016
Shanna
19
02/05/2016
Laura
I need to report the number of contacts per week, so I mounted a second table with the week number in the first column. Each line corresponds to the number of week. I'm trying to use the function of COUNTIES to count the number of contacts in which the number of the week of the first table is equal to the week of the second table, but I can't get it to work. Is there a way to do this?
Week NUM
Number of contacts
expected outcome of the formula
1
0
2
1
3
1
4
1
5
0
6
2
7
0
8
0
9
3
10
0
11
0
12
2
13
0
14
2
15
0
16
0
17
0
18
0
19
1
20
0
Never mind. I'm a fool. COUNTIF does it, and I'm stuck trying to make COUNTIF work.
-
Move and organize files based on the number of lines
Hello
I have a directory containing files nearly 1,500, some of which are composed of 12 lines, some of which are composed of 4 lines, which are all .phy (PHYLIP) files, which can be viewed in Notepad/wordpad as text files.
I need to execute a script which will determine the number of lines in each file and move them to the corresponding folder. The file size will not work for sorting, I've tried.
that is, all files with 4 lines in one folder, all the files with 12 lines in another folder, any files left (so I can be sure that everything has been inspected) in the main directory.
Can anyone help?
Thank you
This issue is beyond the scope of this site and must be placed on Technet or MSDN
-
How to add a certain number of instances based on the number selected in a drop-down
I have a form where I would like users to select a number from a drop down, and the number of instances of a specific subform are displayed, for example if they choose 3 from the menu drop-down, 3 cases of the display of subform. I am a newbie of LiveCycle, if anyone can help me with a simple way to do this?
When a line is hidden when the form is created and you add instances of this line, it will add these lines as hidden because it uses the original properties of the line.
You would have to set all the rows that have been added to visible when they are created.
Subform1.instanceManager.setInstances (5);
for (var i = 0; i)< subform1.instancemanager.count;="">
var frmSub = Main.resolveNode ("subform1 [" + I.ToString + "]");
frmSub.presence = "visible";
}
-
Hi all
How to change the number of lines in a default report wchih appears after going out? Any solution?
M.
Edited by: 1002519 2013-04-25 07:59Hello
Even use 11.1.1.5
what you do is click on the Analysis tab > here are therefore displays two tables or pivot table see > click edit display table or pivot > it opens in edit mode > on top, you can see another button properties with xyz symbol > click it you see a lines per page text box enter necessary and save the report.
Select this option if useful/correct.
Thank you.
-
How to identify the number of current row in a tabular form?
Hi all
I have a tabular presentation on the emp table. I want to recalculate the commission only column for the row where I changed the number of salaries. I gave my javascript below. I'm trying to triggerItem.slice (4) to identify the line number, but it doesn't seem to work. Anyone can point out the issue with it please?
I use Oracle 10 g and Apex 4.0.<script language="JavaScript" type="text/javascript"> function getTheCurrentRow(triggerItem){ var theRow = triggerItem.slice(4); return theRow; } function getComm(){ var theRow = getTheCurrentRow(pThis.id); document.wwv_flow.f05[theRow].value = (document.wwv_flow.f04[theRow].value)*0.1; } </script>
Thank youHello
You forgot pThis in your second code I think.
function getComm(pThis){ var theRow = getTheCurrentRow(pThis.id); document.wwv_flow.f05[theRow].value = (document.wwv_flow.f04[theRow].value)*0.1; }
You must call getComm thereby
getComm(this);
Thank you
Maybe you are looking for
-
Apple always does support OS 10.7.5 Lion?
Apple always does support OS 10.7.5 Lion?
-
How to transfer or import istory of Safari browser to Chrome
I'm having trouble with my Safari right now (more details on this saga here: Safari crashing my screen (and nothing else)) and I think that at least until I get that fixed I use Chrome for a while. However, it feels awkward to use Chrome without all
-
Satellite L650 - ATI Mobility Radeon HD 5145 drivers obsolete
I tried to run World of Warcraft after a month or so to break up with her, and when opening it he gave me the warning that my display drivers have been exceeded. I can still run the game OK, but it made me worry. As you can expect, I can't download t
-
Win 7 repair disk does not start
H8 1380 t CTO, Intel i7 3820 processor. 10 GB of DDR3 Ram PC3-12800 memory. FRIEND bios (UEFI), Version 2.14.1219 (current).Pegatron Motherboard-IPIWB-PB (Pittsburg) Audio Beats. AMD, the Radeon HD 7570 1 GB graphics card. I need some advice: Can you
-
Links 2007 is not compatible with Windows 7?
Just upgraded to W7 32 Vista 32 and now my Links 2003 keeps stalling and won't work. FS 2002 is also strange. I have change the airport on 'create a flight', and it always ends at Meigs. No idea why?