Subject Re: [firebird-support] Computed column for primary key
Author Thomas Steinmaurer
> CREATE TABLE accounts
> (
> dept_id INT,
> build_id INT,
> account_nbr COMPUTED BY (dept_id || '-' || build_id),
> PRIMARY KEY(account_nbr)
> );
>
> It complains that I cannot use an computed column for the index. How would I fix this?
>
> Also, is using computed columns slow vs storing the actual value?

You can't create an index on a computed column.

--
With regards,

Thomas Steinmaurer
Upscene Productions
http://www.upscene.com
http://blog.upscene.com/thomas/

Download LogManager Series, FB TraceManager today!
Continuous Database Monitoring Solutions supporting
Firebird, InterBase, Advantage Database, MS SQL Server
and NexusDB!



> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>