Ric Sherlock wrote:
> I'm sure I'm being dense but I can't work out how the code you sent
> would help me define a multiline noun that is _local_ to the verb in
> which it is defined.\
Since you're not using x in your verb, this should do it:
GetPrices=:(0 :0)&(4 :0)
sqlcmd=. x
NB. get last three columns of query
profiles=. > _3 {."1 }. y query__db sqlcmd
NB. assign each column to name
'pp mfd prc'=: |: data
NB. box profiles by client
profiles=. ((_1}.pp~:1|.pp),1) <;.2 profiles
)
SELECT cl_lname, cl_title, pp_year, pp_id, pr_mfd, pr_price
FROM (price_profiles INNER JOIN prices ON pp_id = pr_pp)
INNER JOIN (clients INNER JOIN revs ON cl_id = rv_client)
ON pp_id = rv_pp
WHERE cl_id=? AND rv_validuntil Is Null
ORDER BY cl_lname, pr_mfd;
)
FYI,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm