Given table and functions
perform statement
I find that most (all?) databases do not allow access to column values of a row under commit. I studied solutions and would like to discuss them if this subject of interest.
PHP Code:
TABLE tbl(
i integer,
a integer,
txt text
);
FUNCTION sq(n) RETURNS integer AS
$$
RETURN n^2;
$$;
FUNCTION I() RETURNS integer AS
$$
RETURN
SELECT i FROM tbl
WITH ROWID as R
WHERE r = CURRENT_TRANSACTION.row(); -- obj. described in DB engine
$$;
PHP Code:
INSERT INTO tbl VALUES(
2,SQ(N()),SELECT i||a WHERE i = N());
i a txt
-----------
2 4 '24'