telosystools

Open full view…

SQLite gives back strange databaseSize values

torpedomick
Mon, 16 Sep 2019 08:34:59 GMT

Now using the SQLite capability a bit more I found out that i.e. the type "NVARCHAR(40)" is stored completely in $field.databaseType and the $field.databaseSize contains "2000000000" always. Is it a feature or can I somehow fix that? Shouldn't it be sparated somehow? Thanks a lot again for taking care of your users !

Telosys Team
Wed, 18 Sep 2019 08:48:39 GMT

It's probably because the JDBC driver is unable to determine a type for NVARCHAR(x). Could you give us your SQLite data file to test that ? ( you can send it at telosysteam@gmail.com )

torpedomick
Fri, 20 Sep 2019 08:01:26 GMT

Done. Have fun ;)

torpedomick
Thu, 26 Sep 2019 12:47:21 GMT

OK, did not get an answer yet. So I wrote a snippet of Velocity code to fix the worst by workaround: --- #set ( $i = 1 ) #set ( $fieldlen = " " ) #set ( $fieldtyp = " " ) #if($field.databaseSize > 20000) #set ( $leftlens = $field.databaseType.split("\(") ) #foreach( $leftlen In $leftlens ) #if ( $i == 1 ) #set ( $fieldtyp = $leftlen ) #end #if ( $i == 2 ) #set ( $fieldlen = $leftlen ) #end #set ( $i = $i + 1 ) #end #set ( $stringLength = $fieldlen.length() - 1) #set ( $fieldlen = $fieldlen.substring(0,$stringLength)) #set ( $len = 999 ) #else #set ( $fieldtyp = $field.databaseType ) #set ( $fieldlen = $field.databaseSize ) #end ## Type now in $fieldtyp, Length in $fieldlen --- ... until there is a new Version available ... Thanks Mick