pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedYou have an error in your SQL syntax near '' at line 1
2+ messages / 2 participants
[nested] [flat]
* You have an error in your SQL syntax near '' at line 1
@ 2001-07-13 17:38 Ari Nepon <anepon@verveinternet.com>
0 siblings, 1 reply; 2+ messages in thread
From: Ari Nepon @ 2001-07-13 17:38 UTC (permalink / raw)
To: pgsql-sql
Hi,
I keep getting this error "You have an error in your SQL syntax near '' at
line 1" when I try to run the below query. Does anyone know what I'm
missing? Maybe some of the variables need to be in single or double qoutes?
I tried a bunch of things, but no change.
tbl_all holds the foreign keys and some columns of non-relational data. the
other tbl_somethinghere tables hold two columns, the primary key and a name.
$columns_to_select ="tbl_users.username_field, tbl_client.name,
tbl_project.project_name, tbl_task.task_name, tbl_all.description,
tbl_all.hours, tbl_all.date_field";
$left_join ="LEFT JOIN tbl_users ON tbl_all.employee_ID =
tbl_users.username_field LEFT JOIN tbl_client ON
tbl_all.client_ID=tbl_client.name LEFT JOIN tbl_project ON
tbl_all.project_ID=tbl_project.project_name";
$left_join2="LEFT JOIN tbl_task ON tbl_all.task_ID=tbl_task.task_name";
$where="WHERE tbl_all.client_ID = $clients";
$all_query ="SELECT $columns_to_select FROM tbl_all $left_join $left_join2
$where";
Thanks,
Ari
~~~~~~~~~~~~~~~~~~~~~~~~~
Ari Nepon
MRB Communications
4520 Wilde Street, Ste. 2
Philadelphia, PA 19127
p: 215.508.4920
f: 215.508.4590
http://www.mrbcomm.com
-----------------------------------------------------------------------
Sign up for our email list and receive free information about
topics of interest to nonprofit communications, marketing, and
community building professionals. Free resources, articles, tips.
Go to http://www.mrbcomm.com and use the Mailing List form.
-----------------------------------------------------------------------
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: You have an error in your SQL syntax near '' at line 1
@ 2001-07-13 19:01 Josh Berkus <josh@agliodbs.com>
parent: Ari Nepon <anepon@verveinternet.com>
0 siblings, 0 replies; 2+ messages in thread
From: Josh Berkus @ 2001-07-13 19:01 UTC (permalink / raw)
To: anepon@verveinternet.com; pgsql-sql
Ari,
> I keep getting this error "You have an error in your SQL syntax near
> '' at
> line 1" when I try to run the below query. Does anyone know what I'm
> missing? Maybe some of the variables need to be in single or double
> qoutes?
> I tried a bunch of things, but no change.
The first thing you should do is modify your program so that it outputs
the query text it's actually passing to the database to a text file or
stdout instead. Once you see the actual query and not a bunch of
string variables, the error may jump out at you.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-07-13 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-13 17:38 You have an error in your SQL syntax near '' at line 1 Ari Nepon <anepon@verveinternet.com>
2001-07-13 19:01 ` Josh Berkus <josh@agliodbs.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox