Wednesday, April 9, 2008

Turn an Error Message into a SQL Statement

Consider the following error message from the server.log:

2008-03-20 15:39:07,946 ERROR [com.tririga.design.smartobject.dataaccess.GenerateSqls](ExecuteThread: '13' for queue: 'weblogic.kernel.Default') Statement : update T_TRISERVICEREQUEST set sys_projectid = 1,triDescriptionTX = ?,triStatusCL = ?,triStatusCLObjId = ?,triControlNumberCN = ?,Sys_Parent1 = ?,triPreviousStatusCL = ?,triPreviousStatusCLObjId = ?,triRequestClassCL = ?,triRequestClassCLObjId = ?,triModifiedSY = ?,coContactNumberTX = ?,triRecordNameSY = ?,triRecordStateSY = ?,triModifiedByTX = ?,triModifiedByTXObjId = ?,triRequestFullNameTX = ? where spec_id = ?

Values :
test4,
Review In Progress,
1601066,
REQ 1000516,
0,
Draft,
1600256,
CRE Moves, ten or less associates (MOVES03),
4737839,
03/20/2008 03:39:07 PM,
xxx,
REQ 1000516-0,
triReview,
Zombron, Robert - eyk343,
3835835,
REQ 1000516-CRE Moves, ten or less associates (MOVES03),
6564922,

To troubleshoot why this error message was thrown, turn it into a SQL statement like the one below, run it in SQLPlus and use your SQL troubleshooting skills to solve the problem. In this example. the triRequestFullNameTX field was set to 50 characters but the data we were trying to push had 55 characters. The solution was simply expanding the percision of the offending field to a number larger then 55.

update T_TRISERVICEREQUEST
set sys_projectid = 1,
triDescriptionTX = 'test4',
triStatusCL = 'Review In Progress',
triStatusCLObjId = 1601066,
triControlNumberCN = 'REQ 1000516',
Sys_Parent1 = 0,
triPreviousStatusCL = 'Draft',
triPreviousStatusCLObjId = 1600256,
triRequestClassCL = 'CRE Moves, ten or less associates (MOVES03)',
triRequestClassCLObjId = 4737839,
triModifiedSY = '03/20/2008 03:39:07 PM', -- NOTE may need to be formatted correctly for this column
coContactNumberTX = 'xxx',
triRecordNameSY = 'REQ 1000516-0',
triRecordStateSY = 'triReview',
triModifiedByTX = 'Zombron, Robert - eyk343',
triModifiedByTXObjId = 3835835,
triRequestFullNameTX = 'REQ 1000516-CRE Moves, ten or less associates (MOVES03)'
where spec_id = 6564922

No comments: