How to get sys_context function

hi,
i m working on oracle 10g but i dont hav sys_context function on my sys user.
how can i hav it & from where.
can i create this kinda function on my oracle 9i ?
thxs

i m working on oracle 10g but i dont hav sys_context function on my sys user.How do you know its not there?
Although this article is for Oracle 11g, but most of the attributes can also be used in Oracle 9i and 10g.
http://www.psoug.org/reference/sys_context.html
Execute the following command and paste the output on this thread.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
TEST
SQL>

Similar Messages

  • How to get the function name/ID  of the current page

    HI,
    I searched the forum and google, but it is not clear on how to get the function name of the current page.
    I have 4 functions in my self service A ,B,C,D (seeded page links ) they all have to go to a page called hhhPG. Based on which function user is clicks I have to show the data in hhhPG.
    so my question is how to get the function name ? I mean I need to know if user click on link A , B, C or D link and came to this page.
    I found below in one forum and also there is getfunctionID in pageContext , but I do not know what to pass to getfunctionid("???") to get value.
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    Or is there a better way of know where user is coming from ? like geturl....
    Please help, I need this ASAP.
    Thank you.

    Use below to find out how the user came into the page
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    boolean isFunc1 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME1"));
    boolean isFunc2 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME2"));
    boolean isFunc3 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME3"));
    boolean isFunc4 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME4"));
    So one of them will be true based on the function the user came in.
    Write your logic based on these flags.
    Regards,
    Peddi.

  • How to get the function name in controller class

    Hi experts ,
    I am new to the OAF framework.
    i have created the two functions and bot he the function have the same controller class .i want to capture the function name or function id in the controller class.
    can you please let me know how to get the function id or function name in the controller class.

    Hi apurba,
    Thanks for the quick reply.
    i am trying to get the function name from the FunctionSecurity class,
    However in FunctionSecurity class there is no such method defined as getFunctionName();
    my requirement is ,i have two functions functionA and functionB defined.
    both the function has the same controller class.in controller class ,i need to get the function name ,based on the function name
    i will redirect the page to respective page.
    looking forward for you response.
    appreciate your help
    Thanks,
    KT

  • How to get saturation function in system generator

    Hi,
    I use system generator and try to achieve the saturation function by using Xilinx Libary.
    For example, how could i get a function which is similar to the block "Saturation" in normal simulink library.
    The back ground is that i have a PWM signal in my FPGA model. Now i want to cut the negtive value. Or change all the negative value to zero.
    Thank you.

    The gateway in blocks have saturation option for saturation at the ports. For signals internal to the sysgen design, you can use the Convert block which also allows saturation option.
     

  • How do get "Subscribe" function in cFolder to work?

    Hello
    Could anyone please tell me how to enable subscribe function on douments in cFolder. When tic the checkbox for "Subscribe" i want end users to get an e-mail with an hint that a document is updated.
    Is this a SPRO activity?? I have checked but can not find where to enable so it actually works. And also, where do i specify e-mail adresses for this function? SU01 ??
    Appreciate all help I can get. Thanx //Pelle

    Hi
    This is not SPRO activity..
    you have to maintain 2 things...
    In settings (on top links> right corner) of User he has to select
    Send mail for notification as Immediate
    and
    for this the requirement is Email for the user Id should be mapped for both, the person who updates and one who needs to get a notification...
    I hope this helps
    There is 1 std setting by which automatically when the user is created the setting button in user is activated.
    this is done in Network settings link on left panel.
    This is generally handled by administrator role
    Niranjan
    P.S. Award points if useful...!

  • How to get this function working

    Dear buddies,
    I created a function which should check if a certain code exists in a certain table.
    Not sure how to get it done
    create or replace function check_code(crs_code in varchar) return integer is
      Result integer;
    begin
      if crs_code in (select cod_code from crs_code) then
        result := 1;
      else  
        result := 0;
      end if;
      return(Result);
    end check_code;error: Compilation errors for FUNCTION CONV.CHECK_CODE
    Error: PLS-00405: subquery not allowed in this context
    Line: 6
    Text: if crs_code in (select cod_code from crs_code) then
    Error: PL/SQL: Statement ignored
    Line: 6
    Text: if crs_code in (select cod_code from crs_code) then

    My guess is that
    create or replace function check_code(p_crs_code in varchar) return integer is
      l_Result integer;
    begin
      SELECT COUNT(*)
        INTO l_result
        FROM dual
       WHERE EXISTS (
          SELECT 1
            FROM crs_code
          WHERE cod_code = p_crs_code
      return( l_Result);
    end check_code;should work but you've provided no table structure, no sample data, and no desired output so it's a bit unclear. Note that it is a really bad idea to have parameter names that match table names. My assumption is that CRS_CODE is both a table and a parameter name in your original function. Otherwise, I'm not sure what your SELECT statement is attempting to do.
    Justin

  • How to get current function name?

    Hello, everyone!
    I want to get the current function name for debug purpose. I simply want to dump out current class name, function name (and better line number) of current executing statement. For example, I can embed my debugger inside my source codes if I can get the current function name as the following,
    <code>
    class foo
    void function goo()
    //operations
    myDebugger (getCurrentFunctionName(), informationString)
    </code>
    Then my debugger will have richer information which indicates in which function information is dumped. Have I made myself understood? If Java does not have such apporach to get current function name automatically, I have to define a function local variable which contains function name manually in each function I want to debug. And pass the variable to my debugger which seems rather silly.
    Can anyone help?
    Thanks in advance,
    George

    To elaborate a little: be sure to read the API on getStackTrace: because of JVM optimization
    there may be missing stack trace info, so look before you leap:
    public class Client {
        public static void main(String[] args) {
            f();
        static void f() {
            Debugger.log("testing");
    class Debugger {
        public static void log(String msg) {
            StackTraceElement[] trace = new Throwable().getStackTrace();
            if (trace.length >= 1) {
                StackTraceElement elt = trace[1];
                System.out.println(elt.getFileName() + ": " + elt.getClassName() + "." +
                    elt.getMethodName() + "(line " + elt.getLineNumber() + "): " + msg);
            } else
                System.out.println("[UNKNOWN CALLER]: " + msg);
    }

  • How to use SYS_CONTEXT Function/procedures

    Hello, I am not familiar with this function and am trying to get a better understanding of how it works and how to find WHERE the data is being stored.
    I understand that this is an Oracle Function as well as how its parameters are used, but I don't understand where the data is stored:
    Example (my client created this query - in part):
    SELECT
    COLUMN1,
    COLUMN 2
    from TABLEA A
    where a.company = sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE')
    and a.job_code = sys_context('USER_CONTEXT','SL_OJSQ_JOB_CODE')
    and a.phase = sys_context('USER_CONTEXT','SL_OJSQ_PHS_CODE')
    and a.category = nvl(sys_context('USER_CONTEXT','SL_OJSQ_CAT_CODE'), a.category)
    I am trying to figure out how the JOIN is being used. How can I find the table/data for sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE') or maybe it is not a table/data but a package...?
    Any guidance is appreciated,

    Hello, I am not familiar with this function and am
    trying to get a better understanding of how it works
    and how to find WHERE the data is being stored.
    I understand that this is an Oracle Function as well
    as how its parameters are used, but I don't
    understand where the data is stored:
    Example (my client created this query - in part):
    SELECT
    COLUMN1,
    COLUMN 2
    from TABLEA A
    where a.company =
    sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE')
    and a.job_code =
    sys_context('USER_CONTEXT','SL_OJSQ_JOB_CODE')
    and a.phase =
    sys_context('USER_CONTEXT','SL_OJSQ_PHS_CODE')
    and a.category =
    nvl(sys_context('USER_CONTEXT','SL_OJSQ_CAT_CODE'),
    a.category)
    I am trying to figure out how the JOIN is being used.
    How can I find the table/data for
    sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE') or
    maybe it is not a table/data but a package...?
    Any guidance is appreciated,There is no JOIN in your statement.
    USER_CONTEXT is the name of an application context which is already created and should be initialized in your session. It is simply a set of attributes and your query shows some of them : SL_OJSQ_COMP_CODE, SL_OJSQ_CAT_CODE, ...
    you can query the view session_context to see attributes and values of contexts initialized in your session

  • How to get planning function in customized data slice?

    Hi all,
    we are using a customized data slice which implements IF_RSPLS_DATASLICE. Now we have the requirement that the data slice only protects the data when it calls via query. The data slice will not protect data if a planning function is executed. How can we implement this requirement? Is it possible in the method IF_RSPLS_DS_METHODS ~ IS_PROTECTED to read this information from an instance of the planning function (CL_RSPLS_CR_CONTROLLER?) or the buffer or something else? Or can we find some information about the query?
    At the moment we only check if a planning sequence is called by a process chain. This works fine
    IF sy-batch IS NOT INITIAL.
        e_noinput = rs_c_false.
        EXIT.
      ENDIF.
    Thanks for your help!

    Hi,
    I think this topic was already discussed in this forum.
    By design, it should not matter whether a query or a planning function is not allowed to change records. This is what data slices were designed for.
    OK, you need a different behaviour.
    1. Maybe you can detect from the planning function filter or query filter whether you run function or a query. If this is the case use the method IS_OVERLAPPING of the data slice. There you get the filter as a I_TSX_SELDR or as a range table when you call SELDR_TO_RANGE. When you return r_is_overlapping = rs_c_false. the data slice will not be called.
    2. Another option is to call the factory of the data slice and to use a flag in the data slice that indicates that the data slice is used in the context of a planning function. The factory method is GET_INSTANCE. Set a break point there to find out how the system calls this method. But when to call the factory? Check note 1101726. This note provides infrastructure to change the filter of a planning function at run time. But you can use this exit to call the factory method mentioned above. The nice thing is that you can raise the excpetion EMPTY in the exit, thus the function will not be called. So use a planning sequence with dummy1, your function, dummy2. For dummy1 switch on flag on, raise EMPTY, dummy1 will not be executed (almost no run time is needed), then 'your function' will be called (do nothing in the exit', then function dummy2 will be called, here switch the flag off again.
    Check also the following link where the above technique is used to for the conditional execution of planning functions:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0785271-1446-2d10-6987-d1e44f08e97c
    Regards,
    Gregor

  • How to get a function to return a value occuring after a character

    I need to write a function to return the next value occurring after the ":" character in a column. If multiple values of ":" occurs then the function should return the sum of the next value occurring after each ":" in the column.
    For example a rating value of 4:1 would return the value of 1. However, the rating of "5:1:1" should return a value of 1+1 = 2, and 6:2:1 will return of 2+1 = 3.
    I have the below function skeletion and trying to figure out how the select statement will compute based on the position of : in the column and add the values and return the value back to function.
    Function fn_check_internalrating(p_internalrating IN VARCHAR2)
          RETURN number
    IS
        cnumber number;
        cursor c1 is
       select ................................
    BEGIN
    open c1;
    fetch c1 into cnumber;
    close c1;
    RETURN cnumber;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN NULL;
    END;

    Hi,
    You don't need a cursor: there's no table involved in this function, and no point in using any table.
    Here's one way:
    CREATE OR REPLACE FUNCTION  fn_check_internalrating
    (   p_internalrating   IN   VARCHAR2
    ,   p_delimiter            IN   VARCHAR2     DEFAULT     ':'
    RETURN  NUMBER
    DETERMINISTIC          -- Same input always produces same output
    IS
        cnumber     NUMBER     := 0;               -- value to be returned
        pos          PLS_INTEGER := INSTR ( p_internalrating
                                        , p_delimiter
                             );          -- position where delimiter was found
    BEGIN
        WHILE  pos != 0
        LOOP
            cnumber := cnumber + TO_NUMBER ( SUBSTR ( p_internalrating
                                                  , pos + 1
                                         , 1
         pos := INSTR ( p_internalrating
                          , p_delimiter
                   , pos + 1
        END LOOP;
        RETURN cnumber;
    END fn_check_internalrating;
    SHOW ERRORSThis assumes the function is a stand-alone function. If it's part of a package, you don't say CREATE OR REPLACE at the beginning.
    Try to make functions generic, so that if a similar (but not identical) situation comes up in 6 months from now, you can use the same function. I'm guessing that somethimes you may want to do the same thing with some character other than ':' before each number, so I added the 2nd (optional) argument p_delimiter. You can call the fucntion with either 1 or 2 arguments.
    If an error occurs in a PL/SQL fucntion, an error message (showing the exact location of the error) is displayed, and execution halts. If you use an EXCEPTION sectinn, you lose all that functionality, or have to code it yourself. Only use an EXCEPTION handler when you really have to.
    For this function, you may or may not want to. For example, if the character right after a delimiter is not a digit, the call to TO_NUMBER in function will raise "ORA-01722: invalid number". You may want to catch that error in an exception handler, and return 0 or NULL. On the other hand, you may want to test that the character after the delimiter is a digit before calling TO_NUMBER, and not have an EXCEPTION section.
    What else could go wrong? Try to think of potential problems and fix them when you first write the function. If you discover an error next year, you'll have to spend a fair amount of time finding the function, and getting acquainted with it again.
    What should the function return if p_internalrating is NULL, or doesn't contain any delimiters?
    What if there's a number longer than 1 digit after a delimiter, e.g. '6:78:9'?

  • New keyboard, function keys have changed, how to get standard functions back?

    Hi, I recently just bought a new keyboard with numerics and when i hook it up, all my function keys are different. F12 now shows me the date and time/calculator. F11 scoots my open boxes do the side.
    how do i get it back to the standard functions? ie, F1-F2 controling brightness, F10,11 and 12 controling sound.

    Is this a new Apple wired keyboard? Perhaps model MB110LL/B?
    Apple Keyboard with Numeric Keypad - English (USA) - Apple Store (U.S.)
    If so -

  • How to get the functionality of downloading files from internet on my jsp

    i have a jsp page that lists me the names of the zip files in a paricular directory on a remote computer over the network.wat i want to do is download those files.so when i click on them it gives me "page cannot be displayed" error.but when i go to that remote machine and run the same jsp to list me the files and download the same it allows me to download the files.but i want the same functionality over the network.so i think that that link is looking for that file locally instead of looking for them over the network.so is it so that i need to give the ip of the remote machine from where i want to download the file and if yes then how and if no then is there any way that i can do it some other way.
    in short this functionality is like downloading some file from the net like downloading software or music....i want to incorporate the same on my jsp.please guide me.

    You can try this, Give the URL from where you want to Download.......
    import java.io.*;
    import java.net.*;
    public class DnldURL {
    public static void main (String[] args) {
    URL u;
    InputStream is = null;
    DataInputStream dis;
    String s;
    try {
    u = new URL("http://username:[email protected]:8080/files/for/me/file.txt");
    is = u.openStream(); // throws an IOException
    dis = new DataInputStream(new BufferedInputStream(is));
    while ((s = dis.readLine()) != null) {
    System.out.println(s);
    } catch (MalformedURLException mue) {
    System.out.println("Ouch - a MalformedURLException happened.");
    mue.printStackTrace();
    System.exit(1);
    } catch (IOException ioe) {
    System.out.println("Oops- an IOException happened.");
    ioe.printStackTrace();
    System.exit(1);
    } finally {
    try {
    is.close();
    } catch (IOException ioe) {
    Here in the URL we will give username and password, if the remote system is password protected.

  • How to get Database functions into xquery/XSLT in OSB 12c

    Hello All,
    How to make use of  functions orcl:sequence-next-val and orcl:query-database in xslt/xquery in OSB 12c.
    I need to do the below logic in xslt/xquery and used it in replace activity . But in OSB 12c I don't see these function. Request to provide me the solution to do it in OSB.
    XSLT in SOA
    <xsl:when test="/ns0:CreateEvent/ns0:Header/header:SourceName != &quot;&quot;">
                <ns1:googleEventSourceId>
                  <xsl:value-of select="orcl:query-database(concat(&quot;select google_event_source_id from enterprise.google_event_source where google_event_source=&quot;,&quot;'&quot;,/ns0:CreateEvent/ns0:Header/header:SourceName,&quot;'&quot;),false(),false(),&quot;jdbc/PRDatasource&quot;)"/>
                </ns1:googleEventSourceId>
              </xsl:when>
    <ns1:googleMapEventId>
              <xsl:value-of select="orcl:sequence-next-val(&quot;enterprise.google_map_event_seq&quot;,&quot;jdbc/PRDatasource&quot;)"/>
            </ns1:googleMapEventId>
    please see below code is just part of my transformation.
    Regards,
    TJ.

    bump

  • How to get the function codes

    Hi ,
    For displaying ALV on a modal dialog screen, I am using "CL_GUI_ALV_GRID" and the method is SET_TABLE_FOR_FIRST_DISPLAY.
    I want to exclude the complete tool bar that is appearing on the screen. For that I have an exporting parameter of the above mentioned method, i.e., "IT_TOOLBAR_EXCLUDING"
    But I dont know the function codes of the tool bar elements, to fill the internal table with. Couls any one please help me how to find them out.

    In the ALV Layout mark NO_TOOLBAR = 'X'
    data: e_layout TYPE LVC_S_LAYO.
    MOVE 'X' TO e_layout-no_toolbar.
    Pass e_layout to IS_LAYOUT of SET_TABLE_FOR_FIRST_DISPLAY
    Edited by: Swastik Bharati on Apr 22, 2009 3:24 PM

  • How to get old functions working on new keyboard

    I purchased a new metallic keyboard to replace the original on my Mac G4, and downloaded the specified software update. Now the keyboard works, but some of my applications that had functions attached to the old function keys won't respond to the new function keys, which Apple reconfigured to do other things. Is there a workaround? I tried reconfiguring System Preferences, but nothing there makes sense.

    I am trying to get te @ key to function by pressing down the normal shift+' key, It is a windows keyboard I am using. Any clues anyone. cheers Janny
    It's the software keyboard layout that determines this. The Mac "British" layout puts @ at Shift + 2. If this drives you crazy, you can download and install a different layout:
    http://liyang.hu/osx-british.xhtml

Maybe you are looking for

  • Billing doc not flown to A/C

    Hi, One billing doc.not flown to A/C,trying to release it manually but showing error - "Error in account determination: table T030K key 1000 JN7 A2." Kindly help to resolve this issue. Harsh

  • Identifying methods

    hai all,           iam new to webdynpro abap as well as for OOPS.here iam working on PDO layer.I have already Identified the req.d Structures in which fields are used to O/P display.and for the SRM 5.0 screens in Monitor shopping Cart , I have to ide

  • Parameters node in forms navigator

    Hello. Is it possible to create parameters with pl/sql code and not just in navigator? We have two forms. Called form is dynamic parameter form, which looks into table and then shows those columns that are defined in table. Now we want those columns

  • Editing data

    I am setting up an editing interface for a spry dataset. My Function: var dsApplications = new Spry.Data.XMLDataSet("XML/apps_xml.php", "gillette/apps", { useCache: false }); function updateResponseDiv(req) dsApplications.loadData(); Spry.Utils.setIn

  • ADF Mobile: amx:listView keyboard event handler

    My view needs to accept keyboard input, but does not have an inputText, only a listView. I need to update listItems based on the keyboard input, but cannot add an inputText field to the view. Can I capture keyboard events in the view, the panelPage,