help with creating a virtual column

fbachofner's profile image fbachofner posted 10 years ago in General Permalink
I'm hoping to be able to create a Virtual Column in lieu of a view

I would like the contents of the column to be like:

SELECT FullName from artist where artist_ID_PK=artist_ID_FK

[ artist_ID_PK is the PK of the artist table, artist_ID_FK is the corresponding FK in the table where I am trying to crfeate a virtual column. ]


Putting exactly that in the Expression column in the table editor, it generates an error: "SQL Error (1064)" on save.

Can a virtual column take a select statement as the expression definition or do I have to use a view?

Or am I too tired to think SQL anymore?
fbachofner's profile image fbachofner posted 10 years ago Permalink
OK, probably this can not be done.

According to the MariaDB documentation:
"subqueries or anything that depends on data outside the row are not allowed (these are not deterministic because the underlying data can change)"

I guess I will have to make a view unless anyone has a good idea on how to create this virtual column as stated above.

Please login to leave a reply, or register at first.