DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Can i make view with global variables in where clause?

  1. #1
    Join Date
    Nov 2000
    Posts
    29
    See subj

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You need to explain your question a little more clearly. Why would you need Global Variables in the where clause?
    Jeff Hunter

  3. #3
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    marist is right.

    However, might I suggest that you store your variable in a table. In every database, I create an ApplicationValues_T table that looks like:

    CREATE TABLE APPLICATIONVALUES_T (
    APPLICATIONVALUES_ID NUMBER (1) NOT NULL,
    NAME VARCHAR2 (30) NOT NULL,
    DESCRIPTION VARCHAR2 (60),
    STRING_VALUE VARCHAR2 (255),
    NUMERIC_VALUE NUMBER (10),
    DATE_VALUE DATE,
    )

    Then, I can store any value that I need everywhere in this table. For example, this usually includes a database version (to be tested against the application version). You can use such a table to store your 'global' values and then include this table in your views.

    - Chris

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    I belive maxxx is talking about using global variables from PL/SQL package. If I'm mistaken ignore this message.

    You can not reference package variables directly in a sql. But you can usePL/SQL function that returns the value of a package varible in the where clause of your wiev definition.

    HTH,
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Aug 2000
    Posts
    194
    see sys_context and dbms_session.set_context if you are using oracle 8i.

    Note: I am not very sure, whether it is applicable to your situation

Posting Permissions

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


Click Here to Expand Forum to Full Width