Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Sunday, December 19, 2010

Transfer to New Owner of all streams in a ClearCase VOB / Possible script?

That the real pain point with the lock mechanism: if you unlock (which you need to do if you want to perform a cleartool protect -chown), you are loosing the list of users you excluded from a given lock.

A starting point to script that kind of operation is this IBM document "How to list locked VOBs":

Windows: for /F %v in ('cleartool lsvob -short') do cleartool lslock vob:%vUnix: for i incleartool lsvob -short -host ; do cleartool lslock vob:$i; done

Leave me as a comment the Os on which you will perform those operations, and I will complete this answer with a script.

For instance, a quick DOS script chown_locked.cmd would be:

@ECHO offSETLOCAL ENABLEDELAYEDEXPANSIONdoskey ct=cleartool $*set ucmObject=%1 & REM #project:aProject@\aPVob or stream:aStream@\aPVobset anOldUser=%2 & REM #previous owner of the streamsset anOldUser=%anOldUser:~0,-1%set lsstreamCmd=ct lsstream -in %ucmObject% -fmt "%%Xn %%[locked]p %%u\n"for /F "tokens=1-3" %%a in ( ' %lsstreamCmd% ') do ( rem echo '%%a' rem echo '%%b' rem echo '%%c' if "%%b" EQU "locked" ( if "%%c" EQU "%anOldUser%" ( call:chown %%a %USERNAME% ) else ( echo.ignore locked %%a because not owned by %anOldUser%, but by '%%c' ) ) else ( echo.ignore unlocked %%a ))goto end:chown ucmObject -- chown on a ucm object:: if lock, will restore the nusers lock exception list:: -- streamName [in] name of the UCM object:: -- newOwner [in] name of new owner SETLOCAL ENABLEDELAYEDEXPANSIONset ucmObject=%~1set newOwner=%~2set cmd=ct lslock %ucmObject%for /F "tokens=4*" %%a in ( ' %cmd% ^| find "Locked except for users:" ') do set lslock=%%bset lslock=%lslock:~0,-1%rem echo lslock '%lslock%'if "%lslock%" NEQ "~0,-1" goto lslockecho.chown locked '%ucmObject%%' for '%newOwner%'ct protect -chown %newOwner%2 %ucmObject% & goto endchown:lslockset lslock2=%lslock: =,%rem echo lslock2 '%lslock2%'echo.chown locked '%ucmObject%' for '%newOwner%' while retaining '%lslock2%'ct unlock %ucmObject%ct protect -chown %newOwner% %ucmObject%ct lock -nusers %lslock2% %ucmObject%:endchown( ENDLOCAL)EXIT /b:end( ENDLOCAL)

Call it on a project, or a stream (with sub-streams) within a project, like so:

chown_locked.cmd project:myProject@\aPVobName aPreviousOwnerchown_locked.cmd stream:aStream@\aPVobName aPreviousOwner

It will protect any sub-stream to the current user if said sub-streams are:

lockedlocked with the right owner (the previous one who has left)

If a sub-stream is locked with a -nusers list of excluded users (excluded from the lock), this list is saved before the unlock, and restore when locking the stream again.

Of course, it will only work if the current user is ClearCase administrator (i.e. is in the same group than the ClearCase_albd user): only this king of user can do a chown on a ClearCase object.


View the original article here

Thursday, December 9, 2010

Delete ClearCase Views Script

I mentioned a script a little bit verbose, but which won't remove any local storage and won't either clean the CCRC session.dat:

nuke_view.pl: you can use it to remove all views from a workstation (which may not be available anymore)

cleartool lsview -host myHostname -quick | xargs ccperl nuke_view.pl

The -quick option is very important to quickly get the list of views for a given workstation.

## This script should be used to cleanup a view when 'ct rmview' will not## work (such as when the viewstore directory has been deleted.#### Note: The view storage directory will have to manually deleted if it still exists.use strict;#sub NukeView();#sub DoIt();foreach(@ARGV) { NukeView($_);}##############################################################sub NukeView { my $view2del = $_[0]; print "Processing $view2del...\n"; my @lines = `cleartool lsview -l $view2del`; my $tag; my $uuid; foreach(@lines) { chomp; $tag = $1 if /^Tag: (\S+)/; $uuid = $1 if /^View uuid: (\S+)/; s/^/\t/; print "$_\n"; } if ( $tag eq '' or $uuid eq '' ) { print "Error! $view2del: unable to get tag and/or uuid\n"; return 0; } my $err_count = 0; print "\tremoving tag...\n"; my $cmd = "cleartool rmtag -view $tag"; $err_count += 1 if DoIt($cmd); print "\tunregistering view storage...\n"; $cmd = "cleartool unreg -view -uuid $uuid"; $err_count += 1 if DoIt($cmd); print "\tremoving view references...\n"; $cmd = "cleartool rmview -force -avobs -uuid $uuid"; $err_count += 1 if DoIt($cmd); if ( $err_count == 0 ) { print "Success! removed view $view2del\n"; } else { print "Error! errors occured while removing $view2del\n"; }}#############################################sub DoIt { my $ret = system($_[0]) / 256; print "Error! cmd failed: $_[0]\n" if $ret != 0; return $ret;}

The extra steps needed for removing CCWeb Views are described in this IBM technote:

Note: For ClearCase 7.1.1.1 or 7.1.1.2 the session.dat file is no longer generated from ClearCase 7.1.1.1 as a result of APAR PM03334: session.dat no longer need to be cleaned.

By default, view.stg (CCRC / CCWeb view storage), view.dat and VOB's cached files are stored in the following location:

Windows®: C:\Program Files\Rational\ClearCase\var\ccweb\\UNIX® / Linux®: /var/adm/rational/clearcase/ccweb//

Remove the folder located in the location above. This will remove view's storage files, view.dat and VOB's cached files and will let the user create a new view using the same / original view's name.

Note: It may also be necessary to manually remove the view workspace if the view is still present on the CCRC client. This can done by navigating to the defined workspace on the client system (by default C:\Documents and Settings\\view_tag) and removing the view workspace.
This path to the workspace is listed in the session .dat file. The entry looks like this: -workroot "c:/web_dev2". This may become useful in a case where the user did not use the default location.

CCRC view roots are also cached in a file on the client in the User Profile.
Check the following file and remove the already removed view from that list as well.

C:\Documents and Settings\\.ccase_wvreg

View the original article here

Tuesday, November 30, 2010

Re: Does anyone has a script to clean up lost+found directory?

Permlink Replies: 3 - Pages: 1 - Last Post: Nov 25, 2010 10:52 AM Last Post By: Jirong_Hu Threads: [ Previous | Next ]
Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:22:44 PM I believe I had one, but can't find it. Can anyone post one here?

Thanks
Jirong


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:33:40 PM   in response to: Jirong_Hu in response to: Jirong_Hu's post I have a file in lost+found, can't be deleted. Can anyone help?

Thanks
Jirong

M:\c999752_view\Mainframe_CVOB2\lost+found>dir
Volume in drive M is CCase
Volume Serial Number is 0234-5789

Directory of M:\c999752_view\Mainframe_CVOB2\lost+found

11/24/2010 04:27 PM

.
11/01/2010 03:31 PM ..
08/03/2010 10:03 AM 0 -nc.211a92e1797b4a50a0f59f0085a9d277
1 File(s) 0 bytes
2 Dir(s) 52,428,800,000 bytes free

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem *
cleartool: Error: Pathname not found: "*".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f \"-nc.211a92e1797b4a50a0f59f0085a9d27
7\"
cleartool: Error: Pathname not found: ""-nc.211a92e1797b4a50a0f59f0085a9d277"".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f "-nc.211a92e1797b4a50a0f59f0085a9d277
"
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.*
cleartool: Error: Unrecognized option "-nc.*"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.211a92e1797b4a50a0f59f0085a9d277
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>\


Posts: 416
Registered: Mar 15, 2005 04:40:07 AM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 05:35:48 AM   in response to: Jirong_Hu in response to: Jirong_Hu's post Jirong_Hu wrote:
> I have a file in lost+found, can't be deleted. Can anyone help?

Your question here doesn't match your subject.
The FAQ for your one file problem is: ./-nc*

FAQ 1.1.1

The FAQ for your subject question is less simple, and less tidy:

FAQ 1.5.8

Marc


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 10:52:47 AM   in response to: 314 in response to: 314's post Hi Marc

Thanks a lot for your information. I was trying \.

Jirong

Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here

Monday, November 29, 2010

Re: Does anyone has a script to clean up lost+found directory?

Permlink Replies: 3 - Pages: 1 - Last Post: Nov 25, 2010 10:52 AM Last Post By: Jirong_Hu Threads: [ Previous | Next ]
Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:22:44 PM I believe I had one, but can't find it. Can anyone post one here?

Thanks
Jirong


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:33:40 PM   in response to: Jirong_Hu in response to: Jirong_Hu's post I have a file in lost+found, can't be deleted. Can anyone help?

Thanks
Jirong

M:\c999752_view\Mainframe_CVOB2\lost+found>dir
Volume in drive M is CCase
Volume Serial Number is 0234-5789

Directory of M:\c999752_view\Mainframe_CVOB2\lost+found

11/24/2010 04:27 PM

.
11/01/2010 03:31 PM ..
08/03/2010 10:03 AM 0 -nc.211a92e1797b4a50a0f59f0085a9d277
1 File(s) 0 bytes
2 Dir(s) 52,428,800,000 bytes free

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem *
cleartool: Error: Pathname not found: "*".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f \"-nc.211a92e1797b4a50a0f59f0085a9d27
7\"
cleartool: Error: Pathname not found: ""-nc.211a92e1797b4a50a0f59f0085a9d277"".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f "-nc.211a92e1797b4a50a0f59f0085a9d277
"
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.*
cleartool: Error: Unrecognized option "-nc.*"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.211a92e1797b4a50a0f59f0085a9d277
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>\


Posts: 416
Registered: Mar 15, 2005 04:40:07 AM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 05:35:48 AM   in response to: Jirong_Hu in response to: Jirong_Hu's post Jirong_Hu wrote:
> I have a file in lost+found, can't be deleted. Can anyone help?

Your question here doesn't match your subject.
The FAQ for your one file problem is: ./-nc*

FAQ 1.1.1

The FAQ for your subject question is less simple, and less tidy:

FAQ 1.5.8

Marc


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 10:52:47 AM   in response to: 314 in response to: 314's post Hi Marc

Thanks a lot for your information. I was trying \.

Jirong

Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here

Re: Does anyone has a script to clean up lost+found directory?

Permlink Replies: 3 - Pages: 1 - Last Post: Nov 25, 2010 10:52 AM Last Post By: Jirong_Hu Threads: [ Previous | Next ]
Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:22:44 PM I believe I had one, but can't find it. Can anyone post one here?

Thanks
Jirong


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:33:40 PM   in response to: Jirong_Hu in response to: Jirong_Hu's post I have a file in lost+found, can't be deleted. Can anyone help?

Thanks
Jirong

M:\c999752_view\Mainframe_CVOB2\lost+found>dir
Volume in drive M is CCase
Volume Serial Number is 0234-5789

Directory of M:\c999752_view\Mainframe_CVOB2\lost+found

11/24/2010 04:27 PM

.
11/01/2010 03:31 PM ..
08/03/2010 10:03 AM 0 -nc.211a92e1797b4a50a0f59f0085a9d277
1 File(s) 0 bytes
2 Dir(s) 52,428,800,000 bytes free

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem *
cleartool: Error: Pathname not found: "*".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f \"-nc.211a92e1797b4a50a0f59f0085a9d27
7\"
cleartool: Error: Pathname not found: ""-nc.211a92e1797b4a50a0f59f0085a9d277"".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f "-nc.211a92e1797b4a50a0f59f0085a9d277
"
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.*
cleartool: Error: Unrecognized option "-nc.*"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.211a92e1797b4a50a0f59f0085a9d277
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>\


