Tuesday, December 13, 2011

has been updated by another user (3,1)

Whenever we have error with description: 'has been updated by another user (3,1)' in Application Designer, Purge Cache Directories in Configuration Manager will help. This is expected when we edit PeopleCode on Component level.

Some times it is not same as deleting files in directory: PS/CACHE. As such, first option is suggested over Second one.


Wednesday, November 30, 2011

Friday, November 11, 2011

Export import utility in Oracle


Exporting Setup Tables


STEP 1 :  Create a Directory Object in Sourced Oracle Database


CREATE DIRECTORY BKUP AS 'export directory path';

eg.,

a.  Login to the Source database using sysadm (if sysadm has directory creation rights) or system or sysdba and create the directory

CREATE DIRECTORY BKUP AS '/opt/oracle/expbkp';

b. Grant access to the directory to the sysadm user if you created the directory using non sysadm user


GRANT ALL ON DIRECTORY BKUP TO SYSADM;

EXIT


STEP 2 :  Prepare parameter file for exporting setup tables.  Change the values of the parameters userid, tables


a.  Edit the values of the parameters

USERID=SYSADM/SYSADM@DBNAME   --> change the logon credential
EXCLUDE=STATISTICS
COMPRESSION=ALL
DIRECTORY=BKUP  --> directory name created in the Step 1
TABLES=SETUP_TABLE_NAME1,   --> setup table names..
SETUP_TABLE_NAME2,
SETUP_TABLE_NAME3,
SETUP_TABLE_NAMEn

EG.,

USERID=SYSADM/SYSADM@HR91DMO  
EXCLUDE=STATISTICS
COMPRESSION=ALL
DIRECTORY=BKUP  
TABLES=PS_COUNTRY_TBL,
PS_REG_REGION_TBL,
PS_STATE_TBL



b. Login to the Server where the Source db is hosted and navigate to the backupfolder

c. create the parameter file setuptables.par

Open up any text editor and paste the above lines after changing the parameter values and save it as setuptables.par



STEP 3 :  Trigger the Oracle Export Utility

a.  Navigate to the the backup folder where you saved the parameter file and kick off the below script in the command line

expdp parfile=setuptables.par DUMPFILE=SETUPTABLES.dmp  LOGFILE=SETUPTABLES.log


STEP 4 : Monitor the execution of Step 3 for successful completion.  The output should be similar to the one given below..



Dump file set for SYSADM.SYS_EXPORT_TABLE_01 is:
  /opt/oracle/oradata/expbkup/SETUPTABLES.dmp
Job "SYSADM"."SYS_EXPORT_TABLE_01" successfully completed at 09:35:54



Exporting Transactional Tables


STEP 1 :  Create a Directory Object in the Source Database

If you first exported the setup tables, you can ignore this step as the directory was created when you
exported setup tables

STEP 2 : Create the parameter file for exporting transactional tables


USERID=SYSADM/SYSADM@DBNAME   --> change the logon credential
EXCLUDE=STATISTICS
COMPRESSION=ALL
DIRECTORY=BKUP  --> directory name created in the Step 1
TABLES=TRANS_TABLE_NAME1,   --> setup table names..
TRANS_TABLE_NAME2,
TRANS_TABLE_NAME3,
TRANS_TABLE_NAMEn
QUERY=TRANS_TABLE_NAME1:"WHERE ",
      TRANS_TABLE_NAME2:"WHERE ",
      TRANS_TABLE_NAME3:"WHERE "
      TRANS_TABLE_NAMEn:"WHERE "


eg.,

1. COMMON FILTER

USERID=SYSADM/SYSADM@HR91DMO  
EXCLUDE=STATISTICS
COMPRESSION=ALL
DIRECTORY=BKUP  
TABLES=PS_PERSON,
PS_NAMES
PS_ADDRESSES
QUERY="WHERE EMPLID LIKE 'KCN%'"   --> WHEN ALL TABLES ARE HAVING COMMON FILTER


2. DIFFERENCE IN FILTER

USERID=SYSADM/SYSADM@HR91DMO  
EXCLUDE=STATISTICS
COMPRESSION=ALL
DIRECTORY=BKUP  
TABLES=PS_PERSON,
PS_NAMES
PS_ADDRESSES


