On 01/06/2011 10:59, bertherngreen wrote:
> Hi,
>
> I tried to use a construction like:
>
> CREATE TABLE LOG (
>      F1        VARCHAR(100),
>      TRANS_ID  integer default current_transaction,
>      USER_ID  varchar(10) default current_user,
>      USER_IP  varchar(15) default RDB$GET_CONTEXT('SYSTEM', 'CLIENT_ADDRESS')
> ,
>      DATETIME timestamp default current_timestamp
> );
>
> But it seems that Context variables as default value are not allowed.
> I took a look at parse.y and changed it to:
>
> default_value
>       : constant
>       | RDB_GET_CONTEXT '(' value_list_opt ')'
>               { $$ = makeClassNode(newNode<SysFuncCallNode>(toName($1), $3));
>      }
>       | current_user                                  { $$ = 
> makeClassNode($1); }
> ...
>
> Now it's allowed, but could this lead to problems - except for typo's in the
> quoted parts of RDB$GET_CONTEXT()?
>
It may be problematic if you use variables declared after the one you're 
initializin in the function parameters.


Adriano


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to