Jump to content

weirdo12

Members
  • Content Count

    132
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by weirdo12

  1. weirdo12

    Trap TFDConnection error on data module create etc?

    There is an TFDConnection property that you can set to tell it how use/save the state of the Connected property - ConnectedStoredUsage.
  2. Did you try including the schema name with the table name? vTable.TableName:='test_schem.test_table';
  3. 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?
  4. weirdo12

    Retrieve count values on different columns

    Nice. The only issue would be if any of the columns is NULL.
  5. Have you tried this setting? It's just a shot in the dark.
  6. weirdo12

    Retrieve count values on different columns

    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 ...
  7. weirdo12

    Retrieve count values on different columns

    How about: SELECT if(col1 = 'True', 1, 0) + if(col2 = 'True', 1, 0) } + if(col3 = 'True', 1, 0) } ... AS "Sum Of True Strings" FROM ...
  8. 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.
  9. Yep. That particular property did not elude me.
  10. 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.
  11. I assume you figured this out, eh?
  12. weirdo12

    Move objects to a second Data Module

    1. Open the project. 2. Open the TDataModule source file. 3. Change the Name property of the TDataModule to a new unique name. 3. Click File > Save As... and save it with a new file name. 4. Add the original TDataModule back to the project. In the new TDataModule you can start deleting components and event handlers. 1. Select the component you want to delete. 2. In the Object inspector, click the Events tab. 3. For any events that have been created for the component, double-click the event handler name. 4. Delete the code within the event handler BUT DO NOT delete the event handler. procedure TForm1.DataSource1DataChange(Sender: TObject; Field: TField); begin // delete the code in here but // leave everything between procedure and end; end; 5. Click File > Save and the handler will be removed.
  13. weirdo12

    Summary row at the end of select

    I should have said that an alternative way is to use IndexFieldNames instead of queries with parameters. Both methods produce the same results.
  14. weirdo12

    Summary row at the end of select

    IndexFieldNames in Query2 and Query3 should be set to CUSTNO. A parameter is not required. Query3.SQL = ' SELECT CUSTNO, sum(AMOUNTPAID) as TOTAL from ORDERS GROUP BY CUSTNO';
  15. weirdo12

    Summary row at the end of select

    If you are using TFDQuery, have you tried using the MasterSource property to connect Query2 to Query1? Query2.IndexFieldNames = fk_id_employee Query2.MasterFields = id Query2.MasterSource = Query1 You can use TFDLocalSQL and a TFDMemTable to do a summary of Query2.
  16. weirdo12

    Delphi not recognizing that a field exists

    Column LN does not exist in fdToTable. It may exist in your database but it's not in the table objects field collection.
  17. Use TFDScript with just the INSERT and DELETE statements.
  18. weirdo12

    Mysql connection problem

    Excellent!
  19. weirdo12

    Mysql connection problem

    Why are you using dbExpress? Is it an existing application that worked properly with another version of C++Builder?
  20. weirdo12

    FireDAC + TableNames with '$'

    Done. https://quality.embarcadero.com/browse/RSP-40382
  21. weirdo12

    FireDAC + TableNames with '$'

    This might be of some help to Dmitry I suppose. These also work: SELECT * FROM wares$rules "wares$ rules$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "wares $ rules $" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$$$$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$ $" WHERE fldidxwarerule = :dummy_string_param But these do not: SELECT * FROM wares$rules "$$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$$$" WHERE fldidxwarerule = :dummy_string_param
  22. weirdo12

    FireDAC + TableNames with '$'

    To summarize/simplify... These work: SELECT * FROM wares$rules "wares$rules$" SELECT * FROM wares$rules WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "wares$$rules$$" WHERE fldidxwarerule = :dummy_string_param But when there is more than one single $ in the table name and there is a parameter in the query it does not: SELECT * FROM wares$rules "wares$rules$" WHERE fldidxwarerule = :dummy_string_param [FireDAC][Phys][PG][libpq] ERROR: syntax error at or near ":"
  23. weirdo12

    FireDAC + TableNames with '$'

    I am not seeing that problem with PostgreSQL 14.5 using FireDAC. This works fine too: SELECT "$$1$$".row_id, "$$1$$".description, :dummy_string_param, :dummy_int_param FROM t$1$$$$$$$$$ "$$1$$" LEFT OUTER JOIN "t1$t2$t3" ON "$$1$$".row_id = "t1$t2$t3".row_id Edit: This gives me a syntax error - only when parameters are included (which makes some sense): SELECT "$$1$$".row_id, "t1$t2$t3".row_id, "$$1$$".description, :dummy_int_param FROM t$1$$$$$$$$$ "$$1$$" LEFT OUTER JOIN "t1$t2$t3" ON "$$1$$".row_id = "t1$t2$t3".row_id [FireDAC][Phys][PG][libpq] ERROR: syntax error at or near ":" This works: SELECT "$$1$$".row_id, t1.row_id, "$$1$$".description, :dummy_int_param FROM t$1$$$$$$$$$ "$$1$$" LEFT OUTER JOIN "t1$t2$t3" t1 ON "$$1$$".row_id = t1.row_id
  24. I was going to point out the Data property but you said you only wanted to discuss CopyDataSet() 😄 Good to hear you've got a solution.
×