Forum OpenACS Q&A: (MYOPENACS.ACS_OBJECTS_OBJECT_TYPE_FK) violated
I'm not sure why (that's why I'm posting in hopes of a hint on where
to look) but when I try to insert stuff into my Oracle database it
halts and errors out with this message:
Request Error
ora8.c:3568:ora_tcl_command: error in `OCIStmtExecute ()': ORA-
02291: integrity constraint (MYOPENACS.ACS_OBJECTS_OBJECT_TYPE_FK)
violated - parent key not found
ORA-06512: at "MYOPENACS.ACS_OBJECT", line 68
ORA-06512: at "MYOPENACS.SNMP_INCIDENT", line 39
ORA-06512: at line 1
SQL: begin :1 := snmp_incident.new(mac_address => :modem_mac,
problem_id => :problem_id); end;
while executing
"ns_ora exec_plsql_bind nsdb0 {begin :1 := snmp_incident.new
(mac_address => :modem_mac, problem_id => :problem_id); end;} 1 {}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_ora $type $db $sql] $args"
invoked from within
"db_exec exec_plsql_bind $db $full_statement_name $sql 2 1 """
invoked from within
"if { [regexp {:1} $test_sql] } {
return [db_exec exec_plsql_bind $db
$full_statement_name $sql 2 1 ""]
} else {
return [db_exec dml $db $fu..."
("uplevel" body line 5)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle db {
# Right now, use :1 as the output value if it occurs in
the statement,
# or not otherwise.
set test_sql [db_qd_replace_s..."
(procedure "db_exec_plsql" line 11)
invoked from within
"db_exec_plsql insert_info "begin :1 := snmp_incident.new
(mac_address => :modem_mac, problem_id => :problem_id); end;""
invoked from within
"set incident_id [db_exec_plsql insert_info "begin :1 :=
snmp_incident.new(mac_address => :modem_mac, problem_id
=> :problem_id); end;"]"
("uplevel" body line 329)
invoked from within
"uplevel {
ad_page_contract {
@Script that handles the query lookup or history lookup
} {
modem_mac
action_type
} -properties {
erro..."
(procedure "code::tcl::/web/oacs/www/snmp/www/run-query2"
line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and
is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {
if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and
is up-to-date
adp_init t..."
(procedure "adp_prepare" line 3)
invoked from within
"adp_prepare "
(procedure "template::adp_parse" line 31)
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 7)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info([ad_conn url]) [ad_conn
path_inf..."
I understand that some foreign key is referencing something that
doesn't exist. But I am not sure if it's going:
OpenACS --> Me or
Me --> OpenACS
Thanks in advance
Posted by
Dave McBride
on 04/01/03 08:32 PM
See if there is a line in the acs_object_type.create_type
call such as this:
call such as this:
package_name => 'NAME'
For some reason, this line allows only one object type to be created for that package name. I removed it from my calls and the error does not happen.
Dave