0

Is it possible to create a column that has value auto-generated (by a callback) when a select query is performed?

Imagine I have a database containing entries storing timestamp/actionid/user

I want to make a select query :

select timestamp, user, actionid, [actionname] 
          from mytable 
          where user LIKE 'xxxx' 
          order by [actionname]

With the value of [actionname] calculated on the fly (by a callback executed in my code) during the query execution.

I know it is possible to make other table and an inner join, but I was wondering if such a process exits.

Balagurunathan Marimuthu
  • 2,927
  • 4
  • 31
  • 44
Seamus
  • 43
  • 3
  • I know you can define custom functions in `C` that can be invoked by SQLite ([see SQLite docs](https://www.sqlite.org/c3ref/create_function.html)); not sure if or how easy it is to marshal this to `C#`. – TripeHound Oct 17 '16 at 10:36
  • See [Create/Use User-defined functions in System.Data.SQLite?](http://stackoverflow.com/questions/172735/create-use-user-defined-functions-in-system-data-sqlite) – CL. Oct 17 '16 at 10:54
  • Thanks for both comments it helps a lot – Seamus Nov 02 '16 at 15:09

0 Answers0