Subject Re: How To: Write a Store Proc. for the following
Author Namit Nathwani
Hi Dorin

Thanks a lot for this new idea it seems to be *the* solution. I will be
out of town for a month after that is the time when I will be able to try
it out but this looks as if it is what I wanted to get done in the first
place. The more I read the code more it looks like macros in VFP or
something like and EVAL()

At 03:13 pm 20/04/2004, you wrote:
>If yout teplates are translated to something that Firebird can
>understand and evaluate, then you can use the new EXECUTE STATEMENT
>Instead of:
>'Bill no. ' + xrow.fld1 + ' Bill dt. ' + xrow.fld2 + 'so on'
>chenge to this:
>'Bill no. ' || fld1 || ' Bill dt. ' || fld2 || 'so on'
>
>Try this procedure:
>
>CREATE PROCEDURE MY_PROCEDURE (
> TIID INTEGER,
> TCFLAG CHAR(1))
>RETURNS (
> RETVAL VARCHAR(500))
>AS
>DECLARE VARIABLE M_NARRTEMPLATE VARCHAR(500);
>begin
> if (tcflag = 'X') then begin
> select narrtemplate from narrmaster where n='XCHILDTEMPLATE'
> into :m_narrtemplate ;
> for execute statement
> 'select ' || :m_narrtemplate || ' from xchild where ipid =
>' || :tiid
> INTO :retval do begin
> suspend;
> end
> end
> if (tcflag = 'Y') then begin
> end
>end



Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
namitbn@...
___________________________________________

----------


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004


[Non-text portions of this message have been removed]