Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I'm trying to write a Perl script to connect to our Remedy system using Win32::ODBC. I'm aware of the wonderfully named arsperl module from Buffalo university, but I don't have agreement to use this (I am not the Remedy admin) whereas ODBC connection is accepted (we currently run reports from Excel, where the ODBC DSN works no problem).

I don't Win32::ODBC well enough - am I making a stupid mistake with my coding, or is there a known problem connecting to Remedy AR system using this module? I can connect (as proved by the fact that I can get a list of the columns in a particular table) but I can't get any information from them at all. I've tried to intersperse the code with various of the debugging functions suggested in the perldocs.

#!perl use strict; use Win32::ODBC; use Data::Dumper; my $odbc=Win32::ODBC->new('Remedy ODBC Data Source') or die "Couldn't +connect! $!"; my %sources=Win32::ODBC->DataSources (); print Dumper(\%sources); # $VAR1 = {}; my %drivers=Win32::ODBC->Drivers (); print Dumper(\%drivers); # This exists on the other hand... (large hash with details of availab +le drivers) my %funcs=$odbc->GetFunctions (); print Dumper(\%funcs); # $VAR1 = { # '0' => '0', # '1' => '0' # }; print "Running SQL statement:\n"; # $odbc->Run( q(SELECT * FROM "SHR:PeopleGroup")); # Excecuting connection 1 # sql statement: "SELECT * FROM "SHR:PeopleGroup"" # Error: "" # -------------------- $odbc->Sql( q(SELECT * FROM "SHR:PeopleGroup")); $odbc->DumpData (); # Produces a Heading row including all headings in the SHR:PeopleGroup + schema, # but with *no* data: for example- # Full-Name First-Name Last-Name ID Phone # --------- ---------- --------- -- ----- while ($odbc->FetchRow) { print "."; # Never gets here my %hash=$odbc->DataHash; print Dumper(\%hash); } print $odbc->TableList('','','',''); # print $odbc->TableList(); # print $odbc->TableList('','','','TABLE'); # All do nothing $odbc->ShutDown; # gives no useful information $odbc->Close;

Cheerio!
Osfameron
http://osfameron.perlmonk.org/chickenman/


In reply to Win32::ODBC - connecting to Remedy AR System by osfameron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2021-12-02 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (18 votes). Check out past polls.

    Notices?