Subject | Re: How To: Write a Store Proc. for the following |
---|---|
Author | Namit Nathwani |
Post date | 2004-04-20T07:30:56Z |
I am reposting this as I didn't find it in the digests.
Hi Helen
Thank you so much for your help. I needed this primer for writing
SP's. My first impression is that the language is something similar to
PASCAL? Any link where I can keep on referring in the future?
At 11:48 am 18/04/2004, you wrote:
again. Actually in NarrMaster I will have a string stored in NarrTemplate
like this:
'Bill no. ' ||fld1||' Bill dt. '||fld2||'so on'
As another, Client B may want the NarrTemplate to look like this
'Bill no. ' ||fld1||'so on'
Thus I want to store the string in NarrTemplate and to use it to convert
the returned values of the first select based on the returned string from
NarrMaster, to make my explanation more clearer I will give FoxPro code and
it's result.
For Client A
NarrTemplate returned string: "Bill no. " + ALLTRIM(STR(fld1)) + " Bill dt.
" + DTOC(fld2) + " and so on..."
After successfully doing both the above select and storing them to mem vars
I can do something like this
lcRetVal = &NarrTempVar.
This will store in lcRetVal the value: "Bill no. 10 Bill dt. 05/04/2004 and
so on ..."
For Client B
As I have modified it, the NarrTemplate returned string: "Bill no. " +
ALLTRIM(STR(fld1)) + " and so on..."
lcRetVal = &NarrTempVar.
This will store the value: "Bill no. 10 and so on ..."
In essence I am doing Macro Substitution in VFP terms. I don't know what
will be stored in NarrTemplate but I know that so and so fields are
required to be returned from SELECT 1 and so and so narration string is to
be had from SELECT 2
Appreciating your response to my typical query. Thanks.
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]
Hi Helen
Thank you so much for your help. I needed this primer for writing
SP's. My first impression is that the language is something similar to
PASCAL? Any link where I can keep on referring in the future?
At 11:48 am 18/04/2004, you wrote:
>PSQL doesn't have a CASE construct. You can do it with multiple IFOkay no problem.
>statements.
> FOR SELECTHere I may have not been able to explain better but I will try
> 'Bill no. ' ||fld1||' Bill dt. '||fld2||'so on'
> FROM XCHILD
> WHERE iPID = :TTID
> INTO :LCRETVAL
> DO
> BEGIN
> IF (LCRETVAL IS NULL) THEN
> LCRETVAL = ERRMSG;
> ELSE
> IF (EXISTS (
> SELECT NarrTemplate FROM NarrMaster
> WHERE n = :LCRETVAL) ) THEN
> SUSPEND;
> END
again. Actually in NarrMaster I will have a string stored in NarrTemplate
like this:
'Bill no. ' ||fld1||' Bill dt. '||fld2||'so on'
As another, Client B may want the NarrTemplate to look like this
'Bill no. ' ||fld1||'so on'
Thus I want to store the string in NarrTemplate and to use it to convert
the returned values of the first select based on the returned string from
NarrMaster, to make my explanation more clearer I will give FoxPro code and
it's result.
For Client A
NarrTemplate returned string: "Bill no. " + ALLTRIM(STR(fld1)) + " Bill dt.
" + DTOC(fld2) + " and so on..."
After successfully doing both the above select and storing them to mem vars
I can do something like this
lcRetVal = &NarrTempVar.
This will store in lcRetVal the value: "Bill no. 10 Bill dt. 05/04/2004 and
so on ..."
For Client B
As I have modified it, the NarrTemplate returned string: "Bill no. " +
ALLTRIM(STR(fld1)) + " and so on..."
lcRetVal = &NarrTempVar.
This will store the value: "Bill no. 10 and so on ..."
In essence I am doing Macro Substitution in VFP terms. I don't know what
will be stored in NarrTemplate but I know that so and so fields are
required to be returned from SELECT 1 and so and so narration string is to
be had from SELECT 2
Appreciating your response to my typical query. Thanks.
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]