CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Cannot do inner join on DBI query


New User

Oct 19, 2011, 4:20 AM

Post #1 of 1 (538 views)
Cannot do inner join on DBI query Can't Post

Hi, I'm using the DBI module, and it seems to show an error message when I try to join tables on the FROM clause. The following code does not work:


my $sql = $dbh -> prepare( " select a.field1 from table1 a inner join table2 b on = where = 1 " );

$sql -> execute();


I get an error message reading:


DBD::Oracle::db prepare failed: ORA-00933: SQL command not properly ended (DBD ERROR: error possibly near <*> indicator at ...


Whereas the following works fine:


my $sql = $dbh -> prepare( " select a.field1 from table1 a, table2 b where = and = 1 " );

$sql -> execute();


I really hate joining on the WHERE clause and consider it bad practice and would like to get to the bottom of this. Can anyone point me in the right direction as to how I can join on the FROM clause using the DBI module?

Thanks in advance.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives