set caseSensitive to true
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
set caseSensitive to true
on getPoint
global gConnectionID, gPoint, gUser
set the caseSensitive to true
if field id 1098 is empty then
answer "Please enter code first."
exit getPoint
else
put field id 1098 into tCodes
end if
put "codes" into tTableCodes
put "share" into tTableName
put "SELECT Points FROM "&tTableCodes&" WHERE Codes= '" & tCodes & "'" into tSQL
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
if item 1 of tData = "revdberr" then
answer error "check internet connection"
exit to top
else
if tData = "0" then
answer "Used Code"
exit getPoint
else
if item 1 of tData is field id 1098 then
Add tData to gPoint
else
answer "Check Code"
exit getPoint
end if
end if
end if
Hello All,
I have an issue with setting case sensitive of alphanumeric sequence from database. I would appreciate your kind help as i have included the script, so as to show if its my misstake or just not possible with alphanumeric sequence.
Regards
mcbroh
global gConnectionID, gPoint, gUser
set the caseSensitive to true
if field id 1098 is empty then
answer "Please enter code first."
exit getPoint
else
put field id 1098 into tCodes
end if
put "codes" into tTableCodes
put "share" into tTableName
put "SELECT Points FROM "&tTableCodes&" WHERE Codes= '" & tCodes & "'" into tSQL
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
if item 1 of tData = "revdberr" then
answer error "check internet connection"
exit to top
else
if tData = "0" then
answer "Used Code"
exit getPoint
else
if item 1 of tData is field id 1098 then
Add tData to gPoint
else
answer "Check Code"
exit getPoint
end if
end if
end if
Hello All,
I have an issue with setting case sensitive of alphanumeric sequence from database. I would appreciate your kind help as i have included the script, so as to show if its my misstake or just not possible with alphanumeric sequence.
Regards
mcbroh
Re: set caseSensitive to true
Hej, mcvroh,
sorry, don't understand this:
Best
Klaus
sorry, don't understand this:
?I have an issue with setting case sensitive of alphanumeric sequence from database.
Best
Klaus
Re: set caseSensitive to true
Hi Klause,
An example... on database (xaYj1E2)
when i type (xayj1e2) am expecting it to answer wrong code. but it just accepts it
Regards
mcbroh
An example... on database (xaYj1E2)
when i type (xayj1e2) am expecting it to answer wrong code. but it just accepts it

Regards
mcbroh
Re: set caseSensitive to true
Hm, still not sure I quite understand, but I guess this is more a SQL than a Livecode problem.
Sorry, I do not know how to solve this problem.
Sorry, I do not know how to solve this problem.
Re: set caseSensitive to true
Thanks Klaus,
would keep cracking my head out
would keep cracking my head out

Re: set caseSensitive to true
Hi,
regarding the script in the OP - assuming that only the "end getPoint" is lacking:
The script starts with an already open DB (gConnectionID).
Then you grab a Code from a field & put it into tCodes. Be it "123" for now.
Then you fill the variables tTableCodes & tTableName - where tTableName istn't used anymore later ...
And construct an SQL-String: "SELECT Points from codes WHERE Codes= '123'"
Remark: Seems you have a table that contains a field with the same name? This is crying for problems, IMHO. A way to escape it is to construct something like this:
"SELECT codes.Points from codes WHERE codes.Codes= '123';"
And it never hurts to close with a semicolon, too ;-)
Now we should receive (in tData) the Points-value of the row where codes is 123. If Points is zero, it's a used code.
Then:
... if item 1 of tData is field id 1098 then
Item 1 of tData is the points (you only asked for them!)! And you compare it to the Code?
Remark 2: OK, maybe you didn't post all of the code, maybe this is beyond my scope - as I see it, only if Points = 123 in the row where Codes = 123 it will execute at all...
Regarding "caseSensitive":
Dictionary: "Specifies whether comparisons treat uppercase and lowercase letters as different."
This is for LiveCode only, as I understand it!
There's only one comparison in the code, and this tests tData, the Points (a number?).
Regarding the database name in the second post:
Try this in the message box (multi-lines):Returns false, as it should. (LC-C 6.7.1)
Further:
When you call a database or a table by name, it's dependent on what system it runs:
- Win is case-insensitive
- Linux is case-sensitive
- Mac is whatever
(- and I may be wrong, but at least this way it always worked for me ...)
When you call a field by name (in SQL), even in MySQL on Linux it isn't case-sensitive. Was there, tried it, reporting here.
Hope I was able to add to the general confusion ;-)
Have a good time!
regarding the script in the OP - assuming that only the "end getPoint" is lacking:
The script starts with an already open DB (gConnectionID).
Then you grab a Code from a field & put it into tCodes. Be it "123" for now.
Then you fill the variables tTableCodes & tTableName - where tTableName istn't used anymore later ...
And construct an SQL-String: "SELECT Points from codes WHERE Codes= '123'"
Remark: Seems you have a table that contains a field with the same name? This is crying for problems, IMHO. A way to escape it is to construct something like this:
"SELECT codes.Points from codes WHERE codes.Codes= '123';"
And it never hurts to close with a semicolon, too ;-)
Now we should receive (in tData) the Points-value of the row where codes is 123. If Points is zero, it's a used code.
Then:
... if item 1 of tData is field id 1098 then
Item 1 of tData is the points (you only asked for them!)! And you compare it to the Code?
Remark 2: OK, maybe you didn't post all of the code, maybe this is beyond my scope - as I see it, only if Points = 123 in the row where Codes = 123 it will execute at all...
Regarding "caseSensitive":
Dictionary: "Specifies whether comparisons treat uppercase and lowercase letters as different."
This is for LiveCode only, as I understand it!
There's only one comparison in the code, and this tests tData, the Points (a number?).
Regarding the database name in the second post:
Try this in the message box (multi-lines):
Code: Select all
set the casesensitive to true
put "xaYj1E2" = "xayj1e2"
Further:
When you call a database or a table by name, it's dependent on what system it runs:
- Win is case-insensitive
- Linux is case-sensitive
- Mac is whatever
(- and I may be wrong, but at least this way it always worked for me ...)
When you call a field by name (in SQL), even in MySQL on Linux it isn't case-sensitive. Was there, tried it, reporting here.
Hope I was able to add to the general confusion ;-)
Have a good time!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
Re: set caseSensitive to true
hello Axwald,
thanks for your input.
i figured it out now. i can not check case sensitiv directly from within the Database. i have to put the info first into a variable on app and then case sensitive can work.
Thanks
thanks for your input.
i figured it out now. i can not check case sensitiv directly from within the Database. i have to put the info first into a variable on app and then case sensitive can work.
Thanks