Subject | Re: Field computed by a stored proc |
---|---|
Author | Adam |
Post date | 2005-04-22T13:10:12Z |
Hello Pierre.
But refuses to compile is a pretty vague statement. Can you be
specific with the error message?
In answer to your question, yes a stored procedure can be used in a
computed field. I have done this in the past, but have since replaced
all of these with real fields that are filled by triggers (I found the
select performance unacceptable but my computed fields were joining
several tables).
The only thing I can see that I did differently to you is that I used
the table.field notation in the computed by clause, but I have no idea
whether this makes a difference.
eg:
Create table test (
Test_id Integer not null,
Name VarChar(80),
FirstName VarChar(80),
Company VarChar(80),
FullName computed by ((select fullname from
sp_get_fullname(test.test_id, test.name,
test.first_name, test.company)))
);
Adam
But refuses to compile is a pretty vague statement. Can you be
specific with the error message?
In answer to your question, yes a stored procedure can be used in a
computed field. I have done this in the past, but have since replaced
all of these with real fields that are filled by triggers (I found the
select performance unacceptable but my computed fields were joining
several tables).
The only thing I can see that I did differently to you is that I used
the table.field notation in the computed by clause, but I have no idea
whether this makes a difference.
eg:
Create table test (
Test_id Integer not null,
Name VarChar(80),
FirstName VarChar(80),
Company VarChar(80),
FullName computed by ((select fullname from
sp_get_fullname(test.test_id, test.name,
test.first_name, test.company)))
);
Adam