Table aliasing is unnecessary required when doing UPDATE ... RETURNING RDB$ 
pseudo-columns
------------------------------------------------------------------------------------------

                 Key: CORE-4774
                 URL: http://tracker.firebirdsql.org/browse/CORE-4774
             Project: Firebird Core
          Issue Type: Bug
            Reporter: Pavel Zotov
            Priority: Minor


On WI-T3.0.0.31810:

SQL> recreate table t(id int, x int);
SQL> commit;
SQL> insert into t values(1, 100);
SQL> commit;
SQL> insert into t(id, x) values(2, 200) returning rdb$db_key;

DB_KEY
================
8100000002000000

SQL> delete from t where id=1 returning rdb$db_key;

DB_KEY
================
8100000001000000

SQL> update t set x=-x where id=2 returning rdb$db_key;
Statement failed, SQLSTATE = 42702
Dynamic SQL Error
-SQL error code = -204
-Ambiguous field name between table T and table T and table T
-RDB$DB_KEY
SQL> update t set x=-x where id=2 returning T.rdb$db_key; --------------- note 
alias  "T." left side 'rdb$db_key' pseudo-column

DB_KEY
================
8100000002000000

SQL> update t set x=-x where id=2 returning rdb$record_version;
Statement failed, SQLSTATE = 42702
Dynamic SQL Error
-SQL error code = -204
-Ambiguous field name between table T and table T and table T
-RDB$RECORD_VERSION
SQL> update t set x=-x where id=2 returning T.rdb$record_version; 
--------------- note alias  "T." left side 'record_version' pseudo-column

RDB$RECORD_VERSION
==================
                14

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to