-
Content Count
145 -
Joined
-
Last visited
-
Days Won
1
Everything posted by weirdo12
-
If you do want to use the latest version of SQLite, make sure to change the EngineLink property of your TFDPhysSQLiteDriverLink component to slDynamic and put the SQLite DLL in the same directory as the application exe.
-
How can I extract a row's data from a TMyQuery object ?
weirdo12 replied to dormky's topic in Databases
To use the example as shown, DataObject would be a type that has an overloaded assignment (Assign) operator that accepted a TDataSet (or TFDQuery or whatever). In Assign you would copy the data you want to the members of DataObject. https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Operator_Overloading_(Delphi)#Declaring_Operator_Overloads -
Store a large number of images in the filesystem or in a DB?
weirdo12 replied to RaelB's topic in Databases
Have a look at SQLite as Anders suggested: https://sqlite.org/appfileformat.html -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
Was that meant as a dis of SQLite - did I read that right? -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
If you are using components built specifically for Interbase/Firebird (or some other server) - absolutely. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
Okay that is a good reason to stick with what your using. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
Would you consider changing to SQLite? I know it might be a huge deal if you have a lot of database specific dependencies in your code so it might not be practical. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
Someone would have to write an IDE plugin. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
No, I would say the file is already in use. Maybe you have no choice but to make sure the IDE closes the connection before you run your app. The IDE and your app can't both use the file. That's a different problem and it won't be solved by ConnectedStoredUsage. But if your want you app to always start with the Connected = False outside of the IDE it will make sure that happens. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
Please try using the ConnectedStorageUsage property and save yourself all that hassle. You can have you cake and eat it too. Just uncheck uaRunTime and the TFDConnection.Connected property will never be True at runtime even when you save your unit with it set to True. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
I'm glad you gave it a try! -
FireDAC Create table with TFDTable class at SQL Postgres 14
weirdo12 replied to shalapai's topic in Databases
This works in RAD Studio 11.3 with PostgreSQL 14.8 running on Ubuntu. Without the SET search_path code, the table is always being added to public even if SchemaName was set to dba or if the TableName was qualified like dba.test_table. std::unique_ptr<TFDTable> vTable(new TFDTable(0)); vTable->Connection = db_connection; vTable->TableName = "test_table"; vTable->FieldDefs->Add("login", ftLargeint, 0, true); vTable->FieldDefs->Add("ticket", ftLargeint, 0, true); vTable->FieldDefs->Add("exec_time", ftDateTime, 0, true); vTable->FieldDefs->Add("req_price", ftFloat, 0, true); TFDIndex* idx = vTable->Indexes->Add(); idx->Name = System::Sysutils::Format("%s_pkey", String("test_table")); idx->Fields = "login;ticket"; idx->Active = true; db_connection->ExecSQL("SET search_path TO dba, public"); if (!vTable->Exists) { vTable->CreateTable(False); } db_connection->ExecSQL("SET search_path TO public, dba");- 18 replies
-
- create table
- tfdtable
-
(and 1 more)
Tagged with:
-
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
If both of those are False the state of Connected will be ignored. You can test this by setting Connected to True, saving the file, closing it and reopening it. Connected will be False. Or create a new app. Drop a TFDConnection component on the main form. Set DriverName to SQLite. Add a BeforeConnect event handler. Put some dummy code in it so it does get deleted because it's empty. Set a break point on it. Set Connected to True. You should get prompted for a password. Click OK. Now run the app. The breakpoint won't occur. Now check auRunTime. Run the app again. It will break at the BeforeConnect event handler. -
Trap TFDConnection error on data module create etc?
weirdo12 replied to Chris1701's topic in Databases
There is an TFDConnection property that you can set to tell it how use/save the state of the Connected property - ConnectedStoredUsage. -
FireDAC Create table with TFDTable class at SQL Postgres 14
weirdo12 replied to shalapai's topic in Databases
Did you try including the schema name with the table name? vTable.TableName:='test_schem.test_table';- 18 replies
-
- create table
- tfdtable
-
(and 1 more)
Tagged with:
-
FireDAC Create table with TFDTable class at SQL Postgres 14
weirdo12 replied to shalapai's topic in Databases
If you use the public schema does everything work as expected? I just want to confirm that. I am assuming it does. You don't assign any value to SchemaName and everything works. Or do you assign 'public' to SchemaName?- 18 replies
-
- create table
- tfdtable
-
(and 1 more)
Tagged with:
-
Nice. The only issue would be if any of the columns is NULL.
-
D11 Update 1 + FireDAC + ODBC to Sage returning wrong data!
weirdo12 replied to Jasonjac2's topic in Databases
Have you tried this setting? It's just a shot in the dark. -
Or: SELECT SUM( if( (if(col1 = 'True', 1, 0) + if(col2 = 'True', 1, 0) } + if(col3 = 'True', 1, 0) ... ) > 0, 1, 0) ) AS "Some Columns Have True Strings" FROM ...
-
How about: SELECT if(col1 = 'True', 1, 0) + if(col2 = 'True', 1, 0) } + if(col3 = 'True', 1, 0) } ... AS "Sum Of True Strings" FROM ...
-
If the TDFBatchMove.Reader property is a TFDBatchMoveTextReader when GuessFormat is called, how many rows does it read from a file to determine the format of the columns? The issue I have is an import file where a column normally has the value 1 and then say 10,000 rows in it will change to 2.2046 which kills the import.
-
TDFBatchMove.GuessFormat - How Many Rows Does It Read?
weirdo12 replied to weirdo12's topic in Databases
Yep. That particular property did not elude me. -
TDFBatchMove.GuessFormat - How Many Rows Does It Read?
weirdo12 replied to weirdo12's topic in Databases
Oh boy, how did I miss that TFDBatchMove.AnalyzeSample property!? After more thought this morning, I doubt it's going to help with my problem. For example if the text file was like like this: "row_id","float_col" 1,1 2,2.2046 3,1 float_col will likely still be guessed to be an integer. I will have to look at the source. -
Annoying warning message a'attribute declaration must precede definition'
weirdo12 replied to tester1234's topic in General Help
I assume you figured this out, eh?