×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Trying to use DBI::SQLite

Trying to use DBI::SQLite

Trying to use DBI::SQLite

(OP)
I have used DBI::Oracle in the past, but now I need to use DBI::SQLite and it seems the connection structure is different.

CODE --> Perl

#### program variables

$dbsys     = "spwdclwsntdb1";
$user      = "lawsonpf";
$pass      = "##########";
$dsn       = "DBI:SQLite:dbname=$dbsys";

use DBI;

$dbh=DBI->connect($dsn, $user, $pass) or die;

$sth = $dbh->prepare("SELECT * FROM EMPLOYEE")
        or die "Couldn't prepare statement: " . $dbh->errstr; 

I changed the password to all #'s.

The error I am getting is that it cannot find the table EMPLOYEE. The table EMPLOYEE is under DEV. I don't see where to put that.

In Oracle I used dev.EMPLOYEE, I tried that in SQLite and it can not find the table.

There are no errors on the connection, just the prepare.

Does anybody see what I am doing wrong?

RE: Trying to use DBI::SQLite

(OP)
I forgot to mention that this is a Windows/SQL machine and in the past I was working on a Unix/Oracle machine.

RE: Trying to use DBI::SQLite

And have you tried to use the qualified name for the table in your select i.e

CODE

SELECT * FROM DEV.EMPLOYEE 
???

RE: Trying to use DBI::SQLite

add some debug commands.

Is DBI:SQLite part of DBI or do you have to instantiate it other than use DBI?

use warnings;

Do you have any special characters in "$pass"?

$dbh=DBI->connect($dsn, $user, $pass) or die "print $!\";

RE: Trying to use DBI::SQLite

(OP)
I tried dev.employee and got the same result.

I do have 2 $$ characters in $pass and I have asked for a password with no special characters.

RE: Trying to use DBI::SQLite

(OP)
My database is DEV and my server is spwdclwsntdb1

RE: Trying to use DBI::SQLite

(OP)
This is closed, the problem was that SQL was not setup correctly.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close