Using session state in ORDER BY
I have a report region with a PL/SQL function body returning a query as
declare
q long;
begin
q:='select .....'
q:=q||' order by :P1_SORT1,:P1_SORT2';
end;where P1_SORT1 and P1_SORT2 have values from 1..8.
In other words, I would like to the ORDER BY to expand to ORDER BY m,n to sort by that column position in the SELECT list.
This doesn't seem to work. It seems to be getting excecuted as if it were order by '5','6' which doesn't work the same as order by 5,6Any ideas? What am I missing?
Thanks
Scott: I keep getting ORA-00936: missing expression when I try to save the Region. Currently, I am using the "Use Query-Specific Column Names and Validate Query" option. Would I need to change to use Generic columns, I hope not!
I guess I do need to change it to use generic columns, that is the only thing that works. I tried using the v('...') function as well in the ORDER BY but it ust doesn't let me save the region unless I use the Generic Columns.
Is this something Oracle specific or HTML DB specific? I mean, using bind variables in the ORDER BY clause.
Obviously, the reason I would like to use bind variables it to avoid flooding the shared pool with unique SQLs (in my real app, I have 4 sort columns, so I have 16 possible combinations of SQLs!)
Similar Messages
-
How to use session state protection
I use Apex 3.2.1
I access my site by a url passing a parameter like this : f?p=101:1:0::::ITEM1:1234567. There is no login and password to access the site.
The value of the parameter ITEM1 is the authorization of the first page, with a database function for the verification.
To secure my site I want to use session state protection so, I enabled it , then I defined "Arguments Must have checksum" for the page 1.
Now , when i try to acces my site with the same url it does not work.
it is the first time a try to use session state protection, could someone tell me what's wrong?Hi user5719906,
I would suggest that as you need to pass an item and are unable to generate a checksum as you are not yet logged in, that you will need to allow arguments without checksum for this page.
This could be a bit of a hole in your security, but as long as you know it is there and clear the cache for all pages that you branch to, you should be able work around it.
The issue is that a malicious user can set page and application items via the url to an unsecured page.
Regards
Michael -
Use session state values to set column value during insert/update
I am building an APEX 4.2 application that uses the canned Data Loading control to upload csv data to a table. I have modified the 'Select Data Source' page of the workflow and it now contains three LOV's that the user selects values from. The selected values are stored in Session State. As I'm new to APEX, I do not know how to reference Session State objects in the context of the Data Loading workflow so that the appropriate columns are set with the correct values. My assumption is that the columns that are apart of the insert statement reside in a collection somewhere. I just don't know how to loop through the collection, determine the correct column, and then set that column's value equal to the corresponding LOV value in Session State.
Scott,
This is in version 2.2.1 and there are no caching features available.
The application does require login.
I'm playing around with the APP_UNIQUE_PAGE_ID right now but I am finding that even in the builder if I edit the attributes of a report column and then try to edit another column it will bring up the last column I edited. Even if I use the record navigation buttons next to the Apply Changes button it will keep bringing me the same page over and over unless I constantly refresh the pages.
Greg -
Prepared Statement with ORDER BY
I am trying to use order by with prepared statement but it is not ordering.
String sql = "SELECT * FROM MATERIAL WHERE (LOWER(NAMEE) LIKE ('%' || ? || '%') ORDER BY ? ";
PreparedStatement ps=CM.getStatement(sql);
ps.setString(1,p);
ps.setString(2,sort);
ResultSet r = ps.executeQuery();
Can any one tell me how do I use prepared statement with order byYou can not parameterize column names and such, only literals. You should build the ORDER BY clause dynamically.
-
Configure Session State?
Is there any equivalent of the "Configure Session State" page from MOSS 2007?
ie. http://<server>:<adminport>/_admin/SessionStateAdmin.aspx
So far trying to install our webparts on SP 2010 has failed misserably. They install fine on out of the box MOSS 2007.
I've managed to get over the session state problem by hacking the web.config file but that's not particularly desirable (as it wasn't required on MOSS). Now we've come across a viewstate problem as well which I haven't yet fixed.There's a new State Service in Microsoft SharePoint Server 2010, that maintains temporary state information for IPFS.
Okay. But it doesn't seem to enable normal ASP.NET state like it did in 2007. This will probably cause lots of issues when migrating custom webparts and apps (or at least any using session state). -
Saving session state in database table rather in websever for Ordering App
Hi all,
Ours is a ordering application (telecomm) domain.
Currently, we are storing user sessions data (Order shopping cart session data) in middle tier (iPlanet web server) which inturn consumes lot of memory resources.
Shopping cart could be in MBs if order is a huge business order.
So in order to not to overtax web server (middle tier), we are thinking of storing session data directly in a database table to relieve the overhead on web server and make use of database for storage.
I read that APEX (html db) is already using this "single metadata table" approach for session data management. But we are not using HTML DB to really look into.
Can some one advise how to go about storing "user session data" directly in a "database table" for both storage and retrieval purposes instead of storing it in "webserver".
How does this "metadata table" structure looks like. Is it more generic ?
Really appreciate your time and help/suggestions.Joel,
Thanks for your response. sorry, i meant to say that "the current application does not use APEX but will look into it".
To build this is an utterly non-trivial exercise. Oh - it may not be so hard to save session state to a table when you POST a page. But you may want to reference this in many places, and it's a question of can you change all of these references to indirect references from session state in your application.In order to free up the load on webserver, we want to maintain session management in database. Could you please explain the above little more :
How do we maintain the "user session" with "database table" ?
Do we need to store "session data" at java object level or by page in database table ? How does the structure of this "metadata table" looks like.
Thanks for your time. -
When I try to open my Yahoo mail in safari, I get a message which states:" In order to use Yahoo mail, please turn Private Browsing off. Please go to Settings>Safari>Private Browsing, and turn off" The problem is, my ipad does not a Private Browsing switchat this location.
With iOS 7 on the iPad, you turn Private Browsing on and off by tapping the URL field. The screen that opens up has your bookmarks on it. In the bottom left corner is a hot button marked 'PRIVATE'. Tap on the word 'PRIVATE' to turn private browsing on or off. Yeah, there aren't any instructions anywhere that I can find to do this, and if you follow Yahoo's instructions, they don't work. This doesn't happen with the previous Apple OS, and you can restore your iPad to the older OS.
-
How to save the session states for a tabular form WITHOUT using check boxs?
Greeting guys,
As you know that we can use collections to save the session states of a tabular forms, described in the how-to doc of manual tabular forms. However, what I am trying to do ( or have to do) is to provide a manual tabular form, and save the session states for validation, without using the check boxes. Because a user can put contents into some columns in a row without checking the corresponding checkbox, according to the requirements. So basically what I tried is to loop over all the rows and save Every entry into a collection. However, sometimes I got "no data found" error with unknown reasons.
My current solution is to use the "dirty" Retry button that gets back the history, which IMO is not a good workabout. So, I'd appreciate if somebody can shed some light on a better solution, especially if it is close to the one in that how-to doc.
Thanks in advance.
LucThe following is the first collection solutin I've tried:
htmldb_collection.create_or_truncate_collection('TEMP_TABLE');
for i in 1..p_row_num loop -- Loop on the whole form rows
if (htmldb_application.g_f01(i) is not null) or (htmldb_application.g_f05(i) <> 0)
--If either of them has some input values, the row should be saved into the colleciton.
then
htmldb_collection.add_member(
p_collection_name => 'TEMP_TABLE',
p_c001 => htmldb_application.g_f01(i),
p_c002 => htmldb_application.g_f03(i),
p_c003 => htmldb_application.g_f04(i),
p_c004 => htmldb_application.g_f05(i),
p_c005 => htmldb_application.g_f06(i),
p_c006 => htmldb_application.g_f08(i)
end if;
end loop;
Some of columns have null values, but I don't think that's the reason. Because once I clicked all the check boxes, there would be no error no matter what values were in other columns.
Another issue would be extract the values FROM the collection, which has been tried because I had problem to store the data into the collection. I used "decode" functions inside the SQL to build the tabular form. I am not sure whether it will be the same as a regular SQL for a tabular form, like the example in the How-to doc.
Also I didn't use the checksum, for it is not an issue at the current stage. I am not sure whether that's the reason which caused the NO DATA FOUND error. -
Items not in session state when column link used and prevpage not submitted
I have a report on page 2 (cemetery lot info) with a column link to page 3 (burial info).
There is a process on page 3 that updates billing information using items from page 2, and billing code selected on page 3. The problem is, if the user does not submit page 2, session state is null, or has values from previously submitted page 2. How do I make sure the billing info is correctly updated from items displayed on page 2, if they are not in session state?
begin
if :P3_BILLING_CODE = 'OWN' then
:P3_BILLING_NAME := :P2_OWNER1_FIRSTNAME||' '||:P2_OWNER1_LASTNAME;
:P3_BILLING_ADDRESS1 := :P2_OWNER_ADDRESS1;
:P3_BILLING_ADDRESS2 := :P2_OWNER_ADDRESS2;
:P3_BILLING_CITY := :P2_OWNER_CITY;
:P3_BILLING_STATE := :P2_OWNER_STATE;
:P3_BILLING_ZIP := :P2_OWNER_ZIP;
:P3_BILLING_PHONE := :P2_OWNER_PHONE_AC||'-'||:P2_OWNER_PHONE_EX||'-'||:P2_OWNER_PHONE_SC;
elsif :P3_BILLING_CODE = 'MGR' then
:P3_BILLING_NAME := :P2_NEW_MANAGER;
:P3_BILLING_ADDRESS1 := :P2_NEW_MANAGER_STREET;
:P3_BILLING_ADDRESS2 := null;
:P3_BILLING_CITY := :P2_NEW_MANAGER_CITY;
:P3_BILLING_STATE := :P2_NEW_MANAGER_STATE;
:P3_BILLING_ZIP := :P2_NEW_MANAGER_ZIP;
:P3_BILLING_PHONE := :P2_MANAGER_PHONE_AC||'-'||:P2_MANAGER_PHONE_EX||'-'||:P2_MANAGER_PHONE_SC;
elsif :P3_BILLING_CODE = 'FH' then
:P3_BILLING_NAME := :P3_FUNERAL_HOME1;
:P3_BILLING_ADDRESS1 := :P3_FUNERAL_HOME_ADDRESS;
:P3_BILLING_CITY := :P3_FUNERAL_HOME_CITY;
:P3_BILLING_STATE := :P3_FUNERAL_HOME_STATE;
:P3_BILLING_ZIP := :P3_FUNERAL_HOME_ZIP;
:P3_BILLING_PHONE := :P3_FUNERAL_HOME_TELEPHONE;
end if;
update cm_burial set billing_name=:P3_BILLING_NAME, billing_address1=:P3_BILLING_ADDRESS1, billing_address2=:P3_BILLING_ADDRESS2, billing_city=:P3_BILLING_CITY, billing_state=:P3_BILLING_STATE, billing_zip=:P3_BILLING_ZIP, billing_phone=:P3_BILLING_PHONE
where recordid=:P3_RECORDID;
end;Hello,
If I understand you correctly, it seems like your page logic is a bit problematic. The scenario I see is that the user is populating the form part, submiting the page, and the report region is being displayed (as the where clause depends on an item from the form region). Now, the situation you are describing, where the billing information is not correct, is possible if the user changed some of the form items on page 2, didn't submit the page – hence didn't update the report region – but still chose to branch to the next page, using the (non-updated) report link column. If I understand it correctly, you should first correct this situation. If the user is changing some details in the form section, the page should be re-submitted. This will resolve your problem, because as part of the page submit process, session state will be set correctly.
I believe this is the simplest and correct solution. Other options, like updating session state per changed item (using JavaScript) will be much more complicated.
Regards,
Arie. -
Session State Values Only Used After a Page Refresh
We recently moved our application to use Oracle Application Server. I don't know if this is an issue but I thought it might be relevant to my question.
In this application there is report that has a link to another page. This link sets the ID of the company that the subsequent pages use to provide several summarized reports with drill downs. I'll call this the main page.
Users recently started to report that when they drill into the details and use the breadcrumbs to get back to the main page, that page will display the wrong company, one they were viewing recently.
In testing I find that when I click a link to drill down into the details the details page is not for the right company. I check session state and the value of the ID is correct. If I refresh the page I then get the correct drill down page. Some of the drill down reports will pass a page specific ID into each page and others will just reference the ID from the main page. Not sure if this is relevant since the breadcrumbs to go back to the main page would not be able to use every possible page specific ID, my understanding was that once I set the ID in session state on the main page I could rely on it.
Also if I get the wrong details page and click on the breadcrumb to the main page I get the wrong main page (it displays a previously viewed company). Again the session value is correct and a refresh of the page will bring back the right company.
Our systems admin was asked to check if we had WebCache on and she said it was not. Is there something else that could be caching the results of these pages?
Thanks,
GregScott,
This is in version 2.2.1 and there are no caching features available.
The application does require login.
I'm playing around with the APP_UNIQUE_PAGE_ID right now but I am finding that even in the builder if I edit the attributes of a report column and then try to edit another column it will bring up the last column I edited. Even if I use the record navigation buttons next to the Apply Changes button it will keep bringing me the same page over and over unless I constantly refresh the pages.
Greg -
Using prepared statements to set order by
I just wanting to confirm and see how people handle this. I have and java String sql statement that I have added an order by.
String sql = ".... order by ?"
ps = con.prepareStatement(sql);
ps.setString(1,sortBy);
This would allow me to have one sort method in my DAO and just pass in what column I want to sort by. But I can't seem to get this to work. I'm guess it has something to do with how the setString works.james, once you click on a column heading to do a user defined sort (e.g. click on column 3) you have set a 'user preference' for the sort order on that report. As long as your 'user preference' persists in the system, you will not get your default sort order back. You can click on col1, but that will only sort on column 1.<br><br>You can remove the user preference by creating a process that does session state management and selecting 'Reset Preferences (remove all preferences for current user)'....but -be carefull-, this resets all user preferences, not just for the report you are working with.<br><br>You could also have 2 report regions that are on oposit conditions (default sort vs. user sort) and not make the columns in the default sort user selectable.<br><br>"You could call APEX_UTIL.SET_PREFERENCE and set the preference value to null. The preference name would be of the form: 'FSP'|| <application_id> ||'_P' || <page_id> || '_R' || <region_id> || '_SORT' Just keep in mind that the application ID and region ID can change when you import into a different application ID." <-- credited to Joel Kallman (thanks Joel)
-
Session state can only be used when enablesessionstate is set to true.
When I try to open up a certain webpage it says; Session state can only be used when enablesessionstate is set to true. What does it mean and what should I do?
Contact the webmaster for that site and report the problem.
-
ASP Web Forms Error: Session state can only be used when enableSessionState is set to true
Hello,
I am developing a custom application page for a custom Web Forms I am creating, which I plan on using for custom task form into SharePoint 2010 Foundation.
Currently, I am trying to test it in Debug Mode using Visual Studio 2010 but when I am trying to use Sessions I get the error:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration
I've already done this on trying to fix:
On my page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestForm.aspx.cs" Inherits="TestForm" EnableSessionState="True" %>
And on my web.config
<pages enableSessionState="true">..<httpModules>
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</httpModules>
Note: I am getting an error when I try to add <module> into web.config
ASP .NET State Service is currently running.
And the part where it keeps error is when in PageLoad, I try to set a List object something like this:
List<object> myobject
get
if (Session["object"] == null)
Session["object"] = new List<object>();
return Session["object"] as List<object>;
set
Session["object"] = value;
protected void Page_Load(object sender, EventArgs e)
myobject= new List<object>();
BUT the error still persists! I also try to restart IIS but still the error still happens.
I am running out of ideas so can you help me out?
Thank you!Could be your skype intercepting your requests at 80 port, in Skype options uncheck
Or Your IE has connection checked for Proxy when there is no proxy
Or your fiddler could intercept and act as proxy, uncheck it!
Solves the above problem, It solved mine!
HydTechie
HydPhani -
Is the Clustra system used to store session state?
Is the Clustra system used to store session state? Is it accessible to
users? Do multiple shared memories or disk both ensure availability?Yes, HADB (Clustra) is used to store session state. HADB is not
directly accessible to users. HADB runs on multiple nodes and achieves
high availability by replicating data across the nodes. -
SALES ORDER UPLOAD USING SESSION
Hi,
My query:
How to upload Sales Orders data from legacy system to SAP using
session method.
Bye...Hi
How to develop a lsmw for data migration for va01 or xk01 transaction?
You can create lsmw for data migration as follows (using session method):
Example for xk01 (create vendor)
Initially there will be 20 steps but after processing 1 step it will reduced to 14 for session method.
1. TCode : LSMW.
2. Enter Project name, sub project name and object name.
Execute.
3. Maintain object attributes.
Execute
select Batch Input recording
goto->Recording overview
create
recording name.
enter transaction code.
start recording
do recording as per ur choice.
save + back.
enter recording name in lsmw screen.
save + back
Now there will be 14 steps.
2. MAINTAIN SOURCE STRUCTURES.
Here you have to enter the name of internal table.
display change
create
save + back
3. MAINTAIN SOURCE FIELDS.
display change
select structure
source_fields->copy fields.
a dialogue window will come .
select -> from data file
apply source fields
enter No. of fields
length of fields
attach file
save + back
4. MAINTAIN STRUCTURE RELATIONS
display change
save + back
5. MAINTAN FIELD MAPPING & CONVERSION RULE
display change
click on source field, select exact field from structue and enter
repeat these steps for all fields.
save+back
6. MAINTAIN FIXED VALUES, TRANSACTION, USER DEFINED
execute
save + back
7. SPECIFY FILES.
display change
click on legacy data
attah flat file
give description
select tabulatore
enter
save + back
8. ASSIGN FILE
execute
display change
save + back
9. IMPORT DATA.
execute
display change
save + back
10. DISPLAY IMPORTED DATA
enter ok, it willl show records only.
back
11. CONVERT DATA
execute
display change
save + back
12. DISPLAY CONVERTED DATA
execute
display change
save + back
13. CREATE BATCH INPUT SESSION
tick keep batch input folder
F8
back
14. RUN BATCH INPUT SESSION.
sm35 will come
Object name will be shown here
select object & process
Reward all helpfull answers
Regards
Pavan
Maybe you are looking for
-
Using a TV as a display for my MBP
Hi Folks, I am interested in a Kanex product - their Mini Display Port to HDMI adapater. It looks like, if I choose the right TV, I can connect my MBP to the telly, via the aforementioned cable, and see exactly the same display as I see on the MBP's
-
please can anybody help??!!
-
I have two mail accounts, one POP account, and MobileMe. The ToDo feature appears to be disabled on the POP account. The commands are gray on that account. However, when I choose an email from MobileMe I can select text and create a new ToDo item. I
-
Web pages are very slow to load airport is fine and other users do not have any problems
my macbook pro is very slow to load web pages airport is running fine and other users do not have any issues?
-
I am trying to locate the zfs packages in the 1/06 Solaris 10 release. Is it hidden under another name or did it not make the release?