G'day, Thanks for all the references! There's a gold mine of information out there.
My needs are fairly simple and I have the means of getting the data
into a variable in the format I need:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET VAR vEntIDList TEXT = (CTXT(.vDfaultTradeEntity))
SELECT COUNT(*) INTO +
vCount IND vi1 +
FROM TradingEntity +
WHERE EntityID <> .vDfaultTradeEntity +
AND ParentEntityID = .vDfaultTradeEntity +
AND CrntAvailable = 'Y'
IF vCount > 0 THEN
DECLARE c1TEL CURSOR FOR SELECT +
EntityID +
FROM TradingEntity +
WHERE EntityID <> .vDfaultTradeEntity +
AND ParentEntityID = .vDfaultTradeEntity +
AND CrntAvailable = 'Y' +
ORDER BY EntityID
OPEN c1TEL
LABEL LBegTEL
FETCH c1TEL INTO +
vCEntityID IND vi1
IF SQLCODE = 100 THEN
GOTO LEndTEL
ENDIF
SET VAR vEntIDList TEXT = (.vEntIDList + ',' + (CTXT(.vCEntityID)))
GOTO LBegTEL
LABEL LEndTEL
DROP CURSOR c1TEL
CLEAR VAR vCEntityID
ENDIF
SET VAR vEntIDList TEXT = ('(' + .vEntIDList + ')')
RETURN
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is called at the beginning of the app and there is no
apparent performance hit for the small data sets I envisage.
It results in vEntIDList having a value of (0,1,2) for a
parent or (2) for a child so the same variable can be used
in all my report parameters regardless of the client selecting
a trading entity or a holding company on which to report.
My question related not so much on how to do this bit but
rather why I got the error messages in R:BASE with both
the RULE and the same table referencing PK\FK relationship.
Thanks again for the tips!
At 11:04 28/10/02 -0800, you wrote:
Warmest regards,that sounds pretty interesting... if you wanted to get a node and all its children would you be able to do that in a single select statement without a loop for each level?
Tom Grimshaw
coy: Just For You Software
tel: 612 9552 3311
fax: 612 9566 2164
mobile: 0414 675 903
post: PO Box 470 Glebe NSW 2037 Australia
street: 3/66 Wentworth Park Rd Glebe NSW 2037
email: [EMAIL PROTECTED]
web: www.just4usoftware.com.au
"... the control of impulse -- is the first principle of civilization."-- Will Durant,
Pulitzer Prize winning philosopher, writer and historian
the most needed product in the world can be found at
www.thewaytohappiness.org
This email and any files transmitted with it are confidential to the intended recipient and may be privileged. If you have received this email inadvertently or you are not the intended recipient, you may not disseminate, distribute, copy or in any way rely on it. Further, you should notify the sender immediately and delete the email from your computer. Whilst we have taken precautions to alert us to the presence of computer viruses, we cannot guarantee that this email and any files transmitted with it are free from such viruses.
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
