How to use 'alter session...' in apex
Hello everyone, in my APEX program, I need to alter the parameter nls_date_language with 'alter session set nls_date_language = american'.
I execute the statement in SQL Commands of APEX, but it doesn't seem it works. how can I change the parameter--nls_date_language in APEX?
Any answer is appreciated.
Hi,
This might help
http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/bldr.htm#BABGGAJE
>
Application Date Format
Determines the date format to be used in the application.
This date format is used to alter the NLS_DATE_FORMAT database session setting before showing or submitting any page in the application. This value can be a literal string containing a valid Oracle date format mask or an item reference using substitution syntax. If no value is specified, the default date format is derived from the database session at runtime.
>
Br,Jari
Similar Messages
-
How to clear a session in apex ?
Hi,
How to clear a session in apex other than using clear cache option?
Thanks,
Anoo.Anoo,
check the APEX_UTIL Package, there you'll find functions like clear_page_cache, clear_user_cache, clear_app_cache.
This could be what you are looking for.
brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
Work: http://www.click-click.at -
Using ALTER SESSION inside a stored procedure.... not a good idea?
Hi,
I have two stored procedures, both of which are used to query a database to find a particular book, based on ISBN. One sproc searches our main product catalogue and the other searches our suppliers feed catalogues. The stored procedures are called from a C# application via a search tool and the user is able to search on either our catalogue or our suppliers. The appropriate procedure is called based on the users choices.
However, the following behaviour is observed
I search for an ISBN (is a varchar2 field, as isbn's may contain an X if the checksum digit equates to 10) on a feed, so uses the FEED SPROC. The book is found and returned to the app in about 0.5 seconds. I can repeat this as often as i like on different books etc. always works fine.
I then do the same search but against our own catalogue, so uses our CATALOGUE SPROC. Again the book is found quickly, and the search can be repeated with the same results.
If i then go back and run our FEED SPROC then the search time increases to about 3 minutes !
Both the feed and our catalogue is in the same database, although different schema's the connections will be pooled through our app server.
I can repliacte this every single time. I think i have narrowed doen the cause of this behaviour to a few lines of code in our CATALOGUE SPROC:
-- store values
select value into v_vch_NLS_COMP from nls_session_parameters nsp where nsp.parameter = 'NLS_COMP';
select value into v_vch_NLS_SORT from nls_session_parameters nsp where nsp.parameter = 'NLS_SORT';
-- Ensure case insensitivity throughout
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = LINGUISTIC';
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = BINARY_CI';
do other stuff
-- restore session variables
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = ' || v_vch_NLS_COMP;
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = ' || v_vch_NLS_SORT;
If i remove this code then all is well, so i am assuming that using ALTER SESSION inside a stored procedure is the cause of the problem as it would be changing the execution plan of the FEEDS SPROC in some manner? Any ideas? I know i can just rewrite the sproc to avoid using this coding, but wanted to understand if i am doing something wrong by using ALTER SESSION in this manner?
Any pointers would be appreciated.
John Thompson
Software Architect,
play.com
Edited by: user7186902 on 27-May-2009 03:51Hello (and welcome),
It may be a case of having to create a linguistic index to facilitate the queries once you set these session level parameters, i.e..,
CREATE INDEX idx_01 ON tab ((NLSSORT(col1, 'NLS_SORT=BINARY_CI'))It would appear that the setting of those parameters is invalidating index searching on the current indexes. -
How to use a session, created in a jsp page, in a php page
Hello, forgive me for the newbie question.
Here is my problem:
I want to have a jsp page create a session, set some session variables and then redirect to a php page which will access those same session variables.
I have the redirection worked out, but I can't seem to find out how to use the jsp session in my php script.
Is this possible at all, and if so, how does it work?Note that javascript runs on the client side, and JSP runs on the server. JSP and the session objects are NOT available to javascript in reaction to the user.
If this function is called only when the page is first created, not when the user interacts with the page, or if you want that value to be constant with respect to the javascript, then you can do this:
<%
String someValue = (String)session.getAttribute("theAttributeName");
%>
<script type="text/javascript">
Calendar.setup({inputField:"f_date_dfFirstPmtDate",
button:"f_trigger_dfFirstPmtDate",
singleClick:true,
ifFormat:<%=someVale%>});
</script> -
How to use a session bean in another session bean (or an EJB in a session)
JDev 11.1.1.4, WLS 10.3.4, Windows 7 x64
I have a login controller with a session-scoped bean that manages logins.
I have another session-scoped bean that manages menu security.
both modules compile and work fine now I need to share the data from one to another.
I need to reference the login controller in the menu security bean. How do I reference (include) the login bean in the security bean?
I tried an EJB - what a farce - these are supposed to be universal and easy ( basis of the oop in Java).
the bean is defined:
@Stateless(name = "SecurityEJB", mappedName = "ZITASApplication-ZITASModel-SecurityEJB")
I have tried :
ic = new InitialContext();
session = (SecurityEJBLocal)ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJB");
session = (SecurityEJBLocal)ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJBLocal");
session = (SecurityEJBLocal)ic.lookup("java:ejb/model.security.logic.SecurityEJB");
session = (SecurityEJBLocal)ic.lookup("java:ejb/SecurityEJB");
session = (SecurityEJBLocal)ic.lookup("java:app/SecurityEJB");
session = (SecurityEJBLocal)ic.lookup("java:module/SecurityEJB");
All return null pointers and claim the name cannot be resolved.
As you can see - I have found various claims to how to do this.
One way says create a sevlet, generate a listener and use the sevlet. Basically one for every EJB - a lot of work to use the EJBs
I would assume that this would be one of the easiest parts of java - as it is the foundation of re-usability and oop.
I can do either in the application - the added complexity of the EJB is less desirable - but better programming?Hi,
ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJB");This should work with remote interface. If you want to lookup local interface, you need to register it in web.xml. Quote:
To access the business local interface you need to define ejb local references for your component environment (i.e. from your servlet environment). You can do this by defining references in your web.xml. For example:
<ejb-local-ref>
<ejb-ref-name>ejb/BusinessLogicBean</ejb-ref-name>
<local>packagename.BusinessLogicBean</local>
</ejb-local-ref>
To lookup your local reference from your servlet you need to use the following JNDI reference:
java:comp/env/ejb/BusinessLogicBean Another one
First, declare a local ejb reference in your web.xml file (This will add it to JNDI):
<ejb-local-ref>
<ejb-ref-name>ejb/Foo</ejb-ref-name>
<local>simple.ejb.FooLocal</local>
</ejb-local-ref>
Then it can be looked up from JNDI:
InitialContext ctx = new InitialContext();
FooLocal foo = ctx.lookup("java:comp/env/ejb/Foo");Hope this helps.
Pedja
Helpful links (judging from your first post, you are probably sick of these :) )
How to lookup local EJB in Oracle Weblogic 10.3
http://m-button.blogspot.com/2008/07/reminder-on-how-to-use-ejb3-with.html
http://www.coderanch.com/t/451012/EJB-JEE/java/EJB-Local-Lookup-not-working -
How to use Oracle maps in APEX??
I am developing one application in APEX 3.2. I need to use Oracle Map for the same.
How to integrate Oracle maps with Apex ?? Can any one help me for this ?
ThanksNagesh.Patil wrote:
Hi All,
I want to use oracle workflows in my apex application.
can anybody tell me how can I get this ?
Thanks in advance..
Database version : 11g XE
Apex version : 4.0
Nagesh Patil
Oracle Workflow is only available as a component of EBS. It has never been available on, and is not certified for Oracle 11g, nor any version of XE. -
How to add alter session to report query !!
Hi all,
I need to add
alter session set "_optimizer_cost_based_transformation"=off
before select query runs in Oracle discoverer.
Recently I encountered with ORA 00600 bug and this is the way it can be solved.
Before running the query, the session should be altered.
Any ideas is appreciated..
ThanksHi,
Your best option may be to turn the cost based transformation off using a logon trigger. It will then be turned off for all Discoverer sessions. You will need to create a package procedure that executes the alter session command. Then call this procedure either from a Discoverer logon trigger, or a database trigger that checks that the session is a Discoverer session. Or if you are using the eBS you can use the Applications initialization profile.
However, an alternative approach may be to use a hint in the query. For example, you can set the optimizer features back to previous version that does not have this optimizer feature e.g. using:
/*+ optimizer_features_enable('9.2.0') */
Then put this hint in the query using a view. I am not sure that ther is a hint which will turn just this feature off.
Rod West -
Using alter session sort_area_size
hi ,
can i actually issue alter session sort_area_size = 20M ?
or i'll need to specify in bytes ?
kindly advise
tks & rdgsThis link may be helpful to you
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams202.htm -
How to use the session id provided by fuego.papi.ProcessServiceSession
Hi, I'm wondering how to reuse the session id provided by the ProcessServiceSession in the Oracle BPM 10g Process API (PAPI)...
After the processService.createSession(passport, "localhost") call, I get an ProcessServiceSession instance, wich has an getId() method, so... the question is:
Is there a way to reuse this sessionId in another call to the processServiceSession's methods?, something like: I have this sessionId "userName321321321321321", so I want to reuse it to avoid passing the username and password in another moment of the application...
Moment 1: The user does the log in step and obtains a sessionId, then, the user exits the application... (I'm not going to execute the close() of the ProcessServiceSession, so, I keep the session alive)
Moment 2: The user goes back to the application and does some other things, so, with the generated session id in moment 1, I'd like to retrieve that session (by the session id) and accept him as valid user, without ask him the password again and allow him to do PAPI stuff.
Is this doable?
Edited by: user11204803 on 09/11/2010 11:41hi
yes , you can get SQL_ID from v$session and also you can join it for v$SQL also it get another details ......
CHeers -
How to use a session variable in Conditional Format?
Hi Gurus,
I created a session variable , called Actual_date,
using the following SELECT:
SELECT SYSDATE FROM DUAL
In a report title the following expression worked fine:
@{biServer.variables['NQ_SESSION.Actual_date']}
I red in a reply in this forum, under the
"Oracle BI EE Variables Overview"
that we can use the above format in Cond.Format.
However I got an error:
"The value entered msut date and Time..."
Any tips?
Thanks
LaszloIt's because when you fired
SELECT SYSDATE FROM DUALYour variable have a LONGVARCHAR type (if I remember)
Check here how to find the data type.
http://gerardnico.com/wiki/dat/obiee/obi_server_variable_find_value
If you just need to get the current date, you can try the system presentation variable current time as :
@{system.currentTime} Good luck
Nico -
How to use a Session object in a Javascript function
I have an object that I have set in my session.
On my jsp I want to pull it out of my session and use it as a parameter for a javascript function. But I am not sure how to do that... the function call is below... I want to assign a value to ifFormat (last variable in function) But I am not sure what to use inside javascript.
<script type="text/javascript">
Calendar.setup({inputField:"f_date_dfFirstPmtDate",
button:"f_trigger_dfFirstPmtDate",
singleClick:true,
ifFormat:XXXXX});
</script>Note that javascript runs on the client side, and JSP runs on the server. JSP and the session objects are NOT available to javascript in reaction to the user.
If this function is called only when the page is first created, not when the user interacts with the page, or if you want that value to be constant with respect to the javascript, then you can do this:
<%
String someValue = (String)session.getAttribute("theAttributeName");
%>
<script type="text/javascript">
Calendar.setup({inputField:"f_date_dfFirstPmtDate",
button:"f_trigger_dfFirstPmtDate",
singleClick:true,
ifFormat:<%=someVale%>});
</script> -
How to use custom images in Apex 4.1 with EPG
I just ported over an application from Apex 3.2/10g using Apache to a new server using Apex 4.1/11g using EPG and none of my custom images work. When using Apache, all I had to do was copy the file over to the /i/Custom images folder and I could reference it on any of my pages. I copied the entire /Custom folder to the new server and that doesn't seem to do the trick. I've seen some posts that talk about having to use FTP (why?) or something to get this to work. Can someone please explain what is going on here and what I need to do to get this working?
With EPG, the images aren't accessed from a directory. They are actually stored inside the database. The FTP process actually gets redirected so that the image gets stored inside Oracle rather than being written to a file. There are numerous articles and such detailing exactly how to do this.
One is here:
http://www.apex-blog.com/oracle-apex/accessing-i-using-ftp-170.html -
How to use Oracle Workflow in Apex
Hi All,
I want to use oracle workflows in my apex application.
can anybody tell me how can I get this ?
Thanks in advance..
Database version : 11g XE
Apex version : 4.0
Nagesh PatilNagesh.Patil wrote:
Hi All,
I want to use oracle workflows in my apex application.
can anybody tell me how can I get this ?
Thanks in advance..
Database version : 11g XE
Apex version : 4.0
Nagesh Patil
Oracle Workflow is only available as a component of EBS. It has never been available on, and is not certified for Oracle 11g, nor any version of XE. -
How to use global session in ADF
Hi all,
My problem is that I have several sessions that connect to a table in an ADF application. If I update some data in one session and commit, the other sessions do not see it until they requery the data because they are using their own local sessions and caches. I want the changes to be seen by all the sessions. Is there something like a global session in ADF?
Thanks in advance,
S/\EE|)Hi,
From the documentation
"For example, say you have a page that lists all products, and a user can navigate from that page to another page to create a product. A button on this page both creates the product and navigates back to the list page. In order for the user to see the product just created, you must set the iterator binding for the product list to cacheResults=false. Doing so forces the iterator to reexecute when returning to the page and display the newly created product."
Frank -
How to use Jasper Reports in Apex to print PDF
I new and would like a know how as to use jasper reports to print PDF's
Thanks for the appreciation :).
If you have any new feature requests, just let me know: [ https://www.opal-consulting.de/forums ]
Cheers,
Dietmar.
blog: [ http://daust.blogspot.com ] JDD-Spreadsheet-Suite: [ http://jdd-software.com ]
JasperReportsIntegration: [ http://www.opal-consulting.de/tools ] [ https://www.opal-consulting.de/forums ]
Maybe you are looking for
-
I always change my password and with this particular one I somehow managed to forget it, I have gone completely blank and I can't remember it. I dont want to restore my phone because I don't want to delete my photos and my songs in itube....PLEASE HE
-
Help, Recurring Event WON'T Edit or Delete
I've read the threads about the slow iCal, or SBOD, or not responding. I've tried deleting the plists, backing up then restoring the calenders. I've made all my recurring events end at a date instead of never. I think I have the problem narrowed down
-
Separate messages 1-n using multimapping
HI Gurus! I need to create interface idoc -> MQ For each segment SEG1 I need to create new separate message. For ex. Source: <BLOARD.BLOARD.IDOC> <IDOC> <SEG1> <DATA1>01</DATA1> </SEG1> <SEG1> <DATA1>02</DATA1> </SEG1> </IDOC> Target(Must
-
Firefox constantly kicks us off of our verizon email unexpectantly and inconsistently. We have downloaded latest version of Firefox, 3.6, and the problem is still there == URL of affected sites == http://us.mg201.mail.yahoo.com/dc/launch?.partner=vz-
-
Error updating to iTunes 11.1.4
When updating iTunes to 11.1.4, I received an error that says it encountered an error installing, and to select Tools and click on download only. However when I try to open iTunes, I get the error "The program can't start because MSVCR80.dll is miss