Recent

Author Topic: SQlite Database Difference Between Text And String Storage  (Read 343 times)

Weitentaaal

  • Full Member
  • ***
  • Posts: 158
SQlite Database Difference Between Text And String Storage
« on: November 19, 2020, 01:33:04 pm »
Hey Guys,

Lately i saw something interessting. I was Storing a Binary String into A String Field and.

After i reused the String out of the Database i Got An Error because the String was Stored as 1.0e+29. And on the other Fields it always cut the "0"'s before the first "1" away.

When i set the Datatype to Text it worked.

So what is the exact Difference between these two datatypes ?
Why Does it work with Text and doesn't with String ?

Thanks for Help :)
Lazarus: 2.0.6 x86_64-win64-win32/win64
FPC-Version: 3.0.4
Compiler Version: 3.2.0

rvk

  • Hero Member
  • *****
  • Posts: 4472
Re: SQlite Database Difference Between Text And String Storage
« Reply #1 on: November 19, 2020, 01:53:40 pm »
Lately i saw something interessting. I was Storing a Binary String into A String Field and.
What is a STRING field in SQLite?
How did you define the table?

As far as I know there is not STRING type. Only CHAR, VARCHAR and TEXT.
If you really used STRING in the definition the field is defined as NUMERIC.

Look at https://www.sqlite.org/datatype3.html for more info about type definition in SQLite.

Weitentaaal

  • Full Member
  • ***
  • Posts: 158
Re: SQlite Database Difference Between Text And String Storage
« Reply #2 on: November 19, 2020, 02:20:51 pm »
Saw it now i was converting my acces db via csv to Sqlite and somehow i got String in Datatype but String didn't even exist so i Don't know how this happend.

But Thanks A Lot :)
Lazarus: 2.0.6 x86_64-win64-win32/win64
FPC-Version: 3.0.4
Compiler Version: 3.2.0

 

TinyPortal © 2005-2018