Posts: 416
Registered: Mar 15, 2005 04:40:07 AM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 05:35:48 AM   in response to: Jirong_Hu in response to: Jirong_Hu's post Jirong_Hu wrote:
> I have a file in lost+found, can't be deleted. Can anyone help?

Your question here doesn't match your subject.
The FAQ for your one file problem is: ./-nc*

FAQ 1.1.1

The FAQ for your subject question is less simple, and less tidy:

FAQ 1.5.8

Marc


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 10:52:47 AM   in response to: 314 in response to: 314's post Hi Marc

Thanks a lot for your information. I was trying \.

Jirong

Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here

Does anyone has a script to clean up lost+found directory?

Permlink Replies: 3 - Pages: 1 - Last Post: Nov 25, 2010 10:52 AM Last Post By: Jirong_Hu Threads: [ Previous | Next ]
Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:22:44 PM I believe I had one, but can't find it. Can anyone post one here?

Thanks
Jirong


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 24, 2010 04:33:40 PM   in response to: Jirong_Hu in response to: Jirong_Hu's post I have a file in lost+found, can't be deleted. Can anyone help?

Thanks
Jirong

M:\c999752_view\Mainframe_CVOB2\lost+found>dir
Volume in drive M is CCase
Volume Serial Number is 0234-5789

Directory of M:\c999752_view\Mainframe_CVOB2\lost+found

11/24/2010 04:27 PM

.
11/01/2010 03:31 PM ..
08/03/2010 10:03 AM 0 -nc.211a92e1797b4a50a0f59f0085a9d277
1 File(s) 0 bytes
2 Dir(s) 52,428,800,000 bytes free

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem *
cleartool: Error: Pathname not found: "*".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f \"-nc.211a92e1797b4a50a0f59f0085a9d27
7\"
cleartool: Error: Pathname not found: ""-nc.211a92e1797b4a50a0f59f0085a9d277"".

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f "-nc.211a92e1797b4a50a0f59f0085a9d277
"
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.*
cleartool: Error: Unrecognized option "-nc.*"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>cleartool rmelem -f -nc.211a92e1797b4a50a0f59f0085a9d277
cleartool: Error: Unrecognized option "-nc.211a92e1797b4a50a0f59f0085a9d277"
Usage: rmelem -force [-c comment | -cfile pname | -cq | -cqe | -nc] pname ...

M:\c999752_view\Mainframe_CVOB2\lost+found>\


Posts: 416
Registered: Mar 15, 2005 04:40:07 AM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 05:35:48 AM   in response to: Jirong_Hu in response to: Jirong_Hu's post Jirong_Hu wrote:
> I have a file in lost+found, can't be deleted. Can anyone help?

Your question here doesn't match your subject.
The FAQ for your one file problem is: ./-nc*

FAQ 1.1.1

The FAQ for your subject question is less simple, and less tidy:

FAQ 1.5.8

Marc


Posts: 280
Registered: Sep 04, 2008 05:41:32 PM Re: Does anyone has a script to clean up lost+found directory?
Posted: Nov 25, 2010 10:52:47 AM   in response to: 314 in response to: 314's post Hi Marc

Thanks a lot for your information. I was trying \.

Jirong

Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here

Thursday, November 18, 2010

Subject: DateTime field error in Mashup Script - by: rfrinder

After upgrading from TeamTrack 6.6.1.16 to SBM 2009 R3, I am getting an error on a date filed in the script.

I am trying to read a date field on the form and then trying to see if it exists in an Aux table. If it exists in the Aux table, we define this as being in a freeze period. However, when the Aux table is trying to be read with a ReadWithWhere(whereClause) I get the error.

th section of the script that is causing the error is here:

