F Fayez Boulos Member Licensed User Feb 14, 2019 #1 Hi, I am trying to execute a statement against MS SQL server. The statement is Dim sf As Object = RemoteSQL.ExecQueryAsync("RemoteSQL", "SELECT * from package where package_id=?", Array As Int (147)) But it does not return any rows (Crsr has no rows). If I use select * from package without the where clause, I get all the rows correctly... and most strangely if I use select * from package where package_id=147 I get no rows !! Can someone help me resolving this issue, and what will happen if I execute a command to run a stored procedure which needs parameters. Your help is appreciated. Thanks
Hi, I am trying to execute a statement against MS SQL server. The statement is Dim sf As Object = RemoteSQL.ExecQueryAsync("RemoteSQL", "SELECT * from package where package_id=?", Array As Int (147)) But it does not return any rows (Crsr has no rows). If I use select * from package without the where clause, I get all the rows correctly... and most strangely if I use select * from package where package_id=147 I get no rows !! Can someone help me resolving this issue, and what will happen if I execute a command to run a stored procedure which needs parameters. Your help is appreciated. Thanks
Computersmith64 Well-Known Member Licensed User Longtime User Feb 14, 2019 #2 A bit more info would be useful. What is the type of package_id? Are you certain there is a row where package_id = 147? Maybe also provide the code you are running, because you're making references in your question to objects that aren't shown in what you have posted (ie: Crsr). My guess (without any other info) is that if there is a row where package_id = 147, the datatype is a string & therefore you would need to change your parameter value from an Int to a String - however instead of Array As Int(147) or Array As String("147"), just do Array(147) or Array("147"). That way, when you have to provide values for parameters of mixed types you can just put Array(147, "Blah") - Colin. Upvote 0
A bit more info would be useful. What is the type of package_id? Are you certain there is a row where package_id = 147? Maybe also provide the code you are running, because you're making references in your question to objects that aren't shown in what you have posted (ie: Crsr). My guess (without any other info) is that if there is a row where package_id = 147, the datatype is a string & therefore you would need to change your parameter value from an Int to a String - however instead of Array As Int(147) or Array As String("147"), just do Array(147) or Array("147"). That way, when you have to provide values for parameters of mixed types you can just put Array(147, "Blah") - Colin.
DonManfred Expert Licensed User Longtime User Feb 14, 2019 #3 Fayez Boulos said: Array As Int (147) Click to expand... it should be Array(147) Last edited: Feb 14, 2019 Upvote 0
DonManfred Expert Licensed User Longtime User Feb 14, 2019 #4 Fayez Boulos said: Dim sf As Object Click to expand... Please use [CODE]code here...[/CODE] tags when posting code. Upvote 0
Fayez Boulos said: Dim sf As Object Click to expand... Please use [CODE]code here...[/CODE] tags when posting code.
F Fayez Boulos Member Licensed User Feb 14, 2019 #5 Thanks Colin and DonManfred, I used Array(147) and it worked, and Colin explanation answered one of my potential questions of using a combination of int, string array of parameters.. I appreciate your help as usual. I will try here to use Code: Copy .... for trial to see how it works, however, my thread is completed successfully... My apologies I am still learning very new environment to me. Thanks again Code: Copy Dim sf As Object = RemoteSQL.ExecQueryAsync("RemoteSQL", "SELECT * from package where package_id=?", Array(147)) Upvote 0
Thanks Colin and DonManfred, I used Array(147) and it worked, and Colin explanation answered one of my potential questions of using a combination of int, string array of parameters.. I appreciate your help as usual. I will try here to use Code: Copy .... for trial to see how it works, however, my thread is completed successfully... My apologies I am still learning very new environment to me. Thanks again Code: Copy Dim sf As Object = RemoteSQL.ExecQueryAsync("RemoteSQL", "SELECT * from package where package_id=?", Array(147))