Setting and retrieving a browser cookie using a pl/sql procedure
I want to set a cookie on the client browser and then later retrieve its value. I want to do both the operations using a pl/sql procedure. All this is going top be done from within the Portal 9.0.2 context. could you please give me any pointers
Take a look at 'owa_cookie' Package
Cheers
Similar Messages
-
How to set cookie value in one page and retrieve in another page using setA
How to set cookie value in one page and retrieve in another page using setActionListener?
I have tried with following code srcpage.jspx->destpage.jspx
srcpage.jspx
<af:table value="#{bindings.DepartmentsView1.collectionModel}"
var="emp" rows="#{bindings.EMPView1.rangeSize}"
first="#{bindings.EMPView1.rangeStart}"
emptyText="#{bindings.DepartmentsView1.viewable ? 'No rows yet.' : 'Access Denied.'}">
<af:column sortProperty="EmployeeName" sortable="false"
headerText="Cookie Testing">
<af:commandLink text="#{emp.EmployeeName}" action="success">
<af:setActionListener from="#{emp.EmployeeName}"
to="#{cookie}"/>
</af:commandLink>
</af:column>
</af:table>
espage.jspx
<af:outputText value="Test Cookie Value: #{cookie}"/>
,Here Test Cookie Value prints the following instead of its original String value
{JSESSIONID=javax.servlet.http.Cookie@7da288, oracle.uix=javax.servlet.http.Cookie@399f62}
I have passed employee name "Robert" to cookie in srcpage.jspx,but it prints "JSESSIONID....." instead of "Robert" in destpage.jspx
Thanks in advance
KaleeHi,
"cookie" is a reserved name. If you want to write to a session scope attribute called "cookie" then you have to call #{sessionScope.cookie}. If you want to use EL to set and read from cookies then you will have to use
#{cookie.cookieName}
Note that #{cookie} writes to and returns a map
check this: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
Frank -
"Setting and Retrieving Cookies" DreamWeaver 8
I am training from the book, "MacroMedia DreamWeaver 8,
Training from the Source." I am unable to get retrieve the cookies
set on my hard drive by the code I used in Chapter 4, Setting and
Retrieving Cookies. I have checked my code against the completed
code in the book and they appear to me to be identical. The cookies
are being transferred to my hard drive by by the variables set in
the code, but the code fails to retrieve the cookies from the hard
drive as expected on the linked page. Since I eventually want to
develop an interactive commerical web site, I need to solve this
problem now. Any help is certainly appreciated. Below, I am listing
the code that I am using for each of the three dynamic pages.
Test Form:
Information is entered on this form and passed to test form
processor (This works well.)
Code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="frm_name" name="frm_name" method="get"
action="test_form_processor.php">
<label>First Name
<input name="firstName" type="text" id="firstName" />
</label>
<p>
<label>Last Name
<input name="lastName" type="text" id="lastName" />
</label>
</p>
<p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
</body>
</html>
[/Code]
Test Form Processor:
The first name and last name from page one transfer to the
variables on this page, no problem.
[Code]
<?php
setcookie('firstName', $_Get['firstName'], time() +
(60*60*24));
setcookie('lastName', $_Get['lastName'], time() +
(60*60*24));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<p>Thank you, <?php echo $_GET['firstName']; ?>
<?php echo $_GET['lastName']; ?> , for filling out my
form.</p>
<p>Check <a
href="test_form_processor_cookies.php">cookie</a>.
</p>
</body>
</html>
]/Code]
Test form processor cookies:
The cookies sre transferred to my hard drive, I checked by
looking in the browser cache. the problem is that the cookies are
not retrieved by this page. When I click on the link to this page,
"I get Hi, !." Why won't the code echo the variables that the
cookies are holding? The code is below.
[Code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
Hi, <?php echo $_COOKIE['firstName']; ?> <?php echo
$_COOKIE['lastName']; ?> !</body>
</html>
[/Code]
All the bindings are set, the cookies are placed on the hard
drive, but for some reason the link page does not retrieve the
cookies and print them to the screen as expected. I use Firefox and
IE7. I set both to accept totally cookies, still I cannot retrieve
the cookie set by this small application from my hard drive, when I
run the pages. Any help and are ideas are appreciatted.The problem is in the Set Cookie header on page two. It
should be $_GET and not $_get. Dreamweaver uses lower case with the
get method. The correct $_GET is displayed in blue letters in upper
case, instead of black letters and lower case. This is a very
subtle difference, as PHP uses the get method in lower case. -
Setting and retrieving session using pl/sql
How to set and retrieve session using pl/sql?Can anyone help me?
mrs wrote:
create or replace
function get_login_details(in_user in VARCHAR2,in_pwd in VARCHAR2,in_cname in VARCHAR2)
..snipped..The code should look as follows:
create or replace function AuthenticateUser( userName varchar2, userPassw varchar2, userGroup varchar2 )
return integer is
i integer;
begin
--// purpose of the SQL is simply to check if such a row exist -
--// no data from the row needs to be fetched
select 1 into i from acl_users_gv
where user_name = userName
and password = userPassw
and entity_group_name = userGroup;
--// if the SQL succeeded, then the row exists and matches
--// the authentication details
return( 0 );
exception when NO_DATA_FOUND then
--// SQL failed to find a row - authentication details do
--// not exist
return( 1 );
end;No need to fetch data unnecessarily. No need too check the fetched data when the column values are already checked via the SQL filter condition (predicate).
No need to return a flag variable as a freely formatted text string containing Successful Login and login failed. That is not a robust design to use a string variable like that. Use boolean for true/false. Or use integer values 0/1.
This is my function get_login_details.And I need to get this 'o_mesg' in other java file also.Standard PL/SQL call from Java. The SQL string to execute contains an anonymous PL/SQL and needs to use bind variables. E.g.
begin
:result := AuthenticateUse( :userName, :userPassw, :userGroup );
end;
Can you suggest the right way, how I can get this variable in other pages?That depends on whether there is database session state. If there is, authentication can be done once only via a trusted context, that specifies whether the session is authenticated.
If this is done from an app server that uses a db session pool and stateless db sessions, the state needs to be kept in the app server.
Do you understand what stateful versus stateless db sessions are, and what the differences are? -
OBIEE 11g and SSO with Browser Cookie
In OBIEE 10g we were able to configure the Presentation Server to accept a browser cookie. The cookie value would be passed to the BI Server as the :USER variable. A BI Server Repository Initialization Block would execute a SQL SELECT statement which would return the PeopleSoft username based on the cookie value.
We added the following to the 10g instanceconfig.xml:
<CredentialStore>
<CredentialStorage type="file" path="D:\oracle\OBIEE_UD\Data\web\config\credentialstore.xml" passphrase="another_secret" />
</CredentialStore>
<Auth>
<SSO enabled="true">
<ParamList>
<Param name="IMPERSONATE" source="cookie" nameInSource="PS_TOKEN"/>
</ParamList>
</SSO>
</Auth>
The Initialization Block SQL is:
SELECT mGetTokenUserid(':USER') FROM DUAL
mGetTokenUserid is a PL/SQL function which invokes a PeopleSoft web service. The web service simply returns the username for a valid PS_TOKEN cookie.
The Initialization Block works fine in OBIEE 11g.
Unfortunately the instanceconfig.xml settings from 10g do not work in 11g. There is also nothing in the OBIEE 11g documentation which discusses how to tell the system to use a specific cookie value for authentication.
Any guidance as to where in the Fusion Middleware or WebLogic security documentation we might find details on how to get the system to pass the PS_TOKEN cookie to the BI Server in 11g?
Thanks,
Mark Johnson
State of MinnesotaNot a full answer but....
, WebLogic can accept third party tokens as defined here:
http://download.oracle.com/docs/cd/E14571_01/web.1111/e13718/ia.htm#DEVSP258 -
Store and retrieve image in database using WD Java
Hi All,
I have to store and retrieve an image in oracle database. I have gone through the below blog and forum...
How to display an image, which is stored in a database?
The specified item was not found.
I am able to store image in byte format(oracle data type BLOB) and when i try to retrieve it i am not getting the image....Sorry for my poor technical knowledge.
can some body help me, please......
Regards,
G.Hi,
my code is working... I am able to upload and retrieve the image. But now I am getting the below exception...
Exception from image insert>> java.sql.SQLException: Data size bigger than max size for this type: 6770
Below is the code I am uing...
ConnectDataBase condb=new ConnectDataBase();
IWDMessageManager mgnr=wdComponentAPI.getMessageManager();
IPrivateDBImageView.IVn_FileElement fileelement =
wdContext.nodeVn_File().getVn_FileElementAt(0);
IWDResource resource=wdContext.currentContextElement().getResource();
InputStream in=resource.read(false);
ByteArrayOutputStream bOut=new ByteArrayOutputStream();
int lenght=0;
byte part[]=new byte [ 50000 ];
while((lenght=in.read(part))!=-1)
bOut.write(part,0,lenght);
Statement stmnt=null;
Connection con=null;
String strQuery=null;
String strProp_Details=null;
try {
con=condb.getConnection (mgnr);
stmnt=con.createStatement();
PreparedStatement pst=con.prepareStatement("insert into VMS_Image values(?,?,?)");
pst.setInt(1,4);
pst.setString(2,"srinu1234");
pst.setBytes(3,bOut.toByteArray());
pst.execute();
bOut.close();
in.close();
mgnr.reportSuccess("Inserted");
catch (SQLException e) {
mgnr.reportException("SQLException from image insert>>"+e,false);
catch(Exception e)
mgnr.reportException("Exception from image insert>>"+e,false);
finally
try
if(stmnt!=null)
stmnt.close();
stmnt=null;
if(con!=null)
con.close();
con=null;
catch(Exception e)
mgnr.reportException("Exception in Closing from image insert>>"+e,false);
first I used byte of 101024, then 501024 and finally tried with byte of 50000. I am getting the above exception if the image size is more than 4kb....
Regards,
Srinivas.
Edited by: srinivas sistu on Aug 1, 2008 2:26 PM
Edited by: srinivas sistu on Aug 1, 2008 2:34 PM -
XDK APIs (C/C++/Java) and tools can also be used with MS SQL Server
I want to know if XDK APIs (Java or C/C++ APIs especially) and tools can be used with MS SQL Server or not?
I want to write a simple application that updates XML ( acordXML used for insurance) document into SQL Server tables. Of course I am assuming to transform into appropriate XSU APIs format.No. Use SQLXML instead on a SQL Server.
-
Deploy warnings using a PL/SQL procedure (from a Public Transform Package)
OWB Version: 10.2
I am receiving the following warnings when I attempt to deploy a map that contains a reference to a custom pl/sql procedure that is setup in a public transformation package:
Warning
ORA-06550: line 115, column 32:
PLS-00112: end-of-line in quoted identifier
ORA-06550: line 115, column 9:
PLS-00103: Encountered the symbol "." when expecting one of the following:
:= . ( @ % ; not null range default character
I reviewed the OWB generated code and I discovered the OWB is a adding two double quotes in front of any reference to the package name. For example.....
BEGIN
COMMIT;
sql_stmt := 'ALTER SESSION DISABLE PARALLEL DML';
EXECUTE IMMEDIATE sql_stmt;
IF NOT ""ZZTEST"."INIT_SF_USER_CLAS_St" THEN
* note the "" in front of ZZTEST, which is the package name.
Has anyone else encountered this issue? I can manually correct the generated the code, but it would be overridden every the time the map is deployed. I encounter the same issue if I import a custom pl/sql procedure from the database into OWB using the Metadata Import Wizard and use the imported procedure in a map. However, I can setup an standalone procedure or function as a public transformation and the map deploys successfully. Please advise.
Regards,
MattYou have to create a job to start your procedure.
Example :
* http://psoug.org/reference/OLD/dbms_job.html
Then create a procedure to start your job, call it from your dashboard and you're done.
Success
Nico -
How to read a spread sheet ( .xls ) file using a pl/sql procedure or func
Hello All,
Is it possible to read a spread sheet using Oracle pl.sql .
I know their is a util package that is read a file but how to read a spread sheet ... ?
thanks
kumarhi kumar,
Here is an example of how i read an excel file
DECLARE
l_start_file_name varchar2(50) := 'invoice_excel_c';
l_end_file_name varchar2(50) := '.csv';
l_file_name varchar2(100);
l_sql varchar(32767);
refresh_cdc varchar2(5) := '00304';
begin
l_file_name := l_start_file_name||REFRESH_CDC||l_end_file_name;
l_sql :=
'create table exter_invoice_excel '||
'( '||
'Product_name varchar2(255), '||
'Net_Sales Number, '||
'Net_Adjustments Number, '||
'Cancels_Count Number, '||
'Cancels_Amount Number, '||
'Cashes_Count Number, '||
'Cashes_Amount Number, '||
'Claims_Count Number, '||
'Claims_Amount Number, '||
'Returns_Count Number, '||
'Returns_Amount Number, '||
'Free_Prize_Count Number, '||
'Free_Prize_Amount Number, '||
'Free_Promo_Count Number, '||
'Free_Promo_Amount Number, '||
'Promo_Credit_Count Number, '||
'Promo_Credit_Amount Number, '||
'Return_Commission Number, '||
'Net_Discounts Number, '||
'Total_Fees Number, '||
'Sales_Commission Number, '||
'Cash_Commission Number, '||
'Tkt_Charge Number, '||
'Subscription_Commission Number, '||
'Interim_Sweeps Number, '||
'Net_Due Number, '||
'Retailer_id Number, '||
'Retailer_Name varchar2(255) '||
') '||
'ORGANIZATION EXTERNAL ( '||
' TYPE oracle_loader '||
' DEFAULT DIRECTORY GTECHFILES '||
' ACCESS PARAMETERS ( '||
' RECORDS DELIMITED BY NEWLINE '||
' CHARACTERSET WE8MSWIN1252 '||
' BADFILE ''invoice_excel.bad'' '||
' DISCARDFILE ''invoice_excel.dis'' '||
' LOGFILE ''invoice_excel.log'' '||
' FIELDS TERMINATED BY '','' RTRIM '||
' MISSING FIELD VALUES ARE NULL '||
' ) '||
' LOCATION ('''||l_file_name||''') '||
' ) '||
'PARALLEL '||
'REJECT LIMIT UNLIMITED ';
execute immediate l_sql;
l_sql:= 'INSERT INTO INVOICE_EXCEL_TEMP '||
' ( Product_name , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' SOURCE , '||
' INSERTED_DATE , '||
' CDC , '||
' UPLOADED '||
') '||
' select '||
' ltrim(rtrim(product_name)) , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' '''||l_file_name ||''', '||
' sysdate , '||
' '''|| REFRESH_CDC ||''', '||
'''N''' ||
'FROM '||
'exter_invoice_excel '||
'WHERE retailer_id is not null and ltrim(rtrim(product_name)) in (''Loto'',''Inst Tk'')';
execute immediate l_sql;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
exception
when others then
rollback;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
debug_message('INVOICE_EXCEL_UPLOAD/'||REFRESH_CDC,'Unexpected Error '||sqlerrm);
END;
--truncate table invoice_excel_tempjust go through the code, it would help u for sure
cheers -
How to re-use a PL/SQL procedure on 2 different logical schemas
Hi all,
I need to run the same Oracle PL/SQL procedure on 2 databases (source/target).
How can I re-use the code without having to duplicate the codeof the procedure because as it is a Oracle procedure, I need to declare the logical schema ?
==> does the procedure need to be re-written in Jython ?
Thanks to your all .
Nb my procedure code :
CREATE TABLE COUNT_ROWS AS SELECT TABLE_NAME , NUM_ROWS FROM DBA_TABLES WHERE OWNER_NAME = 'SYSADM'
Edited by: Meapri on Mar 18, 2011 3:37 AMThe only problem is when writing an ODI procedure using the Oracle Technology in ODI Designer, ODI asks for the Schema.
If I do not assign a value to the schema field when I run my ODI procedure I get the error message :
java.lang.Exception: Internal error: object ConnectConnection
ColConnectId:null
ColContextCode:CTX_SRC
ColConName:null
ColIndCommit:null
ColIsolLevel:null
ColLschemaName:null
ColPlanComp:null
ColTechIntName:null
DefConnectId:null
DefContextCode:CTX_SRC
DefConName:null
DefIndCommit:null
DefIsolLevel:null
DefLschemaName:null
DefPlanComp:null
DefTechIntName:ORACLE
ExeChannel:J
IndErr:0
IndLogMethod:null
IndLogNb:null
LogLevDet:3
Nno:1
OrdTrt:0
ScenTaskNo:1
SessNo:4152001
TaskName1:Traitement
TaskName2:CNT_SRC_ALL
TaskName3:DROP COUNT_ROWS -
How to Store and Retrieve values in cookie
Hi am having two List boxes in a jsp page.. By default i will give set of values to one List box and then i will move some value from one list box to another list box.. Now my requirement is i have to store these two list box values into cookie.. If i come back the page again it shoud show the previous values in list boxes.. If any one knows this please guide me..
ThanksWhy do you need to use cookies in your case? A session attribute would be more reliable.
-
How to set and retrieve the http headers
I am adding one custom header "edmsversion" in my first page, it is visible in it but when the response is redirected to another jsp, my header is lost. In second page, it's not getting. I have copied my code below. Please help me.
My first Page
System.out.println("Jsp called successfully");
response.addHeader("edmsversion","1.2");
boolean isheader = response.containsHeader("edmsversion");
System.out.println("contains edmsversion header ..."+isheader);
response.sendRedirect("/TestHeaderResponse.jsp");
TestHeaderResponse.jsp
System.out.println("Test header response page called successfully");
String stringversion = request.getHeader("edmsversion");
out.println("edms version header : "+stringversion);
Enumeration headernames = request.getHeaderNames();
System.out.println("Headers---------");
while (headernames.hasMoreElements()){
String headername = (String)headernames.nextElement();
String headervalue = request.getHeader(headername);
System.out.println(headername+"----"+headervalue);
out.println("over");You are setting a response header, then telling the browser to make a new request to a different page. All headers sent from "My First Page" are discarded and only the new response headers from "TestHeaderResponse.jsp" are available to the browser.
Try using
getServletContext().getRequestDispatcher("/TestHeaderResponse.jsp").include();That should work I would think. You cannot use the forward() method of the requestDispatcher because you cannot have sent any output from the calling servlet when using forward(). If forwarding from a jsp, all data in the output buffer is cleared before the forward takes place I believe, so you would get the same problem. Hope that helps. -
tried to upgrade my iPhone 3GS to a higher iOS but unfortunately it had reset factory setting... now i can't use my phone anymore... tried also to connect to iTunes as instructed but only appears: WE ARE SORRY, WE CANNOT CONTINUE YOUR ACTIVATION AT THIS TIME... WHAT SHOULD I DO? THANK YOU...
No, you do not need to nor should you jailbreak your iPhone.
If you jailbreak your iPhone, you void any remaining warranty and lose
all support from Apple including this forum.
4 possible causes to activation server unavailable message:
1] activation server is actually unavailable. Happens very rarely and
does not last long on those rare occasions. Solution is to try again.
2] your firewall/internet security software/antivirus are preventing connection
to the activation server. Solution is to temporarily turn off your firewall/internet
security software/antivirun until you have activated your iPhone.
3] your iPhone has been jailbroken or otherwise hacked/modified.
4] the computer you are using to activate the iPhone has been used to
jailbreak an iOS device.
For causes 3] & 4] you are on your own as Terms of Use for this forum prohibit
discussion of jailbroken/modified iOS devices. Google may provide some direction.
Be advised that jailbreaking/hacking your iPhone may prevent the iPhone from
being able to be activated. -
in safari yahoo mail i get a message please turn Private Browsing off by going to safari and private browsing and turn it off. there is no selection called Private Browsing
It's on the Safari Screen.
http://i1224.photobucket.com/albums/ee374/Diavonex/8eb4f554e7099a905efc53fef5bab 277_zpsa317fe00.jpg -
Call FND_REQUEST_SET.FNDRSSUB using a pl/sql procedure
Hi,
I am new to Oracle Apps.
I want to submit a report set.The procedure to do it is FND_REQUEST_SET.FNDRSSUB.Can you pl tell me how can i call this package using pl/sql?
RegardsHi,
If you want to submit a request set programatically, try using fnd_submit.set_request_set. You should also use fnd_submit.submit_program to define the parameters for each of the programs in the request set. You can find information about package FND_SUBMIT in the Oracle Applications Developer's Guide.
Hope it helps.
Maybe you are looking for
-
Drag and drop is seriously broken in iTunes an has made managing songs an exercise in futility.
-
Problem in using WS_DELIVERY_UPDATE(updating the deliveries)
Hi Gurus, Iam facing problem i updating the deliveries using the fm WS_DELIVERY_UPDATE..This is the code.. MOVE : lwa_mchb-matnr TO lwa_vbpok-matnr, lwa_mchb-charg TO lwa_vbpok-charg, lwa_mchb-lgort TO lwa
-
CUA Roles residing in Child system are not showing in Central System
I just hooked up CUA today and have linked 8 child systems to the central system. The 8 child system users and roles have already been established in the child systems. Do I need to run program susr_zbv_get_receiver_profiles in each of the child sy
-
Cube Processing approach when Process only the Current Partition?
Could you validate my SSAS Processing strategy for the given scenarios:<o:p></o:p> Background about cube and data:<o:p></o:p> A Sales cube has Partitions for each year for "Sales" Measure Group and it associated with dimensions "Product" and "Sales R
-
At time I go to Google or click on a link that sends me to Google but except for the word Google everything is in some other language, such as, Ελληνικά, Διαφήμιση.