Recent

Author Topic: AutoCalcFields / Getting field values using Lazarus function  (Read 4998 times)

Zomis

  • Jr. Member
  • **
  • Posts: 95
AutoCalcFields / Getting field values using Lazarus function
« on: February 10, 2007, 12:56:01 pm »
I see that the TDataSet class has an AutoCalcFields property. But I have no idea if it works or not, or how to use it.

I want to use a Select-SQL Query which uses a field named "realcount" which is defined using a Delphi function. The Delphi function needs a "filename" field from the SQL Query, and then the Delphi function returns "realcount" to the SQL Query. So for example, this table
Code: [Select]

filename       count        somedata
'test1.txt'      5       'just some data'
'test2.txt'      7       'another piece of data'

Using the SQL-query "select filename, count, realcount from mytable" I want a Delphi function to open the file named filename, and scan that file to check the "realcount" value which will be returned in the SQL-query.

Is there somehow to do this using any kind of Database? (I'm using SQLite right now, but I'm open for changes)

Zomis

  • Jr. Member
  • **
  • Posts: 95
RE: AutoCalcFields / Getting field values using Lazarus func
« Reply #1 on: February 14, 2007, 12:25:32 pm »
Sorry for putting "Delphi procedure" in the topic. Of course I meant "Lazarus function"

And I have another idea about how this can be done, using custom SQL-functions
Something like
SELECT filename,count,MyFunc(filename) FROM mytable

Is there any Databases which supports custom SQL-functions?

 

TinyPortal © 2005-2018