enhanced_adpater cannot find trigger in different schema

21 views
Skip to first unread message

Don McClean

unread,
Jan 17, 2013, 4:11:03 PM1/17/13
to oracle-...@googlegroups.com
I am configuring rails to interface to a legacy database in which I have an different account to access the tables from.
The oracle_enhanced_adapter is not finding the existing trigger method for inserting the primary key.


For example, if the schema is named DOG  and the table is named CAT, the
following query does not find the trigger.

SELECT trigger_name
 FROM all_triggers
 WHERE owner = 'DOG'
 AND trigger_name = 'DOG.CAT_PKT'
 AND table_owner = 'DOG'
 AND table_name = 'CAT'
 AND status = 'ENABLED'

because the trigger_name line instead would match without the schema name:

AND trigger_name = 'CAT_PKT'

Is there a way to configure the adapter to handle this?

Thanks,
Don Mc

Yasuo Honda

unread,
Jan 17, 2013, 4:18:45 PM1/17/13
to oracle-...@googlegroups.com
As far as I understand, There is no way to configure this.
You can see this source code below. Can be modified for your requirements.

https://github.com/rsim/oracle-enhanced/blob/master/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L1034-L1048


--
Yasuo Honda
> --
> You received this message because you are subscribed to the Google Groups
> "Oracle enhanced adapter for ActiveRecord" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/oracle-enhanced/-/Ng62LkmhFaYJ.
> To post to this group, send email to oracle-...@googlegroups.com.
> To unsubscribe from this group, send email to
> oracle-enhanc...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/oracle-enhanced?hl=en.

Don McClean

unread,
Jan 17, 2013, 4:20:58 PM1/17/13
to oracle-...@googlegroups.com
Yasuo,
  Thank you for the very quick response.

Regards,
Don Mc
Reply all
Reply to author
Forward
0 new messages