[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

String variable to contain sql query

Posted on 2011-05-05
2
Medium Priority
?
190 Views
Last Modified: 2012-05-11
I have the following statement:

mssql_query("SELECT COUNT(TerminalID) AS CNT FROM TransactionData WHERE TerminalID = '" + CurrentTerminalID + "' AND SequenceNumber LIKE '" + SequenceNumber + "'", "GetSequenceSearchCount");

CurrentTerminalID is a string variable
SequenceNumber is a string variable

My question is, how do I include all of the single and double quotes within the string variable?

i.e.
private var customQuery:String;
customQuery = "mssql_query("SELECT COUNT(TerminalID) AS CNT FROM ATMTransactionData WHERE TerminalID = '" + CurrentTerminalID + "' AND SequenceNumber LIKE '" + SequenceNumber + "'", "GetSequenceSearchCount");"
0
Comment
Question by:deross
2 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 35700571
private var customQuery:String;
customQuery = "mssql_query(\"SELECT COUNT(TerminalID) AS CNT FROM ATMTransactionData WHERE TerminalID = '\" + CurrentTerminalID + \"' AND SequenceNumber LIKE '\" + SequenceNumber + \"'\", \"GetSequenceSearchCount\");"
0
 

Author Closing Comment

by:deross
ID: 35700633
Thanks, it worked great.
0

Featured Post

Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

Question has a verified solution.

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

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
If anyone asked you to network diagram of the internet, it was drawn in the form of a fluffy cloud which further became known as cloud computing. Popularly cloud computing is defined as workloads that run over the internet in a commercial provider’s…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline
Suggested Courses

834 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