View previous topic :: View next topic |
Author |
Message |
unclelude
Joined: 22 Jan 2003 Posts: 20
|
Posted: Tue Feb 18, 2003 2:24 pm Post subject: |
|
|
Alex,
I downloaded the file and now I am using HM 3.65
Tried, but same error "Incorrect Syntax near 'emmWirelessType_EwnIDFK' with and without SQLFetch... option.
|
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Wed Feb 19, 2003 12:49 pm Post subject: |
|
|
I checked code, documentation, and web forums. But now I am out of ideas, I don't know what can be wrong
Regards
Alex |
|
Back to top |
|
|
Guest
|
Posted: Wed Feb 19, 2003 12:59 pm Post subject: |
|
|
When trying the ODBC query test on my end, I found that the entire statement had to be on the same line. Unlike in Query Analyzer where you can put parts of the query on seperate lines for easier viewing. I just pasted it into notepad, turned wordwrap off, and made sure it was all on one line. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Wed Feb 19, 2003 1:16 pm Post subject: |
|
|
You can use many lines, HostMonitor makes single line anyway (at least latest version).
Regards
Alex |
|
Back to top |
|
|
unclelude
Joined: 22 Jan 2003 Posts: 20
|
Posted: Wed Feb 19, 2003 3:14 pm Post subject: |
|
|
Hi Alex,
You are correct, HM expects all the code in one line. I tried your suggestion and it worked. I am very greatful for your help.
Thanks,
Adnan |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Wed Feb 19, 2003 4:16 pm Post subject: |
|
|
Ok, I found what was wrong. HostMonitor makes one line from multiline query. But HM just removed 0A and 0D characters and did not insert spaces. My testing multiline requests work because I usually use space in first position for any line except first. Very simple error, I just had to look into right place Thanks
Update available at http://www.ks-soft.net/download/hm366.zip
Regards
Alex |
|
Back to top |
|
|
unclelude
Joined: 22 Jan 2003 Posts: 20
|
Posted: Thu Feb 20, 2003 10:53 pm Post subject: |
|
|
Hi Alex,
I think the code needs a little bit of tweeking. If you have a couple of lines of SQL code in HM, it removes the space between the lines. For example, the code
select * from tbl1
where a = 1
will become
select * from tbl1where a = 1
to test it, enter few lines of code in HM, then do a cut/paste in notepad without word wrap and you will know what I am referring to.
If I have a code that works in other ODBC applications, should it always work in HM as well, or are there some exceptions ? Should the following work in HM ?
declare @counter1 int,@counter2 int
set @counter1 = (select count(*) from tbl1..tblWooWorkorder)
set @counter2 =(select * from openrowset('SQLOLEDB','ServerName';'username';'password',
'SELECT count(*) FROM tbl2.dbo.tblWooWorkorder ') )
if @counter1 = @counter2
begin
print 0
end
else
begin
print 1
end
|
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Thu Feb 20, 2003 11:57 pm Post subject: |
|
|
>to test it, enter few lines of code in HM, then do a cut/paste in notepad without word wrap and you will know what I am referring to.
Please, check my message above. There is patch available
[i]>Should the following work in HM ?
I don't know, it depends on driver and server. HostMonitor does not care about syntax of the query. It just send ONE statement to ODBC driver and get responce.
Regards
Alex |
|
Back to top |
|
|
jricha34
Joined: 07 Jul 2002 Posts: 59 Location: USA
|
Posted: Wed Mar 05, 2003 5:37 pm Post subject: |
|
|
This is probably late by the ODBC command line test tool for SQL Server is OSQL. It comes with SQL Server. |
|
Back to top |
|
|
|