[SOLVED] TSQLQuery returns STRINGS as MEMO from SQLITE3 lazarus / 16-Databases ---------------------------------------------------------------------- TheNick · 2023-06-28 17:51 Hi, Why does the TSQLQuery returns datatype MEMO when the field are defined as TEXT that per definition is declared as STRING in SQLITE3? Lazarus 2.2.6 FPC 3.2.2 Running on x86_64-linux-gtk2 ---------------------------------------------------------------------- dsiders · 2023-06-28 20:32 Quote from: TheNick on June 28, 2023, 07:51:55 pmHi, Why does the TSQLQuery returns datatype MEMO when the field are defined as TEXT that per definition is declared as STRING in SQLITE3? Lazarus 2.2.6 FPC 3.2.2 Running on x86_64-linux-gtk2 Please use the forum search function. This has been asked and answered at least a dozen times. ---------------------------------------------------------------------- TheNick · 2023-06-28 20:34 Thank you, but did try that with no luck. ---------------------------------------------------------------------- Zvoni · 2023-06-29 06:52 Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SELECT CHAR(SomeTextColumn) AS Field1 FROM SomeTable ---------------------------------------------------------------------- SymbolicFrank · 2023-06-29 07:17 While the SQL syntax requires you to specify data types for your fields, SQLite treats those as recommendations, unless you define the tables as "STRICT" (which is fairly new). Normally, SQLite only has a single, unified datatype. Variants. When in doubt, it's advisable to cast fields to the required format. Some databases have lots of more or less the same data types, like (for MS SQL) fixed-length strings, strings that can grow up to a specified size, large blocks of text that sometimes don't allow much manipulation (memos), the same ones for variable-length chars, etc. While others (notably, SQLite and PostgreSQL) combine all those to a single type: text. This is also the default way to store most data in SQLite. And while you can specify the other variants in PostgreSQL, they're treated like text fields with an optional maximum length. ---------------------------------------------------------------------- TheNick · 2023-06-29 19:19 Thank you @Zvoni and @SymbolicFrank! Learned something new tonight! I have tried out to do it this way: select cast(Name as varchar(255)), cast(Club as varchar(255)) from contenders where contendernbr=1; I will experiment with @SymbolicFrank way of doing it. Cheers, Niclas