Subject Re: [ib-support] Calling Stored Procedure in From section of Select Statement
Author Lele Gaifax
>>>>> "horstphil wrote:

horstphil> Below is how I would imagine how this would look, but
horstphil> it is not the correct syntax. Can anyone tell me what
horstphil> is the correct syntax? (I did look in the manuals, but
horstphil> am not finding any reference to this particular
horstphil> situation).

horstphil> SELECT ADDRESS.STREET1, ADDRESS.STREET2, ADDRESS.CITY,
horstphil> ADDRESS.STATECD, ADDRESS.ZIPCODE, ADDRESS.OWNERID,
horstphil> PERSON.FIRSTNAME, PERSON.MIDDLENAME, PERSON.LASTNAME,
horstphil> FORMATNAME.FULLNAME FROM FORMATNAME(PERSON.FIRSTNAME,
horstphil> PERSON.MIDDLENAME, PERSON.LASTNAME, 'LNF'), PERSON
horstphil> INNER JOIN ADDRESS ON (PERSON.PERSONID =
horstphil> ADDRESS.OWNERID) WHERE ADDRESS.OWNERID IS NOT NULL

I think you should invert the order. I use this functionality *a*lot*,
and I'm used to this pattern:

SELECT bla,bla
FROM Person p
JOIN Address a ON a.OwnerID = p.PersonID
LEFT JOIN FormatName fn (p.FirstName, p.MiddleName,
p.LastName, 'LFN') ON 1=1

The condition after the latest "ON" could be anything resulting True.

hth, ciao,
lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
email: lele@... | -- Fortunato Depero, 1929.