Обсуждение: Odd problems with create rule

Поиск
Список
Период
Сортировка

Odd problems with create rule

От
Jamie Lawrence
Дата:
Hi all -

I'm having a strange problem creating a rule on a view.

I've done this with no problem in other databases... I'm wondering if
somehow there was something omitted or some other type of prolem with
the database creation. Or, I could have no idea what I'm talking about.

Any guesses?

dlm=# create or replace  rule addenda_insert_rule as
dlm-#         on insert to addenda do instead 
dlm(#                 insert into documents (
dlm(#                         project_id,
dlm(#                         doc_num,
dlm(#                         description,
dlm(#                         date,
dlm(#                         people_id,
dlm(#                         parent,
dlm(#                         document_type,
dlm(#                         state,
dlm(#                         machines_id,
dlm(#                         phases_id )
dlm(#                 values (
dlm(#                         new.projects._id,
dlm(#                         new.doc_num,
dlm(#                         new.description,
dlm(#                         new.date,
dlm(#                         new.people_id,
dlm(#                         new.parent,
dlm(#                         new.document_type,
dlm(#                         new.state,
dlm(#                         new.machines_id,
dlm(#                         new.phases_id );
ERROR:  Namespace "*NEW*" does not exist
dlm=# 

Thanks.

-j

-- 
Jamie Lawrence                                        jal@jal.org




Re: Odd problems with create rule

От
Tomasz Myrta
Дата:
Dnia 2003-07-25 23:38, Użytkownik Jamie Lawrence napisał:

> Hi all -
> 
> I'm having a strange problem creating a rule on a view.
> 
> I've done this with no problem in other databases... I'm wondering if
> somehow there was something omitted or some other type of prolem with
> the database creation. Or, I could have no idea what I'm talking about.
> 
> Any guesses?
> 
> dlm=# create or replace  rule addenda_insert_rule as
> dlm-#         on insert to addenda do instead 
> dlm(#                 insert into documents (
> dlm(#                         project_id,
> dlm(#                         doc_num,
> dlm(#                         description,
> dlm(#                         date,
> dlm(#                         people_id,
> dlm(#                         parent,
> dlm(#                         document_type,
> dlm(#                         state,
> dlm(#                         machines_id,
> dlm(#                         phases_id )
> dlm(#                 values (
> dlm(#                         new.projects._id,                                ^^^^^^^^^^^^^^^^^
> dlm(#                         new.doc_num,
> dlm(#                         new.description,
> dlm(#                         new.date,
> dlm(#                         new.people_id,
> dlm(#                         new.parent,
> dlm(#                         new.document_type,
> dlm(#                         new.state,
> dlm(#                         new.machines_id,
> dlm(#                         new.phases_id );
> ERROR:  Namespace "*NEW*" does not exist
> dlm=# 

Too many dots?
Shouldn't it be "new.project_id"?
Regards,
Tomasz Myrta




Re: Odd problems with create rule

От
Jamie Lawrence
Дата:
On Fri, 25 Jul 2003, Tomasz Myrta wrote:

> Dnia 2003-07-25 23:38, U?ytkownik Jamie Lawrence napisa?:
> >dlm(#                 values (
> >dlm(#                         new.projects._id,
>                                 ^^^^^^^^^^^^^^^^^
> >dlm(#                         new.doc_num,
> >dlm(#                         new.description,
> >dlm(#                         new.date,
> >dlm(#                         new.people_id,
> >dlm(#                         new.parent,
> >dlm(#                         new.document_type,
> >dlm(#                         new.state,
> >dlm(#                         new.machines_id,
> >dlm(#                         new.phases_id );
> >ERROR:  Namespace "*NEW*" does not exist
> >dlm=# 
> 
> Too many dots?
> Shouldn't it be "new.project_id"?

Oh, god. I'm a moron, or at least should have my vision checked.

Thank you.

-j

> Regards,
> Tomasz Myrta


-- 
Jamie Lawrence                                        jal@jal.org
Americans will tolerate just about anything as long as you 
don't stop traffic.  - Dan Rather