Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

DBD::Sybase and Repserver

by Anonymous Monk
on Jan 19, 2005 at 14:20 UTC ( [id://423387]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anybody know how (or if ?) you can use the Sybase DBI module to connect to and issue commands against a Sybase Repserver ?
If so how do you execute commands against the Repserver ?
I tried putting together a simple script :-
#!/usr/bin/perl -w use strict; use DBI; my $server="MY_REPSERVER"; my $user="repserv_user"; my $pass="hello"; my $dbh = DBI->connect("dbi:Sybase:server=$server", $user, $pass,{ PrintError => 0, # Don't print + warning messages RaiseError => 1 } ); my $sth = $dbh->prepare("Admin who_is_down"); $sth->execute;
When executing this script I get
E. 2005/01/18 12:58:38. ERROR #14024 USER(repserv_user) - /execint.c(1 +222) Executor does not allow the entered command in the current mod +e.
The script is just to demonstrate the problem
Any help appreciated

Retitled by davido.

Replies are listed 'Best First'.
Re: DBD::Sybase and Repserver
by mpeppler (Vicar) on Jan 19, 2005 at 17:02 UTC
    Could you try that with DBI->trace(4)?

    I've used DBD::Sybase with rep server with no problems...

    Michael

      Are you saying that the example I gave should work ?
      When running with DBI_TRACE=4 I get this
      -> connect for DBD::Sybase::dr (DBI::dr=HASH(0x1ba63c)~0x10d178 'serve +r=MY_REPSERVER' 'repserv_user' **** HASH(0x24294)) New DBI::db (for DBD::Sybase::db, parent=DBI::dr=HASH(0x10d178), i +d=) dbih_setup_handle(DBI::db=HASH(0x10d13c)=>DBI::db=HASH(0x242948), +DBD::Sybase::db, 1b8f74, Null!) dbih_make_com(DBI::dr=HASH(0x10d178), 2410f8, DBD::Sybase::db, 242 +8, 0) thr#0 syb_db_login() -> checking for chained transactions servermsg_cb -> number=17001 severity=10 state=0 line=0 server=SRS +_SUNTS_TST text=No SRV_OPTION handler installed. clientmsg_cb -> ct_options(): user api layer: external error: An e +rror was returned from the server while setting theoptions, check the + server message for details. syb_db_login() -> chained transactions are not supported !! ERROR: 183 CLEARED by call to prepare method -> prepare for DBD::Sybase::db (DBI::db=HASH(0x10d13c)~0x242948 's +elect @@version') New DBI::st (for DBD::Sybase::st, parent=DBI::db=HASH(0x242948), i +d=) dbih_setup_handle(DBI::st=HASH(0x242a14)=>DBI::st=HASH(0x242a08), +DBD::Sybase::st, 242a20, Null!) dbih_make_com(DBI::db=HASH(0x242948), 243808, DBD::Sybase::st, 396 +, 0) thr#0 <- prepare= DBI::st=HASH(0x242a14) at Sybase.pm line 103 via repse +rv.pl line 11 -> execute for DBD::Sybase::st (DBI::st=HASH(0x242a14)~0x242a08) syb_alloc_cmd() -> CS_COMMAND 260608 for CS_CONNECTION 242c08 syb_db_opentran() -> ct_command( BEGIN TRAN DBI243808 ) = 1 syb_db_opentran() -> ct_send() = 1 servermsg_cb -> number=14024 severity=12 state=0 line=0 server=SRS +_SUNTS_TST text=Executor does not allow the entered command in the cu +rrent mode.
      Am I missing something basic ?
      I've done this with sybperl (albeit a few years ago) but cannot seem to get this example to work.
      Any help appreciated
        I figured it out. I hadn't setup an error handler in my example. A basic mistake !
        Thanks - that's exactly what I wanted. I see what the problem is - the code attempts (unnecessarily) to start a transaction, which is of course not supported when you connect to replication server.

        BTW - is this DBD::Sybase 1.05?

        Michael

Re: DBD::Sybase and Repserver
by jfroebe (Parson) on Jan 19, 2005 at 15:05 UTC

    Hi,

    Going off of memory, you should be able to ignore the 14024 informational error message in your sybase error handler as DBD::Sybase assumes that your running on ASE or MS SQL.

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      Also, I always get an error message from SQL Advantage when I connect to a rep server to run e.g. "admin who is down".

      It's annoying, but it works after that.

      /J

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://423387]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-24 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found