call ext.setCompatibilityVersion(7,0)
~~
~~
if (IssueType = 15 or IssueType = 16 or IssueType = 17) and (TransitionID = 4 or TransitionID = 28 or TransitionID = 88 or TransitionID = 144) or TransitionID = 119 or TransitionID = 106 then
fldOK = Shell.Item.GetFieldValue("Target Date" , intTargetDate)
shell.redomessage="we have a freeze date find :: " & "Target date is " & intTargetDate
tableId = "1015" ' Freeze Date
Set myRecord = Ext.CreateAppRecord(1015)
whereClause = "TS_FREEZE_DATE = " & intTargetDate
if myRecord.ReadWithWhere(whereClause) Then
fldOK = Shell.Item.SetFieldValue("Exception Required" , "1")
fldOK = myRecord.GetFieldValue("Freeze Date End", intFDEnd)
fldOK = Shell.Item.SetFieldValue("Exception Expiration Date" , intFDEnd)
else
fldOK = Shell.Item.SetFieldValue("Exception Required" , "0")
fldOK = Shell.Item.SetFieldValue("Exception Approved" , "0")
intFDEnd = ""
fldOK = Shell.Item.SetFieldValue("Exception Expiration Date" , intFDEnd)
end if
end if

The error message is below:

The record with the 'select U_FREEZE_DATES.TS_ID, U_FREEZE_DATES.TS_UUID, U_FREEZE_DATES.TS_TITLE, U_FREEZE_DATES.TS_FREEZE_DATE, U_FREEZE_DATES.TS_APP_FREEZE_TYPE, U_FREEZE_DATES.TS_FREEZE_DATE_END, U_FREEZE_DATES.TS_DESCRIPTION from U_FREEZE_DATES where TS_Freeze_Date = 2010-11-16T00:00:00+00:00' select statement could not be read in the 'Freeze Dates' database table.
(TTexcIDS_EXC_CANNOT_READ_RECORD_WITH_SELECT_STMT)
Incorrect syntax near '00'.

Do I need to convert to Integer and query that?


View the original article here

Wednesday, November 17, 2010

Subject: DateTime field error in Mashup Script - by: Nikolay Ruban

DateTime field error in Mashup Script 22 Hours, 18 Minutes ago After upgrading from TeamTrack 6.6.1.16 to SBM 2009 R3, I am getting an error on a date filed in the script.

I am trying to read a date field on the form and then trying to see if it exists in an Aux table. If it exists in the Aux table, we define this as being in a freeze period. However, when the Aux table is trying to be read with a ReadWithWhere(whereClause) I get the error.

th section of the script that is causing the error is here:

call ext.setCompatibilityVersion(7,0)
~~
~~
if (IssueType = 15 or IssueType = 16 or IssueType = 17) and (TransitionID = 4 or TransitionID = 28 or TransitionID = 88 or TransitionID = 144) or TransitionID = 119 or TransitionID = 106 then
fldOK = Shell.Item.GetFieldValue("Target Date" , intTargetDate)
shell.redomessage="we have a freeze date find :: " & "Target date is " & intTargetDate
tableId = "1015" ' Freeze Date
Set myRecord = Ext.CreateAppRecord(1015)
whereClause = "TS_FREEZE_DATE = " & intTargetDate
if myRecord.ReadWithWhere(whereClause) Then
fldOK = Shell.Item.SetFieldValue("Exception Required" , "1")
fldOK = myRecord.GetFieldValue("Freeze Date End", intFDEnd)
fldOK = Shell.Item.SetFieldValue("Exception Expiration Date" , intFDEnd)
else
fldOK = Shell.Item.SetFieldValue("Exception Required" , "0")
fldOK = Shell.Item.SetFieldValue("Exception Approved" , "0")
intFDEnd = ""
fldOK = Shell.Item.SetFieldValue("Exception Expiration Date" , intFDEnd)
end if
end if

The error message is below:

The record with the 'select U_FREEZE_DATES.TS_ID, U_FREEZE_DATES.TS_UUID, U_FREEZE_DATES.TS_TITLE, U_FREEZE_DATES.TS_FREEZE_DATE, U_FREEZE_DATES.TS_APP_FREEZE_TYPE, U_FREEZE_DATES.TS_FREEZE_DATE_END, U_FREEZE_DATES.TS_DESCRIPTION from U_FREEZE_DATES where TS_Freeze_Date = 2010-11-16T00:00:00+00:00' select statement could not be read in the 'Freeze Dates' database table.
(TTexcIDS_EXC_CANNOT_READ_RECORD_WITH_SELECT_STMT)
Incorrect syntax near '00'.

