Subject | Re: [ib-support] Datatype uknown error in a stored proc |
---|---|
Author | Helen Borrie |
Post date | 2003-05-10T02:30:28Z |
At 01:56 PM 9/05/2003 +0100, you wrote:
First, you would be well-advised to specify an input column list for an
insert statement in ANY case where there is not exact column mapping to a
table.
Most importantly, the documentation quite clearly states you cannot pass
either a parameter or a variable in the field list of the SELECT (see
INSERT in the Language Reference).
Read the input set in a FOR SELECT...INTO...<variables> loop and perform an
ordinary INSERT INTO ATABLE (<column-list>) VALUES (<value-list>)
statement, including your variable as a member of the value-list at each
iteration of the loop.
cheers,
heLen
>Im using Firebird 1.0.2.Joseph,
>Could you please tell whats wrong with the following code in a stored
>proc :
>
>
>
>declare variable entie integer ;
>
>entier = 10 ;
> .
>
>insert into sometable select atable.field1, :entier, atable.fieldn from
>atable
>
>Ive tried to cast ( :entier as integer )
>
>And always received the Datatype uknown error.
First, you would be well-advised to specify an input column list for an
insert statement in ANY case where there is not exact column mapping to a
table.
Most importantly, the documentation quite clearly states you cannot pass
either a parameter or a variable in the field list of the SELECT (see
INSERT in the Language Reference).
Read the input set in a FOR SELECT...INTO...<variables> loop and perform an
ordinary INSERT INTO ATABLE (<column-list>) VALUES (<value-list>)
statement, including your variable as a member of the value-list at each
iteration of the loop.
cheers,
heLen