Package used in the oracle form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krizzie khonnie
    New Member
    • May 2007
    • 11

    Package used in the oracle form

    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
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Your requirement is not clear. You mean you need to check for NULL values?

    Comment

    • krizzie khonnie
      New Member
      • May 2007
      • 11

      #3
      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.

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        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

        Comment

        • krizzie khonnie
          New Member
          • May 2007
          • 11

          #5
          hi,

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

          Code:
          if Dept is NULL then
             O_error_message := SQL_LIB.CREATE_MSG( 'Dept',
                                                         NULL,
                                                         NULL,
                                                         NULL);
          elsif Class is NULL then 
             O_error_message := SQL_LIB.CREATE_MSG( 'Class',
                                                         NULL,
                                                         NULL,
                                                         NULL);
          elsif Subclass is NULL then 
          O_error_message := SQL_LIB.CREATE_MSG( 'Subclass',
                                                         NULL,  
                                                         NULL,
                                                         NULL);
          But that query will only look columns(dept,cl ass,subclass) of one record. What I want to validate is the three records.

          Comment

          Working...