Subject Re: why failed to insert into a table from a storeprocedure?
Author ibmcom2011
Tomasz,

thank you.

in fact, the test1 have the same parameters as test2. it's my negligence in describing my problem.

create procedure test1(
param1 varchar(20),
param2 varchar(20)
)
as
begin
insert into table1(f1, f2, f3)
select fa, fb, fc from test2(param1, param2);
end

i want to save the result data set which got from a complex store procedure (test2) into a temp table (table1) so that i can use it to build an new query.

as you say, a invoke b, if b has been changed, the a would be changed. but the calling shouldn't be omitted, i think.

in the structure
insert into t2 (..)
select .. from t1
, can the t1 be a store procedure ?




--- In firebird-support@yahoogroups.com, Tomasz Tyrakowski <t.tyrakowski@...> wrote:
>
> Hi,
>
> At the first glance, it should work as expected.
> If you run by hand
> select fa, fb, fc from test2(param1,param2)
> and it does return a data set, then I'd take a closer look at the params
> you pass to test2 inside test1. Make sure they're really what you think
> they are.
> Also, if you altered test2 in the database after creating/altering
> test1, alter test1 again to itself (all procedures depending on X should
> be altered, that is, byte-compiled, every time X is altered).
> If that doesn't help, send more details.
>
> regards
> Tomasz
>
> On 2011-11-22 09:15, ibmcom2011 wrote:
> > hi, all,
> >
> > in a store procedure, i try to insert into a table some records from an other store procedure, it seems like this:
> >
> > create procedure test1
> > as
> > begin
> > insert into table1(f1, f2, f3)
> > select fa, fb, fc from test2(param1, param2);
> > end
> >
> > test2 is a store procedure defined in the same database. it fetchs records from some tables and an other store procedure.
> >
> > but nothing have done without any error. if execute alone the store procedure test2, lots of records can be founded.
> >
> > why?
> >
> > thanks.
> >
> >
> >
> >
>
>
> --
> __--==============================--__
> __--== Tomasz Tyrakowski ==--__
> __--== SOL-SYSTEM ==--__
> __--== http://www.sol-system.pl ==--__
> __--==============================--__
>