| 
     
      
      
      From: Michael J. <mj...@pl...> - 2009-07-06 19:56:05
      
     
   | 
Jessi and Ken,
 
Your responses were enlightening and helpful.  We've managed to create
the tables and income view.  Thanks very much!
 
Mike
 
Jessi's comments were right on the mark (thanks Jessi!), but in looking 
at this I discovered some additional problems. There was a stray 
"abort" in one of the files, and several of the other files needed to 
make this work weren't called. It also looks like the file to create 
the "l_other_assistance" table never made it into the public release.
It's all a bit of a dependence tangle, but I checked an updated version 
into GIT that seems to work for me. The code for creating the income 
table is in there now, but commented out by default.
Mike--if you update your code ("git pull"), and then run the following 
commands (copied from the install.client.sql file), then this will 
hopefully work for you. 
/* Income Table & Necessary Housing stuff */
\i housing/create.l_unit_type.sql
\i housing/create.tbl_housing_unit.sql
\i housing/create.l_income_certification_type.sql
\i housing/create.l_fund_type.sql
\i create.l_income.sql
\i create.l_other_assistance.sql
\i create.tbl_income.sql
\i create.view.income.sql
\i functions/create.functions_income.sql
(you probably want to run this in a transaction, in case there are 
further errors.)
I checked a placeholder function for l_other_assistance into Git. If 
DESC can provide a dump of the codes they're using, that would be 
great. Otherwise, you'll have to make up your own. Thanks.
Ken
Jessi Berkelhammer wrote:
> Hi Mike,
> It looks like the create.tbl_income.sql file first creates tbl_income,
> then some indexes, and lastly the trigger verify_income_record, which 
> relies on the function income_verify(). Like you noted, this trigger 
> cannot be created before the function is created, but the function 
> cannot be created before the table.
>
> If you break up create.tbl_income.sql, you can first create
tbl_income, 
> then create the function, and lastly the trigger. Storing the trigger
in 
> the same file as the table's create statement seems like an error here
> (and probably in other places too.)
>
> Does that make sense?
>
> take care,
> jessi
 |