QUERY=PS_PERSON:"WHERE EMPLID LIKE 'KCN%'",   --> WHEN ALL TABLES ARE HAVING COMMON FILTER
PS_NAMES:"WHERE NAME_TYPE='PRI'",
PS_ADDRESSES:"WHERE CITY='SGP'"


b. Login to the Server where the Source db is hosted and navigate to the backupfolder

c. create the parameter file transtables.par

Open up any text editor and paste the above lines after changing the parameter values and save it as transtables.par


STEP 3 :  Trigger the Oracle Export Utility

a.  Navigate to the the backup folder where you saved the parameter file and kick off the below script in the command line


 expdp parfile=transtables.par DUMPFILE=TRANS_TABLES1.dmp  LOGFILE=TRANS_TABLES1.log


STEP 4 : Monitor the execution of Step 3 for successful completion.  The output should be similar to the one given below..


******************************************************************************
Dump file set for SYSADM.SYS_EXPORT_TABLE_01 is:
  /opt/oracle/oradata/expbkup/TRANS_TABLES.dmp
Job "SYSADM"."SYS_EXPORT_TABLE_01" successfully completed at 09:46:47




Importing the data in to source

Step 1 :  create a directory object in the Target Database

Step 2 :  Copy the .dmp files generated for setup and transactional tables in to the folder for which the directory object is created

Step 3 :  Kick off the impdp to import the data with appropriate import flags


Eg.,

impdp sysadm/SYSADM@hr91dmo directory=bkup full=y IGNORE=Y dumpfile=TRANS_TABLES.dmp logfile=trans_tables_import.log 

impdp sysadm/SYSADM@hr91dmo directory=bkup full=y IGNORE=Y dumpfile=SETUP_TABLES.dmp logfile=setup_tables_import.log 


Note :  IGNORE=Y should be mentioned if the setup and transactional tables are already present in the target database

Thursday, November 3, 2011

Locked Objects Delete


DELETE
   FROM PSCHGCTLLOCK

WHERE  OBJECTVALUE1 ='
obj_name' AND OPRID = 'Oprid'

Singapore NRIC Number Generator

http://samliew.com/icgen/

Tuesday, October 25, 2011

Simple SQL to load data from one table to other table with the same structure


Simple SQL to load data from one table to other table. It has below features
  1. It has exception section to avoid aborting the SQL for errors.
  2. It will tract the start and end time of loading.
  3. First one: First Section is record by record processing section. It will dynamically take the record names from a table. Source record is the same structure as destination but in different instance which is connected to Destination DB with a DBLink.
  4. Second Section: Second Section is row by row processing.
Please note that the text enclosed in Square Brace should be replaced with appropriate Record name/Field Name.


DECLARE

  ERRORCODE NUMBER(10);
  ERRORMESG VARCHAR2(1000);
  TIMESTMP TIMESTAMP;
  RECNAME12 VARCHAR2(20);
  STMT_STR VARCHAR2(500);
  RECNM2 VARCHAR2(500);
  RECNM1 VARCHAR2(500);
  SINGLESPACE VARCHAR2(500);
  SINGLESPACE1 VARCHAR2(500);
  ROW_COUNT1 NUMBER(10);
  ROW_COUNT2 NUMBER(10);

BEGIN
SELECT CURRENT_TIMESTAMP INTO TIMESTMP FROM DUAL;
DBMS_OUTPUT.PUT_LINE('Sample DC start '||TIMESTMP);

FOR J IN(SELECT RECNAME RECNAME1 FROM [RECORD WITH TABLE NAMES] WHERE FLAG_FIELD = 'REC')

LOOP
   BEGIN
    STMT_STR := 'INSERT INTO [Log TAble1](RECNAME,BEGINDTTM,ENDDTTM,ROW_COUNT,TOTAL_ROW_COUNT,ERRCOLORBG,DESCR200) VALUES(:TEST1,:TEST2,:TEST3,:TEST4,:TEST5,:TEST6,:TEST7)';
    EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM PS_'||J.RECNAME1||'@[DB Link NAme]' INTO ROW_COUNT1 ;
    EXECUTE IMMEDIATE STMT_STR USING J.RECNAME1,CURRENT_TIMESTAMP,SYSDATE,ROW_COUNT1,0,' ',' ';
   
    EXECUTE IMMEDIATE 'INSERT INTO PS_'||J.RECNAME1||' SELECT * FROM PS_'||J.RECNAME1||'@[DB Link NAme]';
   
    STMT_STR := 'INSERT INTO [Log TAble1](RECNAME,BEGINDTTM,ENDDTTM,ROW_COUNT,TOTAL_ROW_COUNT,ERRCOLORBG,DESCR200) VALUES(:TEST1,:TEST2,:TEST3,:TEST4,:TEST5,:TEST6,:TEST7)';
    EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM PS_'||J.RECNAME1 INTO ROW_COUNT2 ;
    EXECUTE IMMEDIATE STMT_STR USING J.RECNAME1,CURRENT_TIMESTAMP,SYSDATE,ROW_COUNT1,ROW_COUNT2,' ',' ';
   
    EXCEPTION
    WHEN OTHERS THEN
      errorcode := SQLCODE;
      ERRORMESG := SQLERRM;
      ERRORMESG := ERRORMESG || '->(' || J.RECNAME1  || ')' ;
      EXECUTE IMMEDIATE 'INSERT INTO SYSADM.[Log TAble1](RECNAME,BEGINDTTM,ENDDTTM,ROW_COUNT,TOTAL_ROW_COUNT,ERRCOLORBG,DESCR200) VALUES(:TEST1,:TEST2,:TEST3,:TEST4,:TEST5,:TEST6,:TEST7)' USING J.RECNAME1,CURRENT_TIMESTAMP,SYSDATE,ROW_COUNT1,0,' ',ERRORMESG;
      COMMIT;
      DBMS_OUTPUT.PUT_LINE(TO_CHAR(ERRORCODE) || '-' || ERRORMESG);
   
  END;
END LOOP;
COMMIT;
DBMS_OUTPUT.PUT_LINE('Sample DC End '||TIMESTMP);

---------- Second Section - Start ---------
-- Table1
    SELECT CURRENT_TIMESTAMP INTO TIMESTMP FROM DUAL;
    dbms_output.put_line('Table1 start '||timestmp);
--    SELECT 'Table1' INTO RECNAME1 FROM DUAL;
--Insert total count in log table before running script
    INSERT INTO [Log TAble1](RECNAME,BEGINDTTM,ENDDTTM,ROW_COUNT,TOTAL_ROW_COUNT,ERRCOLORBG,DESCR200) VALUES('[Table1]',CURRENT_TIMESTAMP,NULL,(SELECT COUNT(*) FROM [Table1]@[DB Link Name]),0,' ',' ');

--Insert 8.3 table data into 9.1 table
      FOR J IN (SELECT [Field1] Field1,
      [FIELD2] FIELD2,
      [FIELD3] FIELD3,
      [FIELD4] FIELD4,
      [FIELD5] FIELD5,
      [Field6] Field6 FROM [Table1]@[DB Link Name])
   
LOOP
                BEGIN
                                INSERT INTO [TABLE1]
                                ([Field1],
      [Field2],
      [FIELD3],
      [Field4],
      [Field5],
      [FIELD6])
    VALUES
    (J.field1,
    J.field2,
    J.FIELD3,
    J.field4,
    J.FIELD5,
    J.FIELD6);
   
                EXCEPTION
                                                WHEN OTHERS THEN
                                                                errorcode := SQLCODE;
                                                                ERRORMESG := SQLERRM;
                                                                errormesg := errormesg || '->(' || J.field1 || ',' || J.field2 || ',' || J.field3 || ')' ;
       
                                                INSERT INTO [DETAILED LOG TABLE2](RECNAME,BEGINDTTM,ENDDTTM,FIELDNAME0,FIELDNAME1,FIELDNAME2,DESCR200) VALUES ('[Table1]',CURRENT_TIMESTAMP,NULL,'[field1]','[field2]','[field3]',ERRORMESG);
   
                                                COMMIT;
                               
    dbms_output.put_line(TO_CHAR(errorcode) || '-' || errormesg);
                END;
END LOOP;

DBMS_OUTPUT.PUT_LINE('table1 completed '||TIMESTMP);
INSERT INTO [Log TAble1](RECNAME,BEGINDTTM,ENDDTTM,ROW_COUNT,TOTAL_ROW_COUNT,ERRCOLORBG,DESCR200) VALUES('[Table1]',CURRENT_TIMESTAMP,NULL,(SELECT COUNT(*) FROM [Table1]@[db link name]),(SELECT COUNT(*) FROM [Table1]),' ',' ');
COMMIT;


END;

Tuesday, October 18, 2011

Issue in loading PeopleTools

If we have any issue with loading PeopleTools, it can be because of Visual Studio is not installed in your machine. Try running file as specified below.

File name: psvccrt_retail.msi Path: PeopleTools8.51\PT8.51\setup\psvccrt

Monday, October 3, 2011

Oracle SQL Developer Online Demonstrations

General Tips - Fix Drive letter for your External Hard Disk

When we connect external hard disk, it will be given with next available alphabet. It is quite often that the alphabet will be changed. We have to map the shortcuts/PST files every time the alphabet is changed.

To fix this, we can fix alphabet for a hard disk. Choose an alphabet way out in disk alphabets. With this what ever the USB port we connect the drive, the same alphabet will be assigned. Below are the steps for the same.

1. Go to Disk Management: Right click on My Computer, select Manage, on left panel select Disk Management. (Or Run command: diskmgmt.msc)
2. Right click the device and select Change Device Letter and Paths. Click Button: Change and assign an alphabet way out in the Disk Drives Alphabets (I have chosen K).

Hope this helps.
For Some more tips on external hard disk follow URL: http://lifehacker.com/5624331/top-10-external-hard-drive-tricks

Friday, September 30, 2011

Compareit - Powerful tool to compare files

Compareit is very powerful tool to compare data. Its free and can download it from internet. Some of the links where we can download it form are given below.

http://www.grigsoft.com/wincmp3.htm
http://download.cnet.com/Compare-It/3000-2248_4-10832602.html

MailMerge - Simple reporting in MS Office

We can use MS Office feature called MailMerge to generate simple reports. We can prepare template in Word, link data from Excel sheet. Follow below links for the procedure.

http://office.microsoft.com/en-us/word-help/CH010062628.aspx
http://mistupid.com/technical/mailmerge/

Wednesday, September 21, 2011

Access the Menu Security page (PeopleTools, Portal, View Menu Security)

Path: Main Menu > PeopleTools > Portal > View Menu Security


Use this page to view a list of folders or content references to which a user ID, role, or permission list has access. View Menu Folder Structure and View Menu Item Detail in the same path as above are also useful.

Tables

To find all the Oracle Database Tables: SELECT * FROM TAB;
To find all the PS AppDesigner Tables: SELECT * FROM PSRECDEFN;

To Migrate Audit Records/Settings

When a record is migrated to other instance (ex: DEV to STG) whose audit settings are changed, destination instance audit will not work properly. To avoid this situation, we have to manually update the audit record in destination instance and save.

If we have too many records, the above procedure is not suggestible. instead, we copy data from below tables from source instance to destination instance. we can use DMS for that. (Please test it first before implementing for all the records)


SELECT * FROM SYSADM.PSRECFIELD WHERE RECNAME = 'PSOPRDEFN';
SELECT * FROM SYSADM.PSRECDEFN WHERE RECNAME = 'PSOPRDEFN';

Friday, July 8, 2011

To get page level access in PeopleSoft

To get page level access in PeopleSoft:
-------------------------------------------------------------------------------------------------------------------------------------------------------
select x.menuname, x.barname, x.baritemname, x.pnlgrpname, x.itemname, x.itemlabel ,
(select distinct a1.classid from psroleclass a1, PSAUTHITEM x1 where x1.menuname = x.menuname and x1.barname = x.barname and x1.baritemname = x.baritemname and x1.pnlitemname = x.pnlitemname and a1.classid = x1.classid and rolename = 'HM_GPR_SUPER_ADMIN')HM_GPR_SUPER_ADMIN,
(select distinct a2.classid from psroleclass a2, PSAUTHITEM x2 where x2.menuname = x.menuname and x2.barname = x.barname and x2.baritemname = x.baritemname and x2.pnlitemname = x.pnlitemname and a2.classid = x2.classid and rolename = 'HM_GPR_ADVANCE_ADMIN')HM_GPR_ADVANCE_ADMIN,
(select distinct a3.classid from psroleclass a3, PSAUTHITEM x3 where x3.menuname = x.menuname and x3.barname = x.barname and x3.baritemname = x.baritemname and x3.pnlitemname = x.pnlitemname and a3.classid = x3.classid and rolename = 'HM_GPR_ADMIN')HM_GPR_ADMIN,
(select distinct a4.classid from psroleclass a4, PSAUTHITEM x4 where x4.menuname = x.menuname and x4.barname = x.barname and x4.baritemname = x.baritemname and x4.pnlitemname = x.pnlitemname and a4.classid = x4.classid and rolename = 'HM_GPR_BONUS_ADMIN')HM_GPR_BONUS_ADMIN,
(select distinct a5.classid from psroleclass a5, PSAUTHITEM x5 where x5.menuname = x.menuname and x5.barname = x.barname and x5.baritemname = x.baritemname and x5.pnlitemname = x.pnlitemname and a5.classid = x5.classid and rolename = 'HM_GPR_SETUP_ADMIN')HM_GPR_SETUP_ADMIN,
(select distinct a6.classid from psroleclass a6, PSAUTHITEM x6 where x6.menuname = x.menuname and x6.barname = x.barname and x6.baritemname = x.baritemname and x6.pnlitemname = x.pnlitemname and a6.classid = x6.classid and rolename = 'HM_GPR_SETUP_READ')HM_GPR_SETUP_READ,
(select distinct a7.classid from psroleclass a7, PSAUTHITEM x7 where x7.menuname = x.menuname and x7.barname = x.barname and x7.baritemname = x.baritemname and x7.pnlitemname = x.pnlitemname and a7.classid = x7.classid and rolename = 'HM_GPR_BANK_UPDATE')HM_GPR_BANK_UPDATE
from (select distinct a.menuname, a.barname, a.baritemname, a.pnlitemname, p.pnlgrpname, p.itemname, p.itemlabel
FROM PSAUTHITEM a, pspnlgroup p
Where ((a.baritemname = p.pnlgrpname and a.pnlitemname = p.pnlname)
or (a.pnlitemname = p.pnlname and p.pnlgrpname = p.pnlname)
or (a.baritemname = p.pnlgrpname and p.pnlgrpname = p.pnlname))
-- where p.pnlgrpname = a.baritemname
-- and p.itemname = a.pnlitemname
--and pnlitemname = 'GP_DURATION'
and classid in (select distinct classid from psroleclass
where rolename like 'HM_GPR_%'and rolename not in ( 'HM_GPR_TEMP', 'HM_GPR_QUERY', 'HM_GPR_USERS'))
order by menuname, barname, baritemname, pnlgrpname, itemname) x
-------------------------------------------------------------------------------------------------------------------------------------------------------
-- security matrix read/write
select x.menuname, x.barname, x.baritemname, x.pnlgrpname, x.itemname, x.itemlabel ,
(select distinct decode(x1.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a1, PSAUTHITEM x1 where x1.menuname = x.menuname and x1.barname = x.barname and x1.baritemname = x.baritemname and x1.pnlitemname = x.pnlitemname and a1.classid = x1.classid and rolename = 'HM_GPR_SUPER_ADMIN')HM_GPR_SUPER_ADMIN,
(select distinct decode(x2.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a2, PSAUTHITEM x2 where x2.menuname = x.menuname and x2.barname = x.barname and x2.baritemname = x.baritemname and x2.pnlitemname = x.pnlitemname and a2.classid = x2.classid and rolename = 'HM_GPR_ADVANCE_ADMIN')HM_GPR_ADVANCE_ADMIN,
(select distinct decode(x3.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a3, PSAUTHITEM x3 where x3.menuname = x.menuname and x3.barname = x.barname and x3.baritemname = x.baritemname and x3.pnlitemname = x.pnlitemname and a3.classid = x3.classid and rolename = 'HM_GPR_ADMIN')HM_GPR_ADMIN,
(select distinct decode(x4.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a4, PSAUTHITEM x4 where x4.menuname = x.menuname and x4.barname = x.barname and x4.baritemname = x.baritemname and x4.pnlitemname = x.pnlitemname and a4.classid = x4.classid and rolename = 'HM_GPR_BONUS_ADMIN')HM_GPR_BONUS_ADMIN,
(select distinct decode(x5.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a5, PSAUTHITEM x5 where x5.menuname = x.menuname and x5.barname = x.barname and x5.baritemname = x.baritemname and x5.pnlitemname = x.pnlitemname and a5.classid = x5.classid and rolename = 'HM_GPR_SETUP_ADMIN')HM_GPR_SETUP_ADMIN,
(select distinct decode(x6.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a6, PSAUTHITEM x6 where x6.menuname = x.menuname and x6.barname = x.barname and x6.baritemname = x.baritemname and x6.pnlitemname = x.pnlitemname and a6.classid = x6.classid and rolename = 'HM_GPR_SETUP_READ')HM_GPR_SETUP_READ,
(select distinct decode(x7.displayonly ,0, 'Read/Write', 'Display Only') from psroleclass a7, PSAUTHITEM x7 where x7.menuname = x.menuname and x7.barname = x.barname and x7.baritemname = x.baritemname and x7.pnlitemname = x.pnlitemname and a7.classid = x7.classid and rolename = 'HM_GPR_BANK_UPDATE')HM_GPR_BANK_UPDATE
from (select distinct a.menuname, a.barname, a.baritemname, a.pnlitemname, p.pnlgrpname, p.itemname, p.itemlabel
FROM PSAUTHITEM a, pspnlgroup p
Where ((a.baritemname = p.pnlgrpname and a.pnlitemname = p.pnlname)
or (a.pnlitemname = p.pnlname and p.pnlgrpname = p.pnlname)
or (a.baritemname = p.pnlgrpname and p.pnlgrpname = p.pnlname))
-- where (a.pnlitemname = p.pnlname or a.baritemname = pnlname)
--where p.pnlgrpname = a.baritemname
--and p.itemname = a.pnlitemname
--and pnlitemname = 'GP_DURATION'
and classid in (select distinct classid from psroleclass
where rolename like 'HM_GPR_%'and rolename not in ( 'HM_GPR_TEMP', 'HM_GPR_QUERY', 'HM_GPR_USERS'))
order by menuname, barname, baritemname, pnlitemname, itemname) x

Tuesday, May 31, 2011

Trick to remove Blank lines in Text

1. copy the content to MS Word
2. Find: ^p^p
Replace: ^p

FYI: If we have complex blank lines the below procedure can help

There may be spaces and tabs that interfere with a normal ^p^p find/replace operation. If tabs and double spaces are not required by the other entries, I suggest this:

Find: ^t
Replace: (space)

Find: (space)(space)
Replace: (space)
(and do this until the find count is 0; remember to save the document every time)

Find: ^l
Replace: ^p

Find: ^p(space)
Replace: ^p
(do this until the find count is 0)

Find: (space)^p
Replace: ^p
(do this until the find count is 0)

Find: ^p^p
Replace: ^p
(do this until you're happy with the result)

Wednesday, May 25, 2011

Restrictions on ROWNUM in SQL

We can't use ROWNUM in a query with greater than condition.

For Example, we have below queries.

SELECT * FROM EMPTABLE WHERE ROWNUM > 100

output: 0 rows returned.

SELECT * FROM EMPTABLE WHERE ROWNUM < 100

output: it returns all 100 rows.

It is because rownum is a dymanic number generated and assigned to the rows while fetching the data from database. which is something like counting from 1,2..... It can't read which is 100th row unless it knows previous rows starting from 1. Hence it doesn't work with greater than (>) condition.

Wednesday, May 18, 2011

Change the file name

Refer the below link:

Please note that this can be used only for the filenames without space in it.

Tuesday, May 10, 2011

Dealing with Time Stamp in XML Files

If you are using Time Stamp in XML Files and XML file is being generated by Application Engine (AE), then you may probably get some issue with the time part of the timestamp. The output will show only 12 Hr insted of 24 Hr value. To nullify this issue, syntax like below.

Let us suppose the data in DB is: 01-jan-2011 14:20:23

DateTimeToLocalizedString(FIELD_TIMESTAMP,'hh:mm:ss'); will give output as : 02:20:23
DateTimeToLocalizedString(FIELD_TIMESTAMP,'HH:MM:SS'); will give output as : 14:20:23

Use upper case always to avoid surprises.