Subject | basic cursor and firebird psql question |
---|---|
Author | |
Post date | 2015-10-12T17:43:22Z |
Hi-
I have 2 questions from the code below.
Where do you come up with RDB$FIELD_NAME?
Is FIELDNAME part THE NAME OF A FIELD IN an actual TABLE AND
RELATION_FIELDS THE NAME OF A REAL TABLE?
How can you use :RNAME IN THE WHERE clause?
Where is it getting its value from? It seems like it is just a variable
in psql without being assigned a value.
I am doing a little reading of psql, but I am going to take a break
for a while. It is a nice day out. Not too many more before fall/winter
set in.
thx for any assistance - jim
...
AS
DECLARE RNAME CHAR(31)
DECLARE FNAME CHAR(31)
DECLARE C CURSOR FOR
(SELECT RDB$FIELD_NAME FROM RDB$RELATION_FIELDS
WHERE RDB$RELATION_NAME = :RNAME
ORDER BY...);
SELECT
INTO :RNAME DO
BEGIN
OPEN C;
...
END
END
partial example found in cursor section of helen borriie's psql book.