Do I need to convert to Integer and query that?

The administrator has disabled public write access. Re:DateTime field error in Mashup Script 5 Hours, 30 Minutes ago Nikolay, yes the new db format in SBM is using DateTime for Date fields.
The returned value is an integer '1289952000' and I am trying to do a CreateAppRecord based on this to another table with a date field.
Here is what I am using:

fldOK = Shell.Item.GetFieldValue("Target Date" , intTargetDate)
tableId = "1015" ' Freeze Date
Set myRecord = Ext.CreateAppRecord(1015)
TargetDate = CStr(ext.dblongtodate(intTargetDate))
whereClause = "TS_FREEZE_DATE = " & TargetDate
shell.redomessage="we have to find a freeze date:: " & "Target date integer is " & intTargetDate & " and TargetDate is " & TargetDate
if myRecord.ReadWithWhere(whereClause) Then

This is the error I am getting now:
The record with the 'select U_FREEZE_DATES.TS_ID, U_FREEZE_DATES.TS_UUID, U_FREEZE_DATES.TS_TITLE, U_FREEZE_DATES.TS_FREEZE_DATE, U_FREEZE_DATES.TS_APP_FREEZE_TYPE, U_FREEZE_DATES.TS_FREEZE_DATE_END, U_FREEZE_DATES.TS_DESCRIPTION from U_FREEZE_DATES where TS_FREEZE_DATE = 11/16/2010 7:00:00 PM' select statement could not be read in the 'Freeze Dates' database table.
(TTexcIDS_EXC_CANNOT_READ_RECORD_WITH_SELECT_STMT)
Incorrect syntax near '7'.

The field "Target Date" is a field on the form input by a user. The U_Freeze_Date table are defined Freeze Dates in my company. If the Target Date(from the form) exists in the Freeze Date table I need to set a flag. How do I find if the field "Target Date" exists in the Aux Table?

The administrator has disabled public write access. Re:DateTime field error in Mashup Script 2 Hours, 47 Minutes ago yes we are using MSSQL.
The problem is I get the field value Target_Date as an integer. I am trying to do an ext.CreateAppRecord on an Aux table on for a date based on the Target_Date field that was read.
When I do this in SQL, it works:
select * from U_FREEZE_DATES
where TS_Freeze_DATE = (select TS_TARGET_DATE
from UCR_CHANGE_REQUESTS
where TS_ISSUEID = 29044)

yet when I use the same logic in TeamScript, it returns an error.
we have to find a freeze date:: Target date integer is 1289952000 and TargetDate is 11/16/2010 7:00:00 PM
The record with the 'select U_FREEZE_DATES.TS_ID, U_FREEZE_DATES.TS_UUID, U_FREEZE_DATES.TS_TITLE, U_FREEZE_DATES.TS_FREEZE_DATE, U_FREEZE_DATES.TS_APP_FREEZE_TYPE, U_FREEZE_DATES.TS_FREEZE_DATE_END, U_FREEZE_DATES.TS_DESCRIPTION from U_FREEZE_DATES where TS_FREEZE_DATE = 11/16/2010 7:00:00 PM' select statement could not be read in the 'Freeze Dates' database table.
(TTexcIDS_EXC_CANNOT_READ_RECORD_WITH_SELECT_STMT)
Incorrect syntax near '7'.

