Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:19 PM
Tommy DN
Guest
 
Posts: n/a
Default 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 ???
  #2  
Old July 19th, 2005, 11:19 PM
DA Morgan
Guest
 
Posts: n/a
Default Re: Unhandled Exception on Oracle Form Builder

Tommy DN wrote:
[color=blue]
> 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 ???[/color]

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
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
  #3  
Old July 19th, 2005, 11:19 PM
Tommy DN
Guest
 
Posts: n/a
Default Re: Unhandled Exception on Oracle Form Builder

DA Morgan wrote:[color=blue]
> Tommy DN wrote:
>[color=green]
>> 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 ???[/color]
>
>
> 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');[/color]

OK thanks, it works. So, I consider this topic closed.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles