You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by bala r <ba...@gmail.com> on 2008/08/27 20:17:41 UTC
How to execute a SQLstatement and followed by a StoredProcedure.
Hi,
I need to execute Select statement and followed by a Stored Procedure.
Stored Procedure parameter is from the SQL Selectstatement result.
1. Select x into p_x from temp_table
2. call stored_procedure(p_x)
Both should be same sqlMap id .
I tried using <statement> but didnt work.
Is there a way shall i execute both in one sqlMap id?
Thanks
Bala.
Re: How to execute a SQLstatement and followed by a StoredProcedure.
Posted by bala r <ba...@gmail.com>.
Hi,
Thanks for your quick reply......that is what thought putting Insert
statement in a stored procedure and call external stored procedure from
there.....
But just wanted to know in Ibatis is there a way to execute both in a single
map..
Thanks
Bala.
On Wed, Aug 27, 2008 at 2:21 PM, Larry Meadors <la...@gmail.com>wrote:
> Why not just put the insert/sp call in a single stored procedure?
>
> If not that, I think you'll need to just call the 2 mapped statements,
> or find a way to do it with sql (like an anon pl/sql block in oracle).
>
> Larry
>
>
> On Wed, Aug 27, 2008 at 12:17 PM, bala r <ba...@gmail.com> wrote:
> > Hi,
> >
> > I need to execute Select statement and followed by a Stored Procedure.
> > Stored Procedure parameter is from the SQL Selectstatement result.
> >
> > 1. Select x into p_x from temp_table
> > 2. call stored_procedure(p_x)
> >
> > Both should be same sqlMap id .
> >
> > I tried using <statement> but didnt work.
> >
> > Is there a way shall i execute both in one sqlMap id?
> >
>
Re: How to execute a SQLstatement and followed by a StoredProcedure.
Posted by Larry Meadors <la...@gmail.com>.
Why not just put the insert/sp call in a single stored procedure?
If not that, I think you'll need to just call the 2 mapped statements,
or find a way to do it with sql (like an anon pl/sql block in oracle).
Larry
On Wed, Aug 27, 2008 at 12:17 PM, bala r <ba...@gmail.com> wrote:
> Hi,
>
> I need to execute Select statement and followed by a Stored Procedure.
> Stored Procedure parameter is from the SQL Selectstatement result.
>
> 1. Select x into p_x from temp_table
> 2. call stored_procedure(p_x)
>
> Both should be same sqlMap id .
>
> I tried using <statement> but didnt work.
>
> Is there a way shall i execute both in one sqlMap id?
>