Connecting Tech Pros Worldwide Help | Site Map

Package used in the oracle form

Newbie
 
Join Date: May 2007
Location: Philippines
Posts: 11
#1: Sep 19 '08
Hi,

I don't know if I posted it in the right forum. Just transfer it what you think the right place is.

Anyway, my question is:

I had a this kind of format in the forms
DEPT CLASS SUBCLASS

12 18 20
11 18 22
11 11 11

Submit Button

And I want to validate each (validations if the field is null or not) field in every record once I hit the button Submit.

Now what I plan is to create a package that will be called once the submit button is hit. The problem is in creating the package. I don't know what query or script I should used to handle that.

Thanks...:)

Need your help that bad.
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#2: Sep 19 '08

re: Package used in the oracle form


Your requirement is not clear. You mean you need to check for NULL values?
Newbie
 
Join Date: May 2007
Location: Philippines
Posts: 11
#3: Sep 19 '08

re: Package used in the oracle form


Hi,

Yes. For example I want to validate each field if its NULL,If yes then there will be an error. I just placed an example on how the fields would look like in the forms. There were three fields, and each field has 3 records, now lets pretend there is a submit button under those fields. Once I hit that button the validation will take place. I planned to use a package. That package will be responsible in checking each field if its a null or not. My problem is I don't know how to create a package that will validate each field? Do I need to use a loop? A pl/sql nested table? a varray? I don't have any idea. Using a varray will limit me to a number of records? right? then if that is the case, then I can't use varray since the number of records in each field is not constant.

Please help. You're idea would on how to handle this would be very helful to the forms I'm creating.

Thanks a lot.
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#4: Sep 19 '08

re: Package used in the oracle form


Quote:

Originally Posted by krizzie khonnie

Hi,

Yes. For example I want to validate each field if its NULL,If yes then there will be an error. I just placed an example on how the fields would look like in the forms. There were three fields, and each field has 3 records, now lets pretend there is a submit button under those fields. Once I hit that button the validation will take place. I planned to use a package. That package will be responsible in checking each field if its a null or not. My problem is I don't know how to create a package that will validate each field? Do I need to use a loop? A pl/sql nested table? a varray? I don't have any idea. Using a varray will limit me to a number of records? right? then if that is the case, then I can't use varray since the number of records in each field is not constant.

Please help. You're idea would on how to handle this would be very helful to the forms I'm creating.

Thanks a lot.

how are you selecting the values for each field?using a single query or 3 seperate query??

one best way is to use the condion in the query itself...for NULLS.
SOmething like WHERE column_name IS NOT NULL
Newbie
 
Join Date: May 2007
Location: Philippines
Posts: 11
#5: Sep 20 '08

re: Package used in the oracle form


hi,

I'm planning to use 3 separate query. This is what I have so far:

Expand|Select|Wrap|Line Numbers
  1. if Dept is NULL then
  2.    O_error_message := SQL_LIB.CREATE_MSG( 'Dept',
  3.                                                NULL,
  4.                                                NULL,
  5.                                                NULL);
  6. elsif Class is NULL then 
  7.    O_error_message := SQL_LIB.CREATE_MSG( 'Class',
  8.                                                NULL,
  9.                                                NULL,
  10.                                                NULL);
  11. elsif Subclass is NULL then 
  12. O_error_message := SQL_LIB.CREATE_MSG( 'Subclass',
  13.                                                NULL,  
  14.                                                NULL,
  15.                                                NULL);
But that query will only look columns(dept,class,subclass) of one record. What I want to validate is the three records.
Reply


Similar Oracle Database bytes