Function to get session variable is not working

I created a report based on the following sql query:
SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO FROM SCOTT.EMP
WHERE DEPTNO = empcust.current_deptno
empcust.current_deptno is a function which returns the value of the session variable. However, nothing gets returned. The value of the session variable is not found.
I know that the session variable is being set b/c i have a procedure that sets it and prints out the assigned.
This is my code for the current_deptno function. If anyone can help, i'd greatly appreciate it!
procedure current_deptno
return VARCHAR2
as
v_Session portal.wwsto_api_session;
v_Return VARCHAR2(20); --DEPT.DEPTNO%TYPE;
begin
v_Session := portal.wwsto_api_session.load_session('PORTAL','SESS_EMP');
v_Return := v_Session.get_attribute_as_varchar2('DEPTNO');
htp.p('Return session var'||v_Return);
RETURN(v_Return);
end;

Hi Imtiaz,
Could you verify that the variable has indeed a value? You could check via the Session Manager in the Admin Tool. You could also check the Query Log to verify whether the Initialization Block is working like expected.
Thanks.
Daan Bakboord
http://obibb.wordpress.com

Similar Messages

  • Session variables is not recognized in my CFC

    Hi,
    I got a very weird problem today! I have created a simple
    login page ( username as an email and a password). This is post to
    the same page where I verify from a query if the username and
    password are valid. Once the query returns a RecordCount greater
    than 0, I create session variables to store the first name and last
    name of the user. I can see actually the session variables from a
    CFDUMP at that level.
    Since I am developping an application that will mix
    ColdFusion (mostly CFC) and Flex 3, I have created a CFC where I
    store functions needed for the Flex application. One of the
    function is fGetUserInfo where I try to collect the information I
    previously store in the session scope from the login - such as the
    first name. The system stop right there with an error saying that
    the session variables are not defined while I have the session
    variables appear at the bottom of the debug information in the same
    page. This is starting to be over my knowledge and I must missing
    an information to resolve this - in other words, I need your
    help!!!
    I include some code to understand that the problem is not a
    mispelling!!! ;-))

    I tried to change the savings of the user's information into
    cookies instead of the session scope but it does the exact same
    error (except it says Element TECHNICIANID is undefined in COOKIE).
    In fact, after a little break, I started to think about the
    method to access the functions inside the CFC. As it is remote, I
    though that it might have a sense of no life on the session scope.
    Than I though about the idea to transfer all the informations to
    the client with Cookie. CFCOOKIE work fine and I was kind of
    animated by my idea! I coded, I tried and it failed. I used at
    first the default value of the CFCOOKIE which consists to reside on
    the memory like a session but disapear when the user close his/her
    browser. So after the first fail I change the expiration for 30
    minutes but it failed again and for the same reason: Element
    TECHNICIANID is undefined in COOKIE.

  • In OS Yosemite the search function in Mail, Finder, Spotlight- does not work

    MacBook Pro (Retina, 15-inch, Late 2013)
    2,6 GHz Intel Core i7
    16 GB 1600 MHz DDR3
    NVIDIA GeForce GT 750M 2048 MB
    OS Yosemite,
    Finder versión 10.10.1
    Mail Versión 8.1 (1993)
    In OS Yosemite the search function in Mail, Finder, Spotlight… does not work. Messages or documents with the search criteria are there and one could find them manually, but the search function fails to find them. Following advice from Apple Support (728965377):
    1. I applied an Apple protocol for adware removal (Remove unwanted adware that displays pop-up ads and graphics on your Mac); I had none, because I had formally utilized a similar protocol that I had found in Internet, actually an app that implemented automatically Apple's adware removal protocol.
    2. I rebuild the post boxes in Mail (Mail (Yosemite): Reconstruir buzones); It took a while but it functioned properly
    3. I re-install the System (OS X Yosemite: Reinstalar OS X); It took about 4 hours but there was no problem whatsoever with the installation.
    Afterwards I searched for messages in Mail, and documents in Finder and Spotlight, without any difficulty. The search function in all of them was working properly. But the next time that I needed to search messages or documents, an hour later or so, the problem reappear and a couple of new issues occurred:
    1. in app RagTime 6.5.2 (Build 1821), www.ragtime.de, the menu bar disappears (it is invisible), when one performs certain operations, e. g., calculating a value with a formula, whether it is in a spreadsheet or some other component (text, drawing, etc.). After touching with the cursor the menu bar is visible again.
    2. after reading an e-mail in Mail or copying an address, this is seeing as a floating object in the finder and over every application. There is no logical way to get rid of the floating object and neither copying or deleting or cutting it. It is not a big issue but nonetheless bothersome.
    3. In Mail, messages with Flag or in VIP contacts cannot be seen in the appropriate folders, only in the Incoming mail folder, together with other messages. It seems to me, this issue is part of same search function problem.
    4. The preview function within Mail does not show the attached documents to a message, whether it is in the IN, OUT or Draft boxes.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Click the Clear Display icon in the toolbar. Then try again to re-index Spotlight. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name or email address, may appear in the log. Anonymize before posting.

  • BI Administrator error: Session Management will not work

    Hi!
    I am about to set up BI Administrator Addon in SAP Portal. All the configuration steps seems to be ok.
    Unfortunately when I try to start some of applications of BI Administrator I get the following error:
    Session Management will not work.
    Please check the DSM log file for details
    Question:
    How can I solve this problem?
    Thank you very much!
    regards

    Hi
    This error means--Please notify us of this problem by submitting an IT Service Request (Please Note: In order to log into the Infra system, you will need to preface your NKU account with nku\.  For example, if your user name is smithj7, the "User Name" field would need to be populated with nku\smithj7.)
    under the problem type "SAP BW/Portal.
    Much of EP / BASIS issue.
    Hope it helps

  • When Firefox is open the zoom function (option/command/space bar) does not work in Adobe programs (InDesign, Photoshop, Illustrator)

    Mac OS X 10.6.7
    CS 5.5
    When Firefox is open the zoom function (option/command/space bar) does not work in Adobe programs (InDesign, Photoshop, Illustrator). This happens only when Firefox is open and when I close it the zoom functions work fine again without having to restart the applications.
    This is intermittent but happens quite frequently each day if Firefox is active.

    MDN doesn't mention -chrome being used for ordinary web pages: https://developer.mozilla.org/docs/Mozilla/Command_Line_Options#Chrome
    When I use
    firefox.exe -chrome about:permissions
    I get a usable window, but zoom doesn't work as you noted.
    How about using an intermediate page and window.open() for the target page? You can (mostly) restrict the chrome of windows opened that way, but it will leave behind the intermediate window...
    https://developer.mozilla.org/docs/Web/API/Window.open

  • I have an macbook. The pinch/squeeze function (enlarges images via trackpad) will not work on my laptop on this version of firefox.

    The pinch open and close (enlarges screen and images via trackpad) function on my Macbook Pro does not work. It worked with the previous version of firefox.
    I'm not happy trying to add fixes to new version firefox. Please tell me how to get rid of this new version and reinstall the previous.

    Some gestures have been removed in Firefox 4.
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    browser.gesture.pinch.in -> <b>cmd_fullZoomReduce</b>
    browser.gesture.pinch.in.shift -> <b>cmd_fullZoomReset</b>
    browser.gesture.pinch.out -> <b>cmd_fullZoomEnlarge</b>
    browser.gesture.pinch.out.shift -> <b>cmd_fullZoomReset</b>
    browser.gesture.pinch.latched -> <b>false</b>
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    You can use the Filter bar at to top of the about:config page to locate a pref more easily.

  • The search function in the itunes store does not work.  It will accept a request and suggest searches but then it locks up and will not search.  Clicking on the magnifying glass or a suggested search does nothing.  Re-installing itunes has not helped.

    The search function in the itunes store does not work.  It will accept a request and suggest searches but then it locks up and will not search.  Clicking on the magnifying glass or a suggested search does nothing.  Re-installing itunes has not helped.

    everything you stated here is exactly what i have done and have got nowhere. i have windows 7 64 bit on a hp 8 g of ram desktop. im also looking for help

  • Variable Text not working as dynamic header in Crystal report

    Dear Experts,
    I'm working Crystal report that connected to Query BEX SAP BW trough SAP integration kit,
    currently i have case that need report dynamic header using variable text from BEX query, but seem the variable text not working in Crystal reports. the header in Crystal report shown as Desription\technical name, not result from the variable text in Query BEX in SAP.
    In https://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal%20Reports%20and%20BW%20query%20elements stated that the "Text variable" with "replacement path" is supported, but i don't know in my query is not working.
    i already set in Database -> options->  table and fields -> Show Both, but the text variable still not working.
    can you help me
    Crystal Reports 2008 12.2.0.290
    SAP Integration KIT 12.1.0.890
    Thanks
    Luqman

    Post your question BEX and B1 and classic SAP data source issues to the Integration Kit forum

  • SELECT INTO ( variable ) STATEMENTS NOT WORKING FOR SYBASE TABLE AS VIEW

    Dear Experts,
    We have connected our 9i db with Sybase db using Hs connectivity.
    and then we have create the view in oracle db for SYBASE_TABLE as SYBASE_TABLE_VIEW.
    ALL THE INSERT, UPDATE AND DELETE COMMANDS ARE WORKING BUT THE
    select Into (variable) is not working.
    Please help to resolve the select into statment which is in BOLD in the below routine
    PLEASE NOTE! FORM WAS COMPILED SUCCESSFULLY AND FORM IS RUNNING BUT SELECT INTO COMMAND IS NOT WORKING.
    Thanks & Regards
    Eidy
    PROCEDURE SRBL_INSERT IS
    CURSOR SRBL IS
         SELECT impno,impcod,impnam
         from oracle_table1 a, oracle_table2 b
         WHERE a.impcod=b.empcod
         v_srpcod varchar2(5);
    BEGIN     
    FOR rec in SRBL loop     
         begin
    select "im_code" into v_impcod                    
         from SYBASE_TABLE_VIEW
         where "im_code"=rec.impcod;
    exception when no_data_found then
         v_srpcod:=null;
    end;
    END LOOP;
    END;
    Edited by: Eidy on Aug 16, 2010 11:28 AM

    hellow
    try this.
    select "im_code" into v_impcod
    from SYBASE_TABLE_VIEW
    where "im_code"=rec.impcod;
    v_srpcod := v_impcod ;
    ........

  • The search function on my "sent" mail does not work - can anyone help?

    The search function on my "sent" mail does not work. When I type in more than two letters into the saerch box - the sent mail screen goes blank. Any ideas how to fix this? Apple technical support has not been much help for the past five days...

    As this is the forum for the MacBook Pro hardware, your question will be better answered in the OS X Snow Leopard forum where the Mail app is discussed.

  • Sun Access Manager 2005Q1 session failover is not working

    Hi All
    I m using Sun access manager 2005Q1,message queue 2005Q1, Sun Directory server 5.2 ,BerkelyDb 4.2.52 and radware hardware load balancer with sticky session.
    I m have configured message queue and BerkeleyDB and both are running with any error.
    I m using http://docs.sun.com/source/817-7644/ch5_scenarios.html#wp41008 doc for session failover.
    Simple failover is working fine but the Session failover is not working.
    Any body has done session failover with Sun Access manager 2005 Q1 I m trying to resolve this issue last two month.
    Please it is urgent.

    It works fine in 2005Q4, after applying a patch 120954 if I am not mistaken. But 2005Q4 and 2005Q1 are probably different in terms of session failover (site configuration etc.)
    1. Stop both AM servers
    2. Set logging to debug mode in AMConfig.properties.
    3. Delete / move everything in /var/opt/SUNWam/debug
    4. tail -f /var/opt/SUNWam/debug/amSession
    5. Post that file here... you should be able to see if session failover is enabled etc....
    hope this helps.

  • I am getting frustrated with Apple not working with Flash player on some of my favorite web sites. Is there any alternative that will work on I-pad instead of flash?

    I am getting frustrated with Apple not working with Flash Player on some of my favorite web sites! Is there another alternative to watching these site options on my I-pad?

    Flash is not, and probably never will be, supported on the iPad : http://www.apple.com/hotnews/thoughts-on-flash/ . Plus it would be up to Adobe to make a version of their flash player that works on iOS devices - something which they have never managed to do and which they have now given up on trying to do.
    Browser apps such as Skyfire, iSwifter and Puffin 'work' on some sites, but judging by their reviews not all sites. Also some websites, especially news sites, have their own apps in the App Store, so your could try checking there for your sites (and there is the built-in YouTube app).

  • How can apple send out an os update that renders an important function of the software/hardware to not work? They knowingly have sent out this new os update for iPad which makes airplay nonfunctining! I need this for my business!

    How can apple send out an os update that renders an important function of the software/hardware to not work? They knowingly have sent out this new os update for iPad which makes airplay nonfunctining! I need this for my business!  I could understand if they didn't know, but it is all over the Internet! When I went in to have it revert back to os6 (which worked fine!) I was actually asked if I had done any research before I installed the upgrade! As if this is the consumer's fault for being dumb enough to fall for the upgrade!

    That is not what I have discovered, nor what others have discovered, nor what I was told when I went the Genius Bar.  I cannot remotely mirror to my MacBook Pro and it only started the day after I installed the upgrade.  We tested it with an iPad that had not been upgraded, no problem.

  • Repost Function using Variable is not working

    Hello experts!  I am on BW-BPS 3.5.  I have set up a repost function using variables to change a characteristic value for Business Unit.
    1. I created 2 variables as Bus.Unit From and Bus.Unit To in the Planning Area. I am not using the variables in my planning level.
    2. I entered the variables in the parameter group New Values area for the From and To Values.
    3. My goal is when the user executes the Repost Function for a Variable Prompt should appear and have the user select the From Business Unit and To Business Unit.
    The Variables are set up as USERVALUE User-Defined Values, Restriction of Values required by user and I have tried with/without option of Input Allowed by User. 
    Can you tell me what I am doing wrong, I expected a variable prompt when executing the Repost Function but it does not work.
    Thank you,
    Teri

    Ravi, Thank you for your reply however I contiue to have errors or the execution does not repost (change any value) as noted below.
    1. I have 2 Variables in Planning area var1 (from) var2 (to) for the same charateristic which is Business Unit
    2. Business Unit is in the level,  on the selection tab to add the variable I can only add 1 variable, So I added var1 (from) to the level. 
    3. Parameter group for old and new values - I have Var1 (from), var2 (to)
    4. Report Function - are you referring to Reporting variables in BPS? I have set this up as suggested in the "How to Use Reporting Variable in BW-BPS" document.
    5. Enter plan data: I receive prompt for VAR1, mandatory. At this point there is no value in Var2.
    6. Execute Repost function - I receive an error to "Restrict Var2"
    7. If I set variable values and add a value for Var2 I receive an error "The generated data is not contained in the selection condition".
    Next I removed VAR1 from my planning level and turned on the option 'Selection in package' for Business Unit. This seems to work well.
    What do you recommend?
    Thank you,
    Teri

  • Security filter with variable does not work correctly

    Helo,
    I have one table with this columns (called BI_USERS):
    USERBI | REGIONS
    XXXX 10,5 -> In this case the user XXX can access the region 10 and 5
    AAA 9,7
    I use this table to apply the security filters. Fisrt I did a initialization block with the select: SELECT USERBI, REGIONS FROM BI_USERS WHERE USER = :USER
    This select populate two variables: variable USER (system variable) and UserRegion (Non-system variable)
    After I use the UserRegion variable in the securty filter of the one group of users. For exemple:
    Name | Status | Business Model Filter
    "Claro"."Historico Saldo Pre-Pago" Enabled "Claro"."Historico Saldo Pre-Pago"."DW_UN_NEG" In(VALUEOF(NQ_SESSION.*UserRegional)* )
    But the issue is that the query is not working, because the query created for BIServer no use the IN operator. Seems the IN operator is changed for equal (=).
    And the query returs error because the value 10,5 (for example) is not a numeric value.
    Anybody could help me, please? I am using the version 10.1.3
    Mauricio

    |||\/||| wrote:
    Helo,
    I have one table with this columns (called BI_USERS):
    USERBI | REGIONS
    XXXX 10,5 -> In this case the user XXX can access the region 10 and 5
    AAA 9,7
    I use this table to apply the security filters. Fisrt I did a initialization block with the select: SELECT USERBI, REGIONS FROM BI_USERS WHERE USER = :USER
    This select populate two variables: variable USER (system variable) and UserRegion (Non-system variable)
    After I use the UserRegion variable in the securty filter of the one group of users. For exemple:
    Name | Status | Business Model Filter
    "Claro"."Historico Saldo Pre-Pago" Enabled "Claro"."Historico Saldo Pre-Pago"."DW_UN_NEG" In(VALUEOF(NQ_SESSION.*UserRegional)* )
    But the issue is that the query is not working, because the query created for BIServer no use the IN operator. Seems the IN operator is changed for equal (=).
    And the query returs error because the value 10,5 (for example) is not a numeric value.
    Anybody could help me, please? I am using the version 10.1.3
    MauricioHi Mauricio,
    First of all you have some syntax errors with your init block:
    select USERBI, REGIONS from BI_USERS WHERE upper(USER)=upper(':USER');
    Couple things to consider here:
    1) Why are you selecting Userbi column from the table? Is USER system session variable not getting populated through other souces like LDAP or default security?
    Ans: If your user session variable is getting populated from a different init block, then you dont need to select that column. Then your init block would look something like this:
    select 'USERREGIONAL', REGIONS from BI_USERS WHERE upper(USER)=upper(':USER'); - Data Source
    Row Wise Initialization - Data Target
    Initblock that is populating the user session variable as the order of precedence.
    2) If you dont have USER session variable populating from any other source, then your init block would look something like below:
    select 'USER', USERBI, "USERREGIONAL', REGIONS from BI_USERS; - Data source
    Row Wise Initialization - Data target
    After following one of the above two steps, you need to apply the filters on the table.
    "Claro"."Historico Saldo Pre-Pago"."DW_UN_NEG" IN(VALUEOF(NQ_SESSION.USERREGIONAL))
    Note: Make sure you understand that variables are case sensitive.
    Please award points as this is correct answer.
    Thanks,
    -Amith.
    Edited by: Amith on May 10, 2011 3:18 PM

Maybe you are looking for

  • How can i make a vertical line in Application Toolbar when creat GUI STATUS

    I see some standard UI have a separator vertical line in the  GUI STATUS--Application Toolbar? Could you tell me how can i creat it in my customer  GUI STATUS? TKS a million~~

  • RoboHelp for Word vs for HTML

    Hi there, I am currently evaluating RoboHelp 7 and am wondering what the advantage may be to using the HTML editon over the Word edition. We currently use RoboHelp x5 for Word, but that doesn't necessarily mean I have to stay with it. Part of me want

  • Check addon update not working

    Using v.22, when I click "check if plugins up to date" in the add-ons manager I get sent to a Mozilla info page and not the usual page that listed my plugins and their status. Why is "check plugins" not working and/or how can I otherwise check and up

  • When will Alpha conversion happen

    Hi Gurus, When will Alpha conversion take place if Infoobject has ALPHA as convers routine. After loading to Infoobject right? Not in PSA. Thanks Gurus.

  • File won't open - HELP

    Hi All, I was using a file in Captivate 7 and it was saved with a timestamp of 3.41pm. Captivate crashed so I did CTRL + ALT + DEL and closed captivate and reopened it however I got the following error (view attached), I also reset the computer and t