
SQLlite big string column question
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
SQLlite big string column question
Lets say I had a string of about 3000 characters and I wanted to save it to a column of a table in a SQLlite DB... Does anyone know what COLUMN type that should be?


- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: SQLlite big string column question
one of the great benefit of SQLite is creating typeless columns.Rook Zimbabwe wrote:Lets say I had a string of about 3000 characters and I wanted to save it to a column of a table in a SQLlite DB... Does anyone know what COLUMN type that should be?
In short: Leave the colum type empty and it will store data of any size.
Code: Select all
Create myTable (myColumn)
Hygge
Re: SQLlite big string column question
If I only had known about all those benefits three years agoKiffi wrote:one of the great benefit of SQLite

PureBasic for Windows
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Re: SQLlite big string column question
Oh well the documentations was on three years ago ( www.sqlite.org )
Anyway, typeless s***s anyway..
Programmers need restrictions to fix their code and prevent/reduce bugs.
Strong typed is the way to go.
Anyway, typeless s***s anyway..
Programmers need restrictions to fix their code and prevent/reduce bugs.
Strong typed is the way to go.
Re: SQLlite big string column question
this is your opinion, not mine.Edwin Knoppert wrote:Programmers need restrictions to fix their code and prevent/reduce bugs.

Greetings ... Kiffi
Hygge
Re: SQLlite big string column question
Aye, some programmers might need restrictions... not me however! 

I may look like a mule, but I'm not a complete ass.
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: SQLlite big string column question
It looks like SQLLite automatically truncates the line... I cannot tell however because the BLOB code that writes the tiles into the DB is not working...
Re: SQLlite big string column question
no truncation here:Rook Zimbabwe wrote:It looks like SQLLite automatically truncates the line...
Code: Select all
UseSQLiteDatabase()
DB = OpenDatabase(#PB_Any, ":memory:", "", "", #PB_Database_SQLite)
DatabaseUpdate(DB, "Create Table myTable (myColumn)")
DatabaseUpdate(DB, "Insert Into myTable (myColumn) Values ('" + Space( 1000) + "')")
DatabaseUpdate(DB, "Insert Into myTable (myColumn) Values ('" + Space( 5000) + "')")
DatabaseUpdate(DB, "Insert Into myTable (myColumn) Values ('" + Space( 10000) + "')")
DatabaseUpdate(DB, "Insert Into myTable (myColumn) Values ('" + Space(100000) + "')")
DatabaseQuery(DB, "Select * From myTable")
While NextDatabaseRow(DB)
Debug Len(GetDatabaseString(DB, 0))
Wend
Hygge