Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #1 Hello friends I am developing an application in B4A connected directly to SQL Server using RDC, following the link: https://www.b4x.com/android/forum/t...connector-rdc-connect-to-any-remote-db.31540/ The query in SQL Server is the following: The query is in the RDC Config file: The query is executed in the RDC log The problem I have is when I use the LIKE operator in a SELECT query, in the smartphone it shows all the records and that query should only return 5 records Thank you for your assistance
Hello friends I am developing an application in B4A connected directly to SQL Server using RDC, following the link: https://www.b4x.com/android/forum/t...connector-rdc-connect-to-any-remote-db.31540/ The query in SQL Server is the following: The query is in the RDC Config file: The query is executed in the RDC log The problem I have is when I use the LIKE operator in a SELECT query, in the smartphone it shows all the records and that query should only return 5 records Thank you for your assistance
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2018 #2 Why are you using RDC instead of jRDC2? Upvote 0
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #3 Hi Erel 1. I thought that jRDC2 was only for B4J and not for B4A 2. The examples I found are only for B4J That's the reason why I use RDC I would appreciate it if you can give me an example using jRDC2 (SQL Insert and Select operators) Thank you very much for your help Upvote 0
Hi Erel 1. I thought that jRDC2 was only for B4J and not for B4A 2. The examples I found are only for B4J That's the reason why I use RDC I would appreciate it if you can give me an example using jRDC2 (SQL Insert and Select operators) Thank you very much for your help
S sorex Expert Licensed User Longtime User Jan 5, 2018 #4 what about replacing like '%?%' with in ('?') ? the wildcards are then gone. Upvote 0
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #5 sorex said: what about replacing like '%?%' with in ('?') ? the wildcards are then gone. Click to expand... Hi sorex Make the change you tell me the sql query was like this: SELECT NIT, Suc, Name, Address, City, LP, Seller_ID FROM Customers WHERE Name in ('?') When executing it in the SmartPhone it does not return any record Upvote 0
sorex said: what about replacing like '%?%' with in ('?') ? the wildcards are then gone. Click to expand... Hi sorex Make the change you tell me the sql query was like this: SELECT NIT, Suc, Name, Address, City, LP, Seller_ID FROM Customers WHERE Name in ('?') When executing it in the SmartPhone it does not return any record
S sorex Expert Licensed User Longtime User Jan 5, 2018 #6 it seems that the value is not stored where the ? is Upvote 0
Jorge M A Well-Known Member Licensed User Longtime User Jan 5, 2018 #7 Maybe you want use SQL Server Profiler in your server, and monitor the sentence received by DB Engine. Upvote 0
Maybe you want use SQL Server Profiler in your server, and monitor the sentence received by DB Engine.
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #8 Jorge M A said: Maybe you want use SQL Server Profiler in your server, and monitor the sentence received by DB Engine. Click to expand... Hi Jorge MA Look, I did the test in the SQL Server Profiler Here are the results: Performing the query with the IN operator in SQL Server Mannagent Studio does not show any record, see image: The problem seems to be in the LIKE operator, all the other queries I do work well. Thank you Upvote 0
Jorge M A said: Maybe you want use SQL Server Profiler in your server, and monitor the sentence received by DB Engine. Click to expand... Hi Jorge MA Look, I did the test in the SQL Server Profiler Here are the results: Performing the query with the IN operator in SQL Server Mannagent Studio does not show any record, see image: The problem seems to be in the LIKE operator, all the other queries I do work well. Thank you
S sorex Expert Licensed User Longtime User Jan 5, 2018 #9 oh wait, you do a search in larger content. IN is mainly to match a non wildcard string. my bad, sorry. Upvote 0
oh wait, you do a search in larger content. IN is mainly to match a non wildcard string. my bad, sorry.
Jorge M A Well-Known Member Licensed User Longtime User Jan 5, 2018 #10 @Bladimir Silva Toro, Try the same with the LIKE operator. Make sure the percent signs ('%value%') arrive to the server. If not, enclose with double quote. Upvote 0
@Bladimir Silva Toro, Try the same with the LIKE operator. Make sure the percent signs ('%value%') arrive to the server. If not, enclose with double quote.
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #11 @Jorge M A It seems that the wildcard (?) Sent from the RDC's config file does not send anything to the LIKE operator in the SQL Server Database. See the image of the SQL Server Profiler If I do this same query in the SQL Server Mannagent Studio, the same result is returned which returns all the records in the table, see the image The idea is that you can use the operator like the wildcard (?) Should send this to the database engine. Thank you Upvote 0
@Jorge M A It seems that the wildcard (?) Sent from the RDC's config file does not send anything to the LIKE operator in the SQL Server Database. See the image of the SQL Server Profiler If I do this same query in the SQL Server Mannagent Studio, the same result is returned which returns all the records in the table, see the image The idea is that you can use the operator like the wildcard (?) Should send this to the database engine. Thank you
Jorge M A Well-Known Member Licensed User Longtime User Jan 5, 2018 #12 This is not the way that MS SQL works. The quotation mark (?) defines the PARAMETER substitution to be used. But your issue is not MS SQL, but in JDBC driver and the PREPARED statement. JDBC is out of my experience. maybe you want read the official documentation here. Upvote 0
This is not the way that MS SQL works. The quotation mark (?) defines the PARAMETER substitution to be used. But your issue is not MS SQL, but in JDBC driver and the PREPARED statement. JDBC is out of my experience. maybe you want read the official documentation here.
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #13 As I read to change from RDC to jRDC2 it is just change the DBRequestManager.bas file in my B4A, I have read this information in: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Is this correct ? or what other change should I make? Thank you very much Upvote 0
As I read to change from RDC to jRDC2 it is just change the DBRequestManager.bas file in my B4A, I have read this information in: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Is this correct ? or what other change should I make? Thank you very much
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 5, 2018 #14 Hi @Erel As I read to change from RDC to jRDC2 it is just change the DBRequestManager.bas file in my B4A, I have read this information in: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Is this correct ? or what other change should I make? Thank you very much Upvote 0
Hi @Erel As I read to change from RDC to jRDC2 it is just change the DBRequestManager.bas file in my B4A, I have read this information in: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Is this correct ? or what other change should I make? Thank you very much
OliverA Expert Licensed User Longtime User Jan 5, 2018 #15 As to your like issue, see https://stackoverflow.com/a/8248052 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 7, 2018 #16 You shouldn't use RDC. It was replaced by jRDC2. Bladimir Silva Toro said: or what other change should I make? Click to expand... Also update the link. It ends with /rdc Note that there is a newer DBRequestManager that can be used with Wait For and is simpler to use. Upvote 0
You shouldn't use RDC. It was replaced by jRDC2. Bladimir Silva Toro said: or what other change should I make? Click to expand... Also update the link. It ends with /rdc Note that there is a newer DBRequestManager that can be used with Wait For and is simpler to use.
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 8, 2018 #17 Hi @Erel I have already started jRDC2 connected with MS SQL Server, the test works fine. You have an example of the B4A client connected to a MySQL or SQL Server database by jRDC2? Thank you very much. Upvote 0
Hi @Erel I have already started jRDC2 connected with MS SQL Server, the test works fine. You have an example of the B4A client connected to a MySQL or SQL Server database by jRDC2? Thank you very much.
DonManfred Expert Licensed User Longtime User Jan 8, 2018 #18 Bladimir Silva Toro said: You have an example of the B4A client connected to a MySQL or SQL Server database by jRDC2? Click to expand... Check the rdc b4a example. Calling rdc2 is the same.... https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Check the migration notes from RDC to RDC2 in this post. Last edited: Jan 8, 2018 Upvote 0
Bladimir Silva Toro said: You have an example of the B4A client connected to a MySQL or SQL Server database by jRDC2? Click to expand... Check the rdc b4a example. Calling rdc2 is the same.... https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Check the migration notes from RDC to RDC2 in this post.