[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Flex SQL query with variable in WHERE

Posted on 2010-08-19
3
Medium Priority
?
907 Views
Last Modified: 2013-11-16
Hi all,
I'm new to Flex and am having difficulty in creating a dynamic SQL query.  Basically I have a text input box allowing the user to enter an ID to be used as the where criteria in my SQL string.

public function doSearch(planId:String=""):void
{
force.query("SELECT Id, Name, Plan_ID__c FROM Opportunity WHERE Id = "  + :planId, new AsyncResponder(querySuccess));
}

Open in new window


If I replace the string with the following it works fine, but I'm just not sure how to make it dynamic:
force.query("SELECT Id, Name, Plan_ID__c FROM Opportunity WHERE Id = '0066000000AKCam'", new AsyncResponder(querySuccess));

Open in new window


Any help is greatly appreciated!
0
Comment
Question by:ITDeptAtPCS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 2000 total points
ID: 33480810
force.query("SELECT Id, Name, Plan_ID__c FROM Opportunity WHERE Id = '"  + :planId + "'", new AsyncResponder(querySuccess));
0
 
LVL 1

Author Comment

by:ITDeptAtPCS
ID: 33480829
Thanks for the quick response.  With that I received:

1084: Syntax error: expecting identifier before colon.      Main.mxml      1st Flex/src      line 34      Flex Problem
0
 
LVL 1

Author Comment

by:ITDeptAtPCS
ID: 33480841
I removed the colon and was good to go.

Thanks!
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question