469,923 Members | 1,203 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

Unhandled Exception on Oracle Form Builder

I'm working with Oracle Form Builder and I needed a trigger to check
something when I delete a record. I made a trigger on ' KEY-DELREC ' and
I've written this code ( it's just a test, the delete statement isn't
ready ):

----
DECLARE
aantal number(8);
BEGIN
select count(*)
into aantal
from voorstellingen v
where :zalen.zaalnr = v.zaalnr;
show_error_alert('This query has ' + aantal + ' records');
raise form_trigger_failure;
END;
----

LITTLE EXPLANATION:
Another table called 'voorstellingen' can have zero or more records with
zaalnr as foreign key ( voorstnr as primary key, but this doesn't
matter, I think ). When this table has one or more records, it may not
be deleted. ':zalen.zaalnr' is the primary key of the table 'zalen' wich
I'm working with.

THE PROBLEM:
When I perform this, the code above should give me a message about how
many records the table voorstellingen has. But when I perform it I
receive an unhandled exception: " ORA-06502: PL/SQL: numeric or value
error string ".

Can someone help me please ???
Jul 19 '05 #1
2 13034
Tommy DN wrote:
I'm working with Oracle Form Builder and I needed a trigger to check
something when I delete a record. I made a trigger on ' KEY-DELREC ' and
I've written this code ( it's just a test, the delete statement isn't
ready ):

----
DECLARE
aantal number(8);
BEGIN
select count(*)
into aantal
from voorstellingen v
where :zalen.zaalnr = v.zaalnr;
show_error_alert('This query has ' + aantal + ' records');
raise form_trigger_failure;
END;
----

LITTLE EXPLANATION:
Another table called 'voorstellingen' can have zero or more records with
zaalnr as foreign key ( voorstnr as primary key, but this doesn't
matter, I think ). When this table has one or more records, it may not
be deleted. ':zalen.zaalnr' is the primary key of the table 'zalen' wich
I'm working with.

THE PROBLEM:
When I perform this, the code above should give me a message about how
many records the table voorstellingen has. But when I perform it I
receive an unhandled exception: " ORA-06502: PL/SQL: numeric or value
error string ".

Can someone help me please ???


Please do not post your question to every usenet group you can spell.
The appropriate group for Forms is c.d.o.tools.

There are two problems with your statement. The first, as pointed out
by Dirk is you concatenate strings with || not +.

The second is that aantal is a number so you should do an explicit
casting. Your statement should be:

show_error_alert('This query has ' || TO_CHAR(aantal) || ' records');
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace 'x' with 'u' to respond)
Jul 19 '05 #2
DA Morgan wrote:
Tommy DN wrote:
I'm working with Oracle Form Builder and I needed a trigger to check
something when I delete a record. I made a trigger on ' KEY-DELREC '
and I've written this code ( it's just a test, the delete statement
isn't ready ):

----
DECLARE
aantal number(8);
BEGIN
select count(*)
into aantal
from voorstellingen v
where :zalen.zaalnr = v.zaalnr;
show_error_alert('This query has ' + aantal + ' records');
raise form_trigger_failure;
END;
----

LITTLE EXPLANATION:
Another table called 'voorstellingen' can have zero or more records
with zaalnr as foreign key ( voorstnr as primary key, but this doesn't
matter, I think ). When this table has one or more records, it may not
be deleted. ':zalen.zaalnr' is the primary key of the table 'zalen'
wich I'm working with.

THE PROBLEM:
When I perform this, the code above should give me a message about how
many records the table voorstellingen has. But when I perform it I
receive an unhandled exception: " ORA-06502: PL/SQL: numeric or value
error string ".

Can someone help me please ???

Please do not post your question to every usenet group you can spell.
The appropriate group for Forms is c.d.o.tools.

There are two problems with your statement. The first, as pointed out
by Dirk is you concatenate strings with || not +.

The second is that aantal is a number so you should do an explicit
casting. Your statement should be:

show_error_alert('This query has ' || TO_CHAR(aantal) || ' records');


OK thanks, it works. So, I consider this topic closed.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Chuck Hartman | last post: by
reply views Thread by Colmeister | last post: by
5 posts views Thread by Simon Tamman {Uchiha Jax} | last post: by
4 posts views Thread by Corrado Valiente | last post: by
6 posts views Thread by Viktar Zhardzetski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.