Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008
    Posts
    48

    Thumbs up Unanswered: View with parameters

    can we create a view with parameters

    Example
    Table1
    code col1 col2 col3
    A 1 10 2
    B 1 21 3
    C 0 4 7
    D 0 3 9

    View1 :

    select case col1 = 1 then paradate + col2 days
    else paradate - col3 days as res1 from table1

    paradate is parameter i want to pass when quering view

    Is this possible using views or i have to write function

    Thanks

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Table Function ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    From CREATE VIEW in the manuals :

    fullselect
    Defines the view. At any time, the view consists of the rows that would result if the SELECT statement were executed. The fullselect must not reference host variables, parameter markers, or declared temporary tables. However, a parameterized view can be created as an SQL table function.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Nov 2008
    Posts
    48
    Thanks Sathyaram

Posting Permissions

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