Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 3 of 3 total |
Get the field size |
Sun, May 29 2016 6:04 AM | Permanent Link |
Hershcu Sorin | Hello
I need to extract the field size. I run the loop: for I := 0 to Query.FieldCount -1 do Size := Query.Fields.Fields[I].DisplayWidth; if it's an integer or date field it return the actual field length If it's a string it return 60 for all, ignoring the real field length. How I can get the real size? Thanks Sorin |
Sun, May 29 2016 12:56 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Hershcu
Without seeing your SQL I'm guessing. My guess would be that the fields where its returning a size of 60 are the result of some sort of calculation (eg ColumnA + ColumnB) in which case unless you specify the column size by explicitly CASTing the result (eg CAST(ColumnA + ColumnB AS VARCHAR(25)) the engine has no idea and uses its default of a column size of 60. Generally this is sort of OK because the data fits into the 60 characters. If it exceeds that I think it gets truncated at 60. Roy Lambert |
Mon, May 30 2016 4:10 AM | Permanent Link |
Hershcu Sorin | Yes your guess is right.
Thanks Sorin |
This web page was last updated on Friday, May 3, 2024 at 08:07 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |