PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Puneet Awasthi" <puneet dot awasthi at csfb dot com>
Subject: Re: Join ProblemB
Date: Oct 8 1997 9:53AM

	I think your query is missing some spaces. Please put a space at the
end of each dbcmd statement.

It will be a better idea to build a query string in a variable and then have a
single dbcmd  statement. You can easily check the sql statement which is going
to the server.

Hope this helps.

Regards,
Puneet

On Oct 8,  9:47, ddrumm@rush.edu wrote:
> Subject: Join ProblemB
> 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($_[0],$_[1],"SIGHBASE");
> $dbproc->dbuse('MyDB');
> $dbproc->dbcmd("select distinct * from PHASCII, PHPASSWD\n");
>
> #this is a problem line
> $dbproc->dbcmd("where lower(PHASCII.firstname) like \"%$fname\"");
>
> $dbproc->dbcmd("and PHASCII.firstname *= PHPASSWD.firstname");
> $dbproc->dbcmd("and PHASCII.lastname *= PHPASSWD.lastname");
> $dbproc->dbcmd("order by PHASCII.department");
> $dbproc->dbsqlexec;
> $dbproc->dbresults;
>
>
> And it spits:
>
> Msg 102, Level 15, State 1
> Line 2
>         Incorrect syntax near 'PHASCII'.
> DB-Library error:
>         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.
>
> Anybody have any ideas?
>
> --
> Daniel G. Drumm - ddrumm@rush.edu
> Rush Presbyterian St. Luke's Medical Center - Chicago, IL
> Network Division - Information Services
>
>-- End of excerpt from ddrumm@rush.edu



-- 
____________________________________________________________________________
Puneet Awasthi      | Tel : (65)-420-4749 | Beep   :    9-575-7731
CREDIT | FIRST      | Res : (65)-581-4420 | Res    : (65)-584-4163
SUISSE | BOSTON     | Fax : (65)-420-4669 | E-Mail : puneet.awasthi@csfb.com
____________________________________________________________________________
Don't go through life, grow through life. -Eric Butterworth
____________________________________________________________________________