CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Dynamic Value in SQL

Print topic Send  topic

Author Message
jwh_1997
Posted: 08/23/2002, 9:02 AM

Using JSP

Trying to sort records displayed by user_id, based on the user who is currently logged in. Is there an easy way? I know how to get the user id via the session but using the "WHERE" box in form properties and writing: contact_creator_userid = (String)session.getAttribute("UserID"); will only produce errors. So how do you use dynamic variables in SQL using CC?

Perhaps I am missing something and it is easier than I am making it.
jwh_1997
Posted: 08/23/2002, 9:36 AM

I have found out how to escape the quotes so that the code doesnt error out. Unfortunate that the function doesn't instantiate when or before the SQL calls the Database. here is my code:

contact_creator_id = (String)session.getAttribute(\"UserID\");

This comes up with nothing...even tho the contact_creator_id does equal the UserID.
Any advice?
jwh_1997
Posted: 08/23/2002, 9:48 AM

WHERE contact_creator_id ="+ (String)session.getAttribute("UserID")+

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.