Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2011

    Unanswered: Recursive Validation

    Looking for some ideas on recursive validation. I have the problem solved and in the testing stage but I am not sure I'm doing the validation the right way or best way.

    Problem: Question Form. The form has subquestions triggered on certain responses on the parent questions

    Solution:I use a few FOR .. IN (SELECT...) to move through the data. After I get into the level I need I SELECT value INTO and limited the results to less than 2 rows because I only care that there is an answer not how many check boxes or lines they filled in. If no value is selected it hits No_data_found exception and exits. I want it to exit on first problem, I'm just finding if there is an issue not what the issue is and exiting on first saves me time.

    I'm sorry I am unable to post the code. I would have to edit a lot out of it to not upset the boys upstairs and it would make the code worthless.

    Thank you for any discussion on the topic. Next time I'll be talking about questions with choices which have sub choices that need to be validated... lol

    New to PLSQL

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    one can write a recursive descent algorithm function in PL/SQL; such as to traverse a binary tree.

    You could do similar to meet your requirements
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2003
    Provided Answers: 23
    Quote Originally Posted by anacedent View Post
    one can write a recursive descent algorithm function in PL/SQL; such as to traverse a binary tree
    Depending on the structure of the table it could also be achieved with a single CONNECT BY query.

  4. #4
    Join Date
    Jan 2011
    I thought of connect by but here is my issue.

    I need to validate all parent questions first because if the parents aren't all answered then we just exit without going any farther.

    I database isn't setup to handle just 1 connect by I would have to run a connect by each time a question was a parent.

    Question -- Parent
    3 2
    6 6

    Second issue is I only want to validate the children question on a triggered answer from the user.

    So question 3 would only be active if the user said yes to question 2. If they said no, I never validate question 3.

    Thanks for the replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts