How to get updated by count value in database ?
hi all,
I created jsp page iin which insert,update,delete , query and queryall Functionalities are working...
I need following,
whenever i update a record i should get updated by, updated time and updated count.. to be stored in database...
i achieved to store updated by and updated time...
please help me how to get updated count:
when ever a record is updated for first time updated count=1,
for second time it should be 2 for third time it should be 3 and so onnnn
please help me how to write this kind of function and kind of code help will be appriciated....
if you want "number of updates" performed on each row to be persistive, you should have designed the schema with an extra field which keeps number of updates performed.
to generic solution sql statement should have been written like
INSERT INTO table (a,b,c,update_count) VALUES (1,2,3,4)
ON DUPLICATE KEY UPDATE update_count=update_count+1;in this case even a insert statement will work, you wouldn't had to write another update statement.
or if u want to use update statement only
have an extra column "update_count" do "update_count=update_count+1" on each update statement, set initial default value to 0;
and if u want to know how many rows have been updated
as BalusC wrote
BalusC wrote:
PreparedStatement#executeUpdate() returns an int which represents the amount of affected rows.
Similar Messages
-
How to get the latest procured value of a spare updated in material master
How to get the latest procured value of a spare updated in material master
J S S PRASAD
See table MBEW via transaction SE16.
However, you may need to look at the last PO created for that material.
PeteA -
How to get updated value at run time in oracle forms
How to get updated value form oracle database on a field in oracle forms 6.0 at run time if the same form is opened by multiple users and both have get the same maximum value if one commit the record then how other would get that maximum value with out exiting that form...
This issue is fairly common and Forms handles the situation by displaying the error, "Record has been updated by another user. Requery to see changes." if a user tries to update a record that was updated by another user.
If your data is in a base table block, you can check before you save by checking the value in the form against the database using the Get_Item_Property('<BLOCK.ITEM>',DATABASE_VALUE). You can compare the value returned by the built-in against the value in the field to see if they have changed. This could be a lot of work and a lot of network traffic if you are checking numerous items in your data block. Forms has a standard locking mechanism that will lock the queried record as soon as a user makes any changes. If another user queries and attempts to change the record locked by another user - they will receive a "Record Locked" message.
Francois brings up a valid point. Perhaps you should review the link Francios provided as well as this one: How to ask questions the smart way
It is always a good idea to review your thread before you post it and ask yourself, "Could I answer this question given the information I've provided and the way I've asked the question?"
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
How to get updated table values from objectlistdataproviders
how to get updated table values from objectlistdataproviders
Hi,
Here is a sample code
start-of-selection.
*Select the data you need into an internal table
loop at it_mara into wa_mara.
data that needs to be displayed in the output list
write:/ box as checkbox,
wa_mara-matnr under text-001,
wa_mara-maktx under text-002,
wa_mara-lgort under text-003.
Hide the data that needs to moved to internal table
hide:wa_mara-matnr, wa_mara-maktx, wa_mara-lgort.
endloop.
clear wa_mara.
end-of-selection.
lines = sy-linno.
at line-selection.
clear:it_matnr.
do lines times.
check sy-index > 1.
box = space.
read line sy-index field value box.
if box = 'X'.
*data selected using check box is moved to internal table
append wa_mara to it_matnr.
endif.
enddo.
Regards,
Jisha. -
How to get dynamic check box value in NW Mobile 7.1
Hi,
i have 5 rows it contains dropdown and checkbox in a row.when i click update button i need the values of checkbox.How to get?
Regards,
Kanagaraj.Hi Vidyadhar,
I have dropdown in first page.based ondropdown value selected navigating to next page.In that i am using row repeater it has label,checkbox and dropdown.here i need to know whether the check box is checked or not while clicking update button.
Drow down value also not able to get.
How to get Checkbox and dropdown values?
can u provide some sample codes??
Regards,
Kanagaraj. -
How to get visible row count in JTable ?
I have one table which is added to one scroll pane. For example my table have total 1000 rows, but at a time only 20 rows should be visible to the scroll pane. And I want to scroll the rows and show only 20 at a time.When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so on. I want to know how to get that number which represents the visible row( in this case it is 20).So kindly help me how to get visible row count. Any help regarding this will be appriciated.
Thanks and Regards,
Sheetalhow to get visible row count.First you need to get the viewport used by the scrollpane. Then you can use methods like getViewPosition() and getViewSize() to get information about the current postition of and size of the viewport.
Then you can use the table method getRowAtPoint(). to determine the first and last visible row which can then be used to calculate the visible row count.
When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so onThis is the default behaviour when a "block" scroll is done.
However when you click on the arrow button on the scrollbar it will only scroll a single row. You could override the getScrollableUnitIncrement() method to return the value from the getScrollableBlockIncrement() method.
However the user can still drag the scrollbar manually which would cause a problem. So you would also need to remove the MouseMotionListeners from the scrollbar to prevent this. -
How to get succesfullt loaded count in forall
hi,
plz tell me how to get succefuly loaded count into a table if i m using bulk collect & forall .Check out the documentation:
Counting Rows Affected by FORALL with the %BULK_ROWCOUNT Attribute
The cursor attributes SQL%FOUND, SQL%ISOPEN, SQL%NOTFOUND, and SQL%ROWCOUNT, return useful information about the most recently executed DML statement. For additional description of cursor attributes, see "Implicit Cursors".The SQL cursor has one composite attribute, %BULK_ROWCOUNT, for use with the FORALL statement. This attribute works like an associative array: SQL%BULK_ROWCOUNT(i) stores the number of rows processed by the ith execution of an INSERT, UPDATE or DELETE statement. -
How to get a Tree Node Value when a Tree is Expanded
My reqiurement is when i Expand a Tree i need the Expanded tree Node Value. For Example Consider Parent as a Root Node of a Tree, and Consider its two Children Child1 and Child2.
When + Parent Expanded
I will Get the Output as --Parent
- Child1
- Child2
so As when i expand the Tree i must Get the String Value Parent.duplicate
How to get a Tree Node Value when a Tree is Expanded -
How to get Document Set property values in a SharePoint library in to a CSV file using Powershell
Hi,
How to get Document Set property values in a SharePoint library into a CSV file using Powershell?
Any help would be greatly appreciated.
Thank you.
AA.Hi,
According to your description, my understanding is that you want to you want to get document set property value in a SharePoint library and then export into a CSV file using PowerShell.
I suggest you can get the document sets properties like the PowerShell Command below:
[system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
$siteurl="http://sp2013sps/sites/test"
$listname="Documents"
$mysite=new-object microsoft.sharepoint.spsite($siteurl)
$myweb=$mysite.openweb()
$list=$myweb.lists[$listname]
foreach($item in $list.items)
if($item.contenttype.name -eq "Document Set")
if($item.folder.itemcount -eq 0)
write-host $item.title
Then you can use Export-Csv PowerShell Command to export to a CSV file.
More information:
Powershell for document sets
How to export data to CSV in PowerShell?
Using the Export-Csv Cmdlet
Thanks
Best Regards
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
How to get the current month value for a customer exit variable?
How to get the current month value for a customer exit variable?
And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
Thanks!Hi Kevin,
Check here........
Re: Customer Exist for "From Current Date To Month End"
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
Cal month
Regards,
Vijay. -
How to get the previoulsy selected value in a combobox
How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.
Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
comboBox.addItemListener(new ItemListener() {
Object prevValue;
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
//do what you need with prevValue here
} else {
prevValue = e.getItem();
}); -
How to get the row Count of a ResultSet
How to get the row Count of a ResultSet
Hi
I'v tried rennie1's way ,but I only get zero,my code is:
rs.executeQuery("select count(*) from t_test");
if (rs.next()) int rowCount=rs.getInt(1);
I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
I tried another way,the code is:
while rs.next(){
// Do nothing ,just move the cursour to the last row
int rowCount=rs.getRow()
However,the rowCount still equal zero
Any help would be greatly apprecite!
note:
I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle. -
How to get Input-Ready Cell Value of Input Ready Query?
Hi,
How to get input ready cell value in fox formula?
for example :
In Input-Ready Query,
C_Code Month Psale(input ready)
1000 05.2012 800
now i want Psale 800 in fox formua before value save in cube,
is it possible?
Thanks
RaviHi,
as I understand your requirement: you want to execute a planning function before 'save'. This possible, cf. note 1356805
for more details.
Regards,
Gregor -
How do I update a bean value from an AJAX call?
Hi all,
How do I update a bean value from an AJAX call? I suppose I could write a servlet to do it. However, this seems like a common problem, so I was wondering if there was some built in solution.
Thanks,
Grae
Edited by: caalip2 on Mar 30, 2010 1:07 PMcaalip2 wrote:
Raymond
Basically, I would user the following. The first choice for IE, the second for Firefox.
new ActiveXObject("Microsoft.XMLHTTP");
new XMLHttpRequest();
GraeDon't do this to yourself. If it were that easy there wouldn't be AJAX frameworks for JSF. Find one you like and use it. I've used a4j (part of RichFaces) successfully. -
How to get space between two values in a single cell of a table.
hello,
how to get space between two values in a single cell of a table.
thanks a lot.
kailash.sorry i got the answer.
Maybe you are looking for
-
Fill technical information to the column of an ALV
Hi, I've developed a report that using an OOP ALV. In the output of report, I chose a column and press F1 the window performance assistant will show up. Then I click 'technical information' button the window will show up. How to add the information t
-
Saving Email as a .msg file on local machine
Hi Everyone, I have a requirement of reading an email from the INBOX folder and later save it as a .msg file on my local machine. Although, the file is getting created, I am unable to open it. However, when the file is saved as an .eml file, it works
-
Hi, I pre-ordered a N900 two months ago. I finally got it yesterday, and since then I've been experiencing random and frequent reboots of the device. I don't have to do anything fancy, it simply reboots from time to time without warning. It's a real
-
Using Oracle's Parallel Server for synchronizing databases with different tables
Hello, I have a problem and I was searching through the Oracle documentation. Then I mentioned the Oracle's Parallel Server (OPS) feature. The problem I want to fix is the following: I want to make a copy of a database. Subsequently I want to make ch
-
My Adobe Acrobat update failed w Error 1321 The installer has insufficient privileges to modify file.... I followed the Adobe online instructions to change the advance settings. Now trying to reinstall my Adobe Acrobat but I do not see the download