Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Location
    Brisbane, Australia
    Posts
    10

    Unanswered: Specify criteria for Connect By query

    Hi All,

    I have a simple query as follows:

    select
    id,
    name,
    parent_id
    from
    tbl_business_units
    start with id = 'bu0002'
    connect by prior id = parent_id

    This query does exactly what I want in that it returns all the business units below 'bu0002'.

    I have a web based application that uses Crystal Reports 8. I want the user to be able to specify the Start With value at runtime.

    Is this possible, and if so how might it be done?

    Regards,

    Paul Hobbs

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    You will probably have to use dynamic SQL to accomplish this ... Look at passing the PL/SQL your value and replacing the variable ... then use
    execute immediate.

    HTH
    Gregg

  3. #3
    Join Date
    Apr 2004
    Posts
    246
    It's the same as having a user pass a variable for a regular select. I don't know crystal reports, but your query would be something like "start with id = :bu".

Posting Permissions

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