How to call a session variable into sql?
for example, I have a coldfusion session variable - session.testvar
I am writing a Stored procedure in sql server 2000. The query within my stored procedure needs to insert a value into a table. The value needs to be my CF session variable. I have no idea how this is done, does anyone else have a hunch?
I am using coldfusion 8 and sql server 2000.
Pass it to the SP as a variable
- there are examples in the cf docs
Similar Messages
-
HOW TO CALL A PACKAGE VARIABLE INTO ODI
Hi,
Please help me with a solution for capturing a variable from a package into odi. I have seen the solution given by cezar in odiexperts.com but we are not looking for a package creation thru odi. Please suggest any other method.
Thanks
VenkatPass it to the SP as a variable
- there are examples in the cf docs -
How do I insert a session variable into a record?
I can’t figure out how to insert the value passed by a
session variable into a record.
I have a form I want to use to insert a record. I pass
session variables to this page and want to insert one of them into
the record. The session information is:
session_start();
$_SESSION['usename'] = $_POST['username'];
$idvar = $_SESSION['id'];
$_SESSION[‘id’] is the user_id that I want to
insert into the record.
I know $idvar is getting to the page with the form because I
can echo it.
The insert code looks like this:
if ((isset($_POST["MM_insert"])) &&
($_POST["MM_insert"] == "register")) {
$insertSQL = sprintf("INSERT INTO h_genres (user_id,
username, contrib_to, Advertising, Annual_Reports, Leader_Content,
Member_Content, Brochures) VALUES (%s, %s, %s, %s, %s, %s, %s,
%s)",
GetSQLValueString($_POST['user_id'], "int"),
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['contrib_to'], "text"),
GetSQLValueString(isset($_POST['Advertising']) ? "true" :
"", "defined","'Y'","'N'"),
GetSQLValueString(isset($_POST['Annual_Reports']) ? "true" :
"", "defined","'Y'","'N'"),
GetSQLValueString(isset($_POST['Leader_Content']) ? "true" :
"", "defined","'Y'","'N'"),
GetSQLValueString(isset($_POST['Member_Content']) ? "true" :
"", "defined","'Y'","'N'"),
GetSQLValueString(isset($_POST['Brochures']) ? "true" : "",
"defined","'Y'","'N'"));
mysql_select_db($database_hauw, $hauw);
$Result1 = mysql_query($insertSQL, $hauw) or
die(mysql_error());
I have a hidden field for the user_id:
<input name="user_id" type="hidden" id="user_id" />
I think I need to get the value in $idvar into user_id but I
don’t know how.
Any help is appreciated.awsweb wrote:
> I have a hidden field for the user_id:
> <input name="user_id" type="hidden" id="user_id"
/>
>
> I think I need to get the value in $idvar into user_id
but I don?t know how.
<input name="user_id" type="hidden" id="user_id"
value="<?php echo
$idvar; ?>" />
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/ -
How to pass a jsp variable into javascript??
<p><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<p><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<p><html>
<p><c:set var="binrmapi" value="http://localhost/paas-api/bingorooms.action;jsessionid=XXXXXX?userId=TEST2&sessionId=1&key=1" />
<p><c:import var="testbinrm" url="${fn:replace(binrmapi, 'XXXXXX', jsessionid)}"/>
<p><c:set var="tuples" value="${fn:split(testbinrm, '><')}" />
<p>Time until next game
<p><c:forEach var="tuple" items="${tuples}">
<p><c:if test="${fn:contains(tuple, 'row ')}">
<p> <p><code>
<p> <c:set var="values" value="${fn:split(tuple, '=\"')}" />
<p> <font color="blue">
<p> <c:out value="${values[17]}" />
<p><c:set var="remainingtime" value="${values[17]}" />
<p> </font>
<p> </code>
<p></c:if>
<p></c:forEach>
<p><form name="counter"><input type="text" size="8" name="d2"></form>
<p><script>
<p>var milisec=0
<p>var seconds=eval("document.myForm.remaining").value;
<p>function display(){
<p> if (milisec<=0){
<p> milisec=9
<p> seconds-=1
<p>}
<p>if (seconds<=-1){
<p> milisec=0
<p> seconds+=1
<p> }
<br>else
<p> milisec-=1
<p> document.counter.d2.value=seconds+"."+milisec
setTimeout("display()",100)
<p>}
<p>display()
<p></script>
<p></body>
<p></html>
<p>This is my code that i was working on, in the jsp part of the script, i get a api call and save a value of time in the variable remainingtime.. and in the javascript, i try to have a countdown clock counting down the remaining time.. but i guess it doesnt work.. how can i get that working? thanks alot
Message was edited by:
hamham3001
Message was edited by:
hamham3001
Message was edited by:
hamham3001
Message was edited by:
hamham3001Re: How to pass a jsp variable into javascript??Here is the sameple one, hope it will solves your problem.
<html>
<body>
<form name=f>
<%!
String str = "A String"
%>
<script>
var avariable = <%=str%>
<script>
</form>
</body>
</html>
Let me know if you face any problem -
How to Create a Session variable in JSP?
How to create a session variable and add attributes to it?
For example i want to create a session variable called "name" and add value "user" to it? if i try to do it with setAttribute(), it is giving error as both is of type string? how to do it? kindly help meThis is variable what is working in my aplication
String variable;
if(user == null){
user=new String("");
}//if you don'y do this you will have null pointer exception
session.setAttribute("user",user);//put value
String name=(String)session.getAttribu("user"); //get value;
I hope this will help -
How to get the session variable value in JSF
Hi
This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
<managed-bean-name>login</managed-bean-name>
<managed-bean-class>LoginBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope> like that...
So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
Already i tried
session.getAtrribute("userId");
session.getValue("userId");
but it retrieve only "null" value.. could u please help me.. it's very urgent one..
By
SubbusWhere i use that..is it in jsp or backend bean...
simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
in LogoutBean inside
public String getUserID()
Object sessionAttribute = null;
FacesContext facescontext=FacesContext.getCurrentInstance();
ExternalContext externalcontext=facescontext.getExternalContext();
Map sessionMap=externalcontext.getSessionMap();
if(sessionMap != null)
sessionAttribute = sessionMap.get("userId");
System.out.println("Session value is...."+(String)sessionAttribute);
return (String)sessionAttribute;
return "fail";
JSP Page
<jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
System.out.println("SS value is ...."+logs.getUserID());
but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
By
Subbus -
How to pass a JavaScript variable into a java method
I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<script LANGUAGE="JavaScript">
myValue = someDynamicValue;
<% System.out.println(myValue)%>
</script>
</head>
<body>
</body>
</html>
obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
NOTE: the java method does not have to be a println() method, it can be any method of my choice.
NOTE: someDynamicValue is a JavaScript value that can dynamically changeI don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side. -
How to create a session variable in Apex?
Hello colleagues,
Is there someone do know how to create a session variable in Apex?
How to get them?
Thanks
Best RegardsHello,
What do you mean by 'session variable'? You mean something that stores the value int he users session state?
I really recommend reading the 2-Day Developer guide documentation, there is a complete section on session state -
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/concept.htm#CIHCFHBD
Hope this helps,
John
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd -
How to call javascript function from PL/SQL procedure
Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?
Hi,
I have a requirement to call Javascript function inside a After Submit Process.
clear requirement below:
1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
2. user clicks on "save files" button
3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
Hope this clarify U.
Krishna. -
How do I enter a variable into an equation?
How do I enter a variable into an equation?
Jacob,
Spreadsheets don't use equations, so the usual nomenclature can be confusing.
When you enter something into a spreadsheet cell, it is either a Literal Value (Constant), or an Expression, preceded by an equal sign, that tells the spreadsheet to display something. Every Cell Reference in the Expression is a Variable. The equal sign in this case does not signify an equality, it just signals the spreadsheet that you want it to do something, defined by the expression that follows.
Here's an equation: A1 = B1 + C1 + 10, where B1 and C1 are variables and 10 is a constant.
To figure out what the value of A1 is, you write an expression in cell A1. That Expression would be: =B1 + C1 + 10. The operation that is performed by the spreadsheet is that it looks at B1 and C1, adds whatever it sees there and then adds the constant 10, and displays the result in A1.
It can get very complex. Expressions can contain Functions that catch the Time or generate a random number, or round a value, etc. Just remember that anything you see in a cell can be changed, so that content, that cell address, is a variable
Jerry -
How to convert an int variable into String type
hi everybody
i want to know how to convert an interger variable into string variable
i have to implement a code which goes like this
Chioce ch;
for(int i=0;i<32;i++)
// here i need a code to convert the int variable i into a string variable
ch.add(String variable);
how do i convert that int variable i into a String type variable??
can anyone help me?Different methods:
int a;
string s=a+"";or
String.valueOf(int) is the better option because Int.toString() generated an intermediate object to get the endresult
Ema -
How can we use Session Variable in Answers or Analysis?
How can we use Session Variable in Answers or Analysis?
Again, duplicate cross-posting!
See rukbat 's post here: Re: BI Apps 7.9.6.3(Agent Issue) -
Hi,
I would like to know how to set a session variable for the following purpose.
At the top of my application I have a "Welcome <username>" I'd like it instead to have "Welcome <firstname> <lastname>".
So the concept would be after the user logs in succesfully this session variable is dynamically set so it can be displayed.Hi Scott,
I realize that I can set items etc in pages. The case I'm referring to is a reference in a template. My template has a "Welcome <user name>" ... so the code looks like "Welcome &APP_USER." Anyway to make it say "Welcome first_name last_name" in the template? Note I'll have to get the first/last names from a query
Thanks,
Marty -
How to call web services from PL/SQL?
Hi,
Can one help in how to call web services from PL/SQL? Steps, pros and cons, etc....
Thanks in advanceHere's some example skeleton code to get you started...
PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
soap_request VARCHAR2(30000);
soap_respond CLOB;
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
soap_err exception;
v_code VARCHAR2(200);
v_msg VARCHAR2(1800);
v_len number;
v_txt Varchar2(32767);
BEGIN
UTL_HTTP.SET_PROXY(p_proxy);
-- Define the SOAP request according the the definition of the web service being called
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
' <SOAP-ENV:Body>'||
' <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
' <m:UserName>'||p_username||'</m:UserName>'||
' <m:Password>'||p_password||'</m:Password>'||
' </m:DownloadRequest>'||
' </SOAP-ENV:Body>'||
'</SOAP-ENV:Envelope>';
http_req:= utl_http.begin_request
( 'http://www.website.net/webservices/GetDetailsService.asmx'
, 'POST'
, 'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
LOOP
utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
soap_respond := soap_respond || v_txt; -- build up CLOB
END LOOP;
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
END;Using secure web services (https)...
Web serivces call in Plsql
As for 'pros and cons'... there's nothing to compare against... either you want to call a web service or you don't. -
How to call procedure in Java from SQL Server Database
Hello Every Body
i Have Question about
How to call procedure in Java from SQL Server Database
ThanksHi,
have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
Frank
Maybe you are looking for
-
Upgrade dv6-6c19tx to windows 8 from windows 7
Hi, I bought my laptop at year 2012, by default the operation system is Windows 7 and I just upgrade the windows to windows 8 btw I found out that some of the driver that listed in the Windows 7 download list is missing in Windows 8 list. http://h100
-
Can't open PDF file as email attachment
I have windows xp with adobe reader 8. When I try to open a pdf attachment file in my email it wants to go to my browser and won't open. Just get a warning messege. I want it to open in adobe reader. I can save it and then open it from my documents g
-
MacBook has started to shut down randomly.
I've had my MacBook for almost four months now and have loved it so far-- no problems. Then, a few days ago, out of the blue, it started shutting off randomly. I called AppleCare yesterday and they suggested I install an update for the fan, which I d
-
URI Redirecting Problem in JSF ActionListener !!Please help!
Hi, i have 2 pages: A.jsp and B.jsp. I have a command link in A.jsp, and its code is like this: <h:commandLink actionListener="#{navigator.goBSite}"> <h:outputText value="GoB" /> </h:commandLink> in the action listener goBSite(ActionEvent e)
-
Troubleshooting "Invalid property name" during EPMA Dimension import
I am trying to import a dimension via EPMA and receiving the error below. I have a couple of questions: How can that property exist in the first place if it's invalid? How can I find that property and where it's referenced? Thanks in advance! -Ben In