Font
Wiki:Tipp zum Debugging: use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper \@var;
[thread]3635[/thread]

Sybase - und die Verzweiflung: Probleme mit Sybase-SQL-Abfrage

Reader: 1


<< >> 2 entries, 1 page
sascha
 2005-11-04 09:25
#33729 #33729
User since
2004-12-10
7 articles
BenutzerIn
[default_avatar]
Hi,

ich bin noch recht neu bei Perl und dürfte gleich mal ein Skript schreiben, was eine SQL-Abfrage ausführt.

Und schon bin ich am verzweiflen.

Ich erhalte permanent den Fehler:

Code: (dl )
1
2
3
DBD::Sybase::st execute failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (52)
Server server.domain.de:4100, database
Message String: Unknown marker


Mein Skript sieht so aus:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl

use warnings;
use strict;
use DBI;
use DBD::Sybase;

my $servername = 'server.domain.de';
my $database = 'NIC';
my $user = "sascha";
my $password = "geheim";

my $dsn = "Class:DBI:Sybase:$database:$servername";


my $dbh = DBI->connect('dbi:Sybase:server=server.domain.de:4100', $user, $password);
unless ($dbh)   {       # Fehlerabfrage
       die "ERROR $dsn: ", DBI-> errstr(), "\n";
}                       # unless


my $sth = $dbh->prepare("
                       select c.names, c.address, c.city, c.postalCode, d.handle
                       FROM NIC..CONTACTS c, NIC..OBJECTLINKS o, NIC..DOMAINS d
                       where c.names like '%irgendwas%'
                       and c.postalCode like '%12345%'
                       and c.handle is null
                       and o.targetType = (select objectTypeId from NIC..OBJECTTYPES where objectType = 'Contact')
                       and o.targetId = c.contactId
                       and o.sourceType = (select objectTypeId from NIC..OBJECTTYPES where objectType = 'Domain')
                       and o.sourceId = d.domainId
                       and o.roleId = (select roleId from NIC..ROLES where text = 'owner')
         ");
         $sth->execute;


my $results = $sth->fetchall_arrayref;


$sth->finish();
$dbh->disconnect();


Für einen Tip wäre ich dankbar.

Viele Grüsse
Sascha


edit pq: code-tags hinzugefügt\n\n

<!--EDIT|pq|1131096500-->
sascha
 2005-11-07 12:50
#33730 #33730
User since
2004-12-10
7 articles
BenutzerIn
[default_avatar]
Okay, ich habe es gefunden. Es lag an der freetds.conf
<< >> 2 entries, 1 page



View all threads created 2005-11-04 09:25.