Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Micros ISL - String concatenation 1

Status
Not open for further replies.

outlawdoug

Programmer
Aug 21, 2010
8
US
I am trying to query the database for info surrounding a specific barcode...

Select *
from micros.barcode_def
where barcode = '7331048109'

I am setting the sql command string like this
NOTE: strBarcode is user input from POS terminal.

strSQL = "Select * from micros.barocode_def where barcode = " + "'" + strBarcode + "'"

The interpreter gives me the error
"No ops on strings"

QUESTION: Is it not possible to concatenate in ISL?

Thanx, OutlawDoug
 
Please try like this:

Code:
strSQL = "Select*from micros.barocode_def where barcode =", \
"strBarcode"
 
Though you will not need quotes on second if you are using initialized variable, so you just put name of the variable...
 
savissimo,

your solution retuns error

"Expected end of line (,)"

Doug
 
Perhaps I should make it clear that my code is attempting to concatenate a string variable to the end of a string. This is not a user input command.

tnx,

doug
 
doco clearely states that only RELATIONAL operator are allowed on strings.

So now how do I query the DB for a specific barcode?

select * from micros.barcode_def where barcode = '7331048100'

anyone?

doug
 
You can query the database like i explained. I dont understand from where do you get the Data? what is the variable type. Please provide the code...
 
or you can use format command to format string

format strSQL as "Select*from micros.barocode_def where barcode =", \
strBarcode
 
OK,

I figured it out...

format strSQL as "Select * from micros.Barcode_def where barcode = " , strBarcode

Code is not really on two lines.

As you all know the Micros SIM doco is best used to clean up after yourself in the little programmer's room.

doug
 
Savissimo,

Looks like you were on the right track when I stumbled upon the answer. The doco is not really clear that the format command can be used in this mannor but it works.

doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top