using this
if (IssueType = 15 or IssueType = 16 or IssueType = 17) and (TransitionID = 4 or TransitionID = 28 or TransitionID = 88 or TransitionID = 144) or TransitionID = 119 or TransitionID = 106 then
fldOK = Shell.Item.GetFieldValue("Target Date" , intTargetDate)
tableId = "1015" ' Freeze Date
Set myRecord = Ext.CreateAppRecord(1015)
TargetDate = CStr(ext.dblongtodate(intTargetDate))
whereClause = "TS_FREEZE_DATE = " & TargetDate
shell.redomessage="we have to find a freeze date:: " & "Target date integer is " & intTargetDate & " and TargetDate is " & TargetDate
if myRecord.ReadWithWhere(whereClause) Then
fldOK = Shell.Item.SetFieldValue("Exception Required" , "1")
fldOK = myRecord.GetFieldValue("Freeze Date End", intFDEnd)
fldOK = Shell.Item.SetFieldValue("Exception Expiration Date" , intFDEnd)
else
fldOK = Shell.Item.SetFieldValue("Exception Required" , "0")
fldOK = Shell.Item.SetFieldValue("Exception Approved" , "0")
intFDEnd = ""
fldOK = Shell.Item.SetFieldValue("Exception Expiration Date" , intFDEnd)
end if
end if

When I use what you suggested, I get this
RUNTIME ERROR IN SCRIPT "PostTransition" (id=8)
(called from post-transition context)

Numeric overflow -- ERR #2

Line 247> whereClause = "TS_FREEZE_DATE = DATEADD(SECOND," & CInt(intTargetDate) & ",'1970/01/01')"

Please understand I am not that good with TeamScripts.

The administrator has disabled public write access.

View the original article here

Tuesday, November 16, 2010

Re: ClearCase ALBD Service account change script for all my clients

Permlink Replies: 3 - Pages: 1 - Last Post: Nov 11, 2010 10:52 AM Last Post By: brownsly Threads: [ Previous | Next ]
Posts: 50
Registered: Jun 29, 2004 09:28:22 AM ClearCase ALBD Service account change script for all my clients
Posted: Oct 26, 2010 05:51:38 PM Dear friends,
I am looking Remotely change the ALBD service account's credentials with windows SC utilty scripts . I had a this script , unfortunatly I lost that . If any body have handy please share here .
thanks in advance
Posts: 195
Registered: Jan 15, 2005 05:15:03 PM Re: ClearCase ALBD Service account change script for all my clients
Posted: Oct 26, 2010 06:55:58 PM   in response to: kavetisri in response to: kavetisri's post mmmmmmmm . . . That is not good. . . .LOL

The script can be found here:

http://forums.abs-consulting.com/forum_posts.asp?TID=16&PN=1


Posts: 60
Registered: Nov 30, 2004 12:57:26 PM Re: ClearCase ALBD Service account change script for all my clients
Posted: Oct 27, 2010 12:45:49 PM   in response to: kavetisri in response to: kavetisri's post If you change the username for the service, you 'may' have to allow it to log on as a service.

Our IT department creates the PC image not bound to the domain. As such, ClearCase is installed using the local account for the ALBD service.

I have a batch script for them to run when configuring a PC for a new developer once it has been added to the domain.

This is the batch script:@echo offecho.echo. Allow OURDOMAIN\clearcase_albd to "log on as a Service"echo. secedit.exe /configure /db secedit.sdb /cfg \\server\IBM_SW_RATL_REPO\scripts\WIN32\albd_as_a_service.inf echo.echo. Update albd service to use OURDOMAIN\clearcase_albdecho. sc.exe config albd obj= OURDOMAIN\clearcase_albd password= "our password" echo.echo. Start albd serviceecho. sc.exe start albd

And here is the contents of albd_as_a_service.inf - note the SIDs will vary for your setup[Unicode]Unicode=yes[Version]signature="$CHICAGO$"Revision=1[Registry Values][Profile Description]Description=The steps to add OURDOMAIN\clearcase_albd as a service[Privilege Rights]SeServiceLogonRight = *S-1-5-80-0,*S-1-5-21-3506717557-1833320443-2181110176-9999
Posts: 1
Registered: Oct 05, 2010 11:55:47 AM Re: ClearCase ALBD Service account change script for all my clients
Posted: Nov 11, 2010 10:52:26 AM   in response to: kavetisri in response to: kavetisri's post If I use the change_albd.pl script, what is the syntax for sc.exe?Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here