Up Prev Next
From: Craig Jackson <CRAIGJ at epub dot med dot iacnet dot com>
Subject: Re: Join ProblemB
Date: Oct 8 1997 2:09AM
Do you need to make sure that there is whitespace at the end of
each dbcmd string? I think that the strings of each dbcmd are concatenated
together, with no implied whitespace.
For the same reason, the entire where and order by clauses are on the second
line, since there is only one newline in the string.
>I'm having trouble with the syntax of a join. SybPerl doesn't care
>for the 2nd dbcmd() I issue it:
>$dbproc = Sybase::DBlib->dblogin($_,$_,"SIGHBASE");
>$dbproc->dbcmd("select distinct * from PHASCII, PHPASSWD\n");
>#this is a problem line
>$dbproc->dbcmd("where lower(PHASCII.firstname) like \"%$fname\"");
No whitespace here. +
>$dbproc->dbcmd("and PHASCII.firstname *= PHPASSWD.firstname");
>$dbproc->dbcmd("and PHASCII.lastname *= PHPASSWD.lastname");
>$dbproc->dbcmd("order by PHASCII.department");
>And it spits:
>Msg 102, Level 15, State 1
> Incorrect syntax near 'PHASCII'.
> General SQL Server error: Check messages from the SQL Server.
>I've tried renaming the calls to the table to dbo.PHASCII and so forth,
>but no go. I tried escaping the parenthesis, all to no avail.
>Daniel G. Drumm - firstname.lastname@example.org
Information Access Company