![]() ![]() I have a feeling this 32K VARCHAR declaration may impact performance? Memory usage doesn't seem too bad on the computer while the program is running and doing its thing until the data has to be exported from the DBDataSet to CSV using laddbexport unit and the TCSVExport library, where, prior to export, memory usage sits at about 20Mb, and then after the export it jumps to 600Mb, and stays like that even though I have free'd the TSCVExport creations!Īnyway, it has worked for now RVK so thank you. And whilst 95% of the time, these values won't be anywhere near 32K in length, and will rarely even be over about 500 characters, but any one of them could be at some stage and I don't want the program to crash out because I've been to reserved and set only, say 5K. However the problem I have is that the max value I need to set for these values is 32K! So I have had to decalre VARCHAR(32000) for every row in my database. So I reverted those changes and then tried your second suggestion, which did fix the issue, in that it does now display what it should. SELECT CASE(* as TEXT) from MY_TABLE but I got invalid syntax error, but I couldn't see where it was wrong. In my CREATE TABLES statement I declared the values as Text and then in my SELECT statements I used CASE, e.g. I couldn't get the first suggestion to work. Is that right? If so, how do I fix the issue? I need DBGrid to be able to show strings of any length and I need SQLite to be able to store strings of any length. I read somewhere that there may be a restriction on Params to 255 chars. I have narrowed the problem down, I think, to the (StringValue).AsString := MyString, which I use. So somewhere in my code there is a restriction on strings in the SQLIte database of 255 characters. ![]() That ensured DBGrid could display the result again, but they are truncated at 255 characters. So then I switched Text to VARCHAR which I read was similar but perhaps less memory intensive. But then I got (MEMO) displayed in my DBGrid. So I changed that from Char(128) to Text, which I read was unlimited. So then I realised I was setting table fields to a longth of only 128 characters! Something I'd entirely missed! So my CREATE TABLE statement referred to Char(128) SomeColumn, which obviously restricted the length of what could be held. ![]() Values in the DBGrid were still being truncated on my main form. Regarding this problem, the first thing was that I'd forgot to set the compiler to to ensure long strings are accepted throughout the unit that I made for SQLite processing. I recently migrated my program to use SQLite, whichg was a lot of work, so I and my users keep spotting some issues. Thank you for your advice or guidance.A user has filled a bug report regarding the length of values that appear in a DBGrid. Of course, I searched the net, but so far I have not found anything that would help me, so I am addressing you here. Is it usually possible to write there always? db-journal to another directory, for example the "C:\WINDOWS\USERS" user directory. And so that the application does not always have to be copied to the computer, I would like to know if it is possible to redirect the creation of a temporary file. Therefore, when I start the application, it does not start and an error is displayed that it is not possible to open the database (tested on a locked SD card). Some computers (eg at work) do not allow writing to external media. ![]() Since the application is portable, it will also run from a flash drive. If I run this application located in a folder on my computer, it will start and SQLite will create a temporary file. I have a small application created in Lazarus / Free Pascal. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |