I am using a script. It autometically updates some cases. And it updates history of the cases also. But i don't want to be like that. I don't wnat to update history.
Is there any way to do.
11 2233
No idea what you are even talking about.
Provide some code. Maybe we can help.
Include the "histories" you speak of.
I am updating 2 fields with my script. I have sheduled the code to run it for every 1 hour. It is updating successfully. But it is also updating history for each record. So per a day 24 entry will be registering in history of cases. So that is my problem. I don't want history to update. - =pod
-
-
=head1 Due Counter update
-
-
This program is supposed to be called by the scheduled tasks scheduled repeadtedly with an apropriate
-
time interval. The purpose is to find all trouble report with a certain state, and inctrement a counter
-
in each record. It needs the cqperl Perl interpreter that comes with the IBM Rational ClearQuest
-
distribution
-
-
=head2 Syntax
-
-
=begin html
-
-
<pre>
-
cqperl duecounterupdate.pl
-
</pre>
-
-
=end html
-
-
=cut
-
-
my $USERNAME = "sqluser"; # This user account is a hard-coded
-
my $PASSWORD = "xyz"; # user accouunt in the database with SQL run privileges
-
my $REPOSITORY = "xyz";
-
my $DATABASE = "TEST";
-
my @QUERIES = (
-
[ "Answering_Time_Count", "Public Queries/Due Counter/all_errand_answering_time_cases" ],
-
[ "Delivery_Time_Count", "Public Queries/Due Counter/all_solution_delivering_time_cases" ],
-
);
-
my $one_day = 24 * 3600; # Number of seconds for one day
-
require CQPerlExt; # Must be run with the cqperl binary.
-
-
# Log on to the schema repository
-
my $sqlSession = CQPerlExt::CQSession_Build();
-
eval { $sqlSession->UserLogon( $USERNAME, $PASSWORD, $DATABASE, $REPOSITORY ); };
-
if ($@) {
-
print "$@\n";
-
exit;
-
}
-
print "SQL Login as $USERNAME on $REPOSITORY succeeded\n";
-
-
# Get all national holidays
-
my %HOLIDAYS = ();
-
my $resultSet = $sqlSession->BuildSQLQuery("select fldcolumn from Holidays order by 1");
-
-
$resultSet->Execute();
-
while ( $resultSet->MoveNext() == $CQPerlExt::CQ_SUCCESS ) {
-
my $holiday = $resultSet->GetColumnValue(1);
-
$HOLIDAYS{ substr( $holiday, 0, 10 ) } = 1;
-
}
-
-
#print "Found holidays: " . join( ",", keys %HOLIDAYS ) . "\n";
-
-
my $workspace = $sqlSession->GetWorkSpace();
-
-
my $justnow = time();
-
-
for ( my $query = 0 ; $query <= $#QUERIES ; $query++ ) {
-
my @CASES = ();
-
my $queryDef = $workspace->GetQueryDef( $QUERIES[$query][1] );
-
my $resultSet = $sqlSession->BuildResultSet($queryDef);
-
-
$resultSet->Execute();
-
while ( $resultSet->MoveNext() == $CQPerlExt::CQ_SUCCESS ) {
-
push @CASES, [ $resultSet->GetColumnValue(2), $resultSet->GetColumnValue(7), $resultSet->GetColumnValue(8) ];
-
}
-
-
foreach my $case (@CASES) {
-
my ( $caseId, $counter, $changeTime ) = @$case;
-
-
# The counter is displayed in decimal days. Convert it to seconds by multiply by seconds per day
-
$counter *= $one_day;
-
-
print "Case $caseId: Last changed $changeTime, $QUERIES[$query][0]=$counter\n";
-
-
# Update the due counters and the due-date field
-
my $diff = $justnow - $changeTime;
-
print "Diff=$diff\n";
-
while ( $diff > 0 ) {
-
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime($changeTime);
-
my $datestr = sprintf( "%4.4d-%2.2d-%2.2d", 1900 + $year, 1 + $mon, $mday );
-
if ( !$HOLIDAYS{$datestr} && $wday != 0 && $wday != 6 ) {
-
-
if ( $diff > 3600 ) { $counter += 3600; }
-
else { $counter += $diff; }
-
}
-
-
if ( $diff > 3600 ) { $changeTime += 3600; }
-
else { $changeTime += $diff; }
-
$diff -= 3600;
-
}
-
-
my $objtoedit = $sqlSession->GetEntity( "Case", $caseId );
-
-
$sqlSession->EditEntity( $objtoedit, "modify" );
-
-
# Convert counter back to decimal days by divide by seconds per day
-
$counter /= $one_day;
-
-
# For some very stupuid reason that I cannot understand, the variable values to be used to update
-
# the field value must be referenced here, otherwise we will get an error message TODO: WHY?
-
# $a = "$counter\n";
-
-
print "objtoedit->SetFieldValue( $QUERIES[$query][0], $counter )\n";
-
$objtoedit->SetFieldValue( $QUERIES[$query][0], $counter );
-
-
# Wait until the last query to update the last_due_calc field, since it is retreived by all queries
-
if ( $query == $#QUERIES ) {
-
my $a = "$justnow\n";
-
$objtoedit->SetFieldValue( 'Last_Due_Calc_time', $justnow );
-
}
-
-
# Validate the changes. (Must be done in order to be able to commit the changes)
-
if ( $objtoedit->Validate() eq "" ) {
-
$objtoedit->Commit();
-
}
-
else {
-
$objtoedit->Revert();
-
print "Failed $caseId $QUERIES[$query][0]=$counter, calctime=$justnow\n";
-
}
-
}
-
-
}
-
Histrory part
------------------ - Date/Time User Name Action: Old State New State
-
2008-02-19 14:19:33 edtalte submit no_value Submitted
-
2008-02-19 16:36:13 sqluser modify Submitted Submitted
-
2008-02-19 16:36:14 sqluser modify Submitted Submitted
-
2008-02-19 16:36:35 sqluser modify Submitted Submitted
-
2008-02-19 16:36:36 sqluser modify Submitted Submitted
-
2008-02-19 16:39:56 sqluser modify Submitted Submitted
-
2008-02-19 16:39:57 sqluser modify Submitted Submitted
-
2008-02-19 16:43:59 sqluser modify Submitted Submitted
-
2008-02-19 16:44:00 sqluser modify Submitted Submitted
-
2008-02-19 16:53:03 sqluser modify Submitted Submitted
-
2008-02-19 16:53:03 sqluser modify Submitted Submitted
-
2008-02-19 16:53:11 sqluser modify Submitted Submitted
-
2008-02-19 16:53:11 sqluser modify Submitted Submitted
-
2008-02-19 16:55:21 sqluser modify Submitted Submitted
-
2008-02-19 16:55:22 sqluser modify Submitted Submitted
-
2008-02-19 17:00:01 sqluser modify Submitted Submitted
-
2008-02-19 17:00:02 sqluser modify Submitted Submitted
-
2008-02-20 08:00:03 sqluser modify Submitted Submitted
-
2008-02-20 08:00:04 sqluser modify Submitted Submitted
-
2008-02-20 09:00:05 sqluser modify Submitted Submitted
-
2008-02-20 09:00:06 sqluser modify Submitted Submitted
-
2008-02-20 10:00:02 sqluser modify Submitted Submitted
-
2008-02-20 10:00:03 sqluser modify Submitted Submitted
-
2008-02-20 12:00:02 sqluser modify Submitted Submitted
-
2008-02-20 12:00:04 sqluser modify Submitted Submitted
-
2008-02-20 13:00:26 sqluser modify Submitted Submitted
-
2008-02-20 13:00:28 sqluser modify Submitted Submitted
-
2008-02-21 08:00:11 sqluser modify Submitted Submitted
-
2008-02-21 08:00:13 sqluser modify Submitted Submitted
-
2008-02-21 09:00:02 sqluser modify Submitted Submitted
-
2008-02-21 09:00:03 sqluser modify Submitted Submitted
-
2008-02-21 10:00:02 sqluser modify Submitted Submitted
-
2008-02-21 10:00:03 sqluser modify Submitted Submitted
-
2008-02-21 12:00:02 sqluser modify Submitted Submitted
-
2008-02-21 12:00:03 sqluser modify Submitted Submitted
-
2008-02-21 13:00:02 sqluser modify Submitted Submitted
-
2008-02-21 13:00:02 sqluser modify Submitted Submitted
-
2008-02-21 14:00:03 sqluser modify Submitted Submitted
-
2008-02-21 14:00:04 sqluser modify Submitted Submitted
-
2008-02-21 14:17:01 sqluser modify Submitted Submitted
-
2008-02-21 14:17:02 sqluser modify Submitted Submitted
-
2008-02-21 15:00:05 sqluser modify Submitted Submitted
-
2008-02-21 15:00:11 sqluser modify Submitted Submitted
I am sorry but, I still don't understand what you mean by "updating history part".
Do you have "default" values set up in the Database for those fields?
If a field is set to "not null", and you update some other field within the same record, the "default" value will be used to update the fields that were left blank.
I am not experienced with "CQPerlExt". For database transactions I use the DBI module.
You may want to move @CASES out of the loop, since declaring it with "my" within a loop will create warnings, when "strict" pragma is used.
(line 59)
I recommend using "strict" in all your scripts.
This is going to be a tooth pulling session so I am out of the thread.
The easiest approach would be to delete the code that does the updating of the history that you don't want to keep anymore.
We do not know which section of code is doing the updating. Comment out each of the areas one at a time until it does what you want.
Make sure your scripts use the strict and warnings pragmas to assist in your debugging efforts.
That is all we can tell you since your description and lack of information is not helping us help you.
--Kevin
What the system is:
I have a defect tracking system. In that I have defects that are said to be CASES. And I have all information about that defects i.e., CaseId, title, description, Attachment and History also. It contains when the case is opened, closed and timestamp etc. What the requirement is:
What the requirement is I have to implement a field which says that the cases has to be closed in these many days. By that users can know the elapsed time to solve the case. What I have done:
Basically it is a counter which calculates elapsed time in seconds and after that it is converted to days. Here we are considered holidays and national holidays as well.
And I updated the counter field by using modify action. Then this action modifies all the fields of history also.
When ever I call that script that action updates history also, and then there will be so many entries in that history. And I need to call the script an hour basis. So per day there are 24 entries that will be big problem What I need:
I don’t want to update case history. Is there any possibility to update the only one filed?
I am sorry but, I still don't understand what you mean by "updating history part".
Do you have "default" values set up in the Database for those fields?
If a field is set to "not null", and you update some other field within the same record, the "default" value will be used to update the fields that were left blank.
I am not experienced with "CQPerlExt". For database transactions I use the DBI module.
You may want to move @CASES out of the loop, since declaring it with "my" within a loop will create warnings, when "strict" pragma is used.
(line 59)
I recommend using "strict" in all your scripts.
Is this homewor/classwork?
Already this system is using by a major client in Europe. I need to implement new requirements.
Is this homewor/classwork?
Okay, I have a better understanding now. What is the exact name of the field in the database for "Cases", the field you don't want to update?
In the code you posted I do not see where you are writing any data to the database. Where are the queries located that do the writing?
Would you please post some of the queries?
--Kevin
Okay, I have a better understanding now. What is the exact name of the field in the database for "Cases", the field you don't want to update?
In the code you posted I do not see where you are writing any data to the database. Where are the queries located that do the writing?
Would you please post some of the queries?
--Kevin
He should really be asking on a forum that discusses ClearQuest http://www.ibm.com/developerworks/fo...pa?forumID=329
Here is almost the exact same question posted on the CLearQuest forum: http://www.ibm.com/developerworks/fo...94537&tstart=0 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tony Marston |
last post by:
If the use of the browser's BACK button is interfering with the operation of
your web application then take a look at this article entitle "Back Button
Blues"
...
|
by: Paul |
last post by:
Hi, just wondering if there is a way to disable the back button of the
browser as I have a logoff page and would like to not allow the back
operation? Guessing there may be a way to do it through...
|
by: Ed Jay |
last post by:
I want to use history.go() to navigate between my previously loaded pages.
I'm looking for a way to trigger a function call when a page is accessed
using history.go(). Is there an event generated?...
|
by: Vani Donthula |
last post by:
Hi
In my web application,in one of the page
where I need to disable the back button of the toolbar.
Suggestions on this are welcome.
Thanks,
Vani.
|
by: vanya |
last post by:
i have been tryin to program(javascript) to disable the following keystroke combinations
CTRL+O or CTRL+L Go to a new location (O = 79 L = 76)
CTRL+S Save the current page ( S = 83)
CTRL+E...
|
by: sandeep ch |
last post by:
hi ,
I am opening a excel sheet from perl but every time i run the program i get a pop up message saying that "This Workbook contains links to other sources"
" - To update all linked information...
|
by: jdserran |
last post by:
hello ^__^
does anyone here know a perl code or function that can be used to go back to a previous page after clicking a link? that is, it does the exact thing when you use javascript's...
|
by: parshupooja |
last post by:
Hey all,
I have button on page. OnClick event I am saving records to database, which takes couple of seconds, meanwhile if user becomes impatient and clicks again, it triggers save again. I want...
|
by: alamodgal |
last post by:
hiiiiiiiiiii everybody,
pls solve my problem if u can?
Actualy what happens in my site when i press enter key it will show some secured...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |