LJ from your results below it looks like for the fields in question the 
database is allocating the max length for the data type it associates with the 
field.   The question is either 1) Why is that done for these particular fields 
or 2) Why is it not done for ALL fields?

-- 
Chris Danaceau
301-903-8741
Contractor to the Department Of Energy


-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:arslist@ARSLIST.ORG] On Behalf Of LJ LongWing
Sent: Thursday, February 23, 2012 12:20 PM
To: arslist@ARSLIST.ORG
Subject: Not Matching Lengths

List,
Our Dev server started crashing a few days ago and we had a VERY hard time
trying to identify the cause.  After several days of trial and error, one of
the developers on the team noticed that a field length in the DB was not the
same as a field length in Remedy.  After further troubleshooting it was
found that the server stopped responding after doing a query/insert into
that table using that field ID....the only 'fix' I could find to get them
back in sync was to delete the field and re-create it.  We haven't had the
server crash since I did that....so it got me thinking that there might be
other fields with similar problems, so I started looking...I was shocked by
what I found and want to run it by some other people on the list to see if
they come across similar results.  The Query I have provided below is
running just fine on SQL Server 2008 R2...I don't know the equivalent for
Oracle...but I would like to know if other people find a large amount of
columns where the two values don't match.  With the below Query I came up
with 382 mismatches, many of which are on system generated forms, but a
majority of which are on my custom forms.  This is an OLD system...it's been
around since at least 6.0...and upgraded and modified in almost every major
revision since its inception.  We are currently on 7.6.4 SP1....and I can
confirm with a form that I created yesterday...I created a 255 character
field...then shrunk it to 30, and it is on my list of mismatches....curious
about your results...please reply back :)

select a.name, f.fieldName, fc.maxLength as 'RemedyMaxLength',
c.CHARACTER_MAXIMUM_LENGTH as 'DBMaxLength'
from arschema a
        inner join field f on f.schemaId = a.schemaId
        inner join field_char fc on a.schemaId = fc.schemaId and f.fieldId =
fc.fieldId
        inner join INFORMATION_SCHEMA.COLUMNS c on c.TABLE_NAME =
'T'+CAST(a.schemaId AS char) AND 'C'+CAST(fc.fieldId as char) =
c.column_name
where fc.maxLength != c.CHARACTER_MAXIMUM_LENGTH
AND c.CHARACTER_MAXIMUM_LENGTH != 2147483647
and f.fieldId != 1

Name    Field Name      RemedyMaxLength DBMaxLength
AR System Currency Label Catalog        Short Description       4       254
AR System Currency Ratios       Short Description       4       254
Alert Events    UNUSED  5       254
Server Events   Unused_Descr    3       254
Server Statistics       Short Description       3       254
User    Password        30      255
User    Computed Grp List       255     4000
AR System Administrator Preference      Short Description       128     254
AR System User Central File     Short Description       128     254
AR System User Preference       Short Description       128     254
ReportSelection OriginalFormServer      128     254
ReportType      Short Description       128     254
FB:Alarm Events Monitor ID      15      254
FB:History      Short Description       128     254

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"

Reply via email to