Re: Perl for IDS 7.3x
Posted in 2000
Topics: Installation, Setup & Upgrades, Versions, Editions & End-of-Life
On Thu, 21 Sep 2000, Sistema Unico (CNA) wrote: >I want to program a PERL application to access an IDS 7.3x. The question is >this: can I use SQL embeded in the PERL code to access the data base ??? Or >do I have to use a library which allow me to use several SQL functions >implemented to access the engine ??? where can I find them in this case?? Set up perl so you can use: perl -MCPAN -e 'install Bundle::DBD::Informix' The setup phase means running: perl -MCPAN -e shell It will ask you some questions and you get to choose where it downloads software from. It will also recommend you install some upgrades (especially the CPAN module itself) and probably the LWP and libnet modules (and Digest::MD5). Perl has a standard database interface, the Perl DBI, and there is a standard driver for that, DBD::Informix. Yeah, I'm mildly biassed. The 'bible' is the Cheetah book: Programming the Perl DBI Alligator Descartes and Tim Bunce O'Reilly (http://www.oreilly.com), February 2000, ISBN 1-56592-699-4 -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"
Jonathan,
Sorry to bug you with what I'm sure is a simple question, but I'm new to using
Informix (at least as a DBA). I'm having trouble getting DBD::Informix to
install correctly on my linux box. I have the Informix client SDK installed,
and have read the README. I noticed that the package wants to have a local
informix server installed, or one it can connect against in order to finish
building. I don't have informix installed on the local server, but rather want
to connect to a remote AIX Informix machine. Is there a way I can build the
package without
having to test it against a database? This remote database is informix online
version 5.02. When I do "perl Makefile.pl", I get:
Testing whether your Informix test environment will work...
ESQLTEST Program Running:
@(#)$Id: esqltest.ec version /main/20 2000-02-08 16:57:02 $
$DBI_DBNAME unset - defaulting to 'stores'.
$DBD_INFORMIX_DATABASE unset - defaulting to 'stores'.
$DBD_INFORMIX_DATABASE2 unset - defaulting to 'stores'.
$DBD_INFORMIX_USERNAME is unset.
$DBD_INFORMIX_USERNAME2 is unset.
$DBD_INFORMIX_PASSWORD is unset.
$DBD_INFORMIX_PASSWORD2 is unset.
Testing connection to stores
CONNECT TO 'stores' - no user info
SQL: -25596: The INFORMIXSERVER value is not listed in the sqlhosts file or the
Registry.
I thought INFORMIXSERVER was an environment variable, which I do have set.
Also, my sqlhosts file is configured as such:
#---------------------
demo_on onipcshm on_hostname on_servernamedemo_se seipcpip se_hostname sqlexec
ol_security.secmgmt.com onsoctcp security.secmgmt.com dbservice
#------------------
I have dbservice setup on /etc/services as port 1525/tcp.
Do I need to have anything on the remote AIX machine for sqlhosts?
Thanks in advance,
Zack
Jonathan Leffler wrote:
> On Thu, 21 Sep 2000, Sistema Unico (CNA) wrote:
> >I want to program a PERL application to access an IDS 7.3x. The question is
> >this: can I use SQL embeded in the PERL code to access the data base ??? Or
> >do I have to use a library which allow me to use several SQL functions
> >implemented to access the engine ??? where can I find them in this case??
>
> Set up perl so you can use: perl -MCPAN -e 'install Bundle::DBD::Informix'
>
> The setup phase means running:
>
> perl -MCPAN -e shell
>
> It will ask you some questions and you get to choose where it downloads
> software from. It will also recommend you install some upgrades
> (especially the CPAN module itself) and probably the LWP and libnet
> modules (and Digest::MD5).
>
> Perl has a standard database interface, the Perl DBI, and there is a
> standard driver for that, DBD::Informix. Yeah, I'm mildly biassed.
> The 'bible' is the Cheetah book:
> Programming the Perl DBI
> Alligator Descartes and Tim Bunce
> O'Reilly (http://www.oreilly.com), February 2000, ISBN 1-56592-699-4
>
> --
> Yours,
> Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
> "I don't suffer from insanity; I enjoy every minute of it!"
On Wed, 27 Sep 2000, Zack Hamm wrote:
>Jonathan,
>
>Sorry to bug you with what I'm sure is a simple question, but I'm new
>to using Informix (at least as a DBA). I'm having trouble getting
>DBD::Informix to install correctly on my linux box. I have the
>Informix client SDK installed, and have read the README. I noticed
>that the package wants to have a local informix server installed, or
>one it can connect against in order to finish building. I don't have
>informix installed on the local server, but rather want to connect to a
>remote AIX Informix machine.
OK, no big problem.
>Is there a way I can build the package without having to test it
>against a database?
Yes; DBD_INFORMIX_NO_ESQLTEST, as documented. But never, ever, ask any
questions about why it is failing to build if you've not run the test.
Obviously, I can't make you run 'make test'; you can install on the
assumption that it will work. However, it won't make debugging any
easier if you've not run the tests -- you won't know whether the product
is built and installed correctly.
>This remote database is informix online version 5.02. When I do "perl
>Makefile.pl", I get:
You are aware that 5.02 OnLine is not supported now because it is not
Y2K compliant. You should be upgraded to 5.10, at least.
>Testing whether your Informix test environment will work...
>ESQLTEST Program Running:
>@(#)$Id: esqltest.ec version /main/20 2000-02-08 16:57:02 $
> $DBI_DBNAME unset - defaulting to 'stores'.
> $DBD_INFORMIX_DATABASE unset - defaulting to 'stores'.
> $DBD_INFORMIX_DATABASE2 unset - defaulting to 'stores'.
> $DBD_INFORMIX_USERNAME is unset.
> $DBD_INFORMIX_USERNAME2 is unset.
> $DBD_INFORMIX_PASSWORD is unset.
> $DBD_INFORMIX_PASSWORD2 is unset.
>Testing connection to stores
> CONNECT TO 'stores' - no user info
>SQL: -25596: The INFORMIXSERVER value is not listed in the sqlhosts file or the
>Registry.
What is the value of INFORMIXSERVER?
>I thought INFORMIXSERVER was an environment variable, which I do have
>set.
It is an environment variable. It is also the key to a line in the
sqlhosts file, which is either specified by $INFORMIXSQLHOSTS or is
$INFORMIXDIR/etc/sqlhosts. You should be able to do:
grep "^$INFORMIXSERVER[ ]" ${INFORMIXSQLHOSTS:-$INFORMIXDIR/etc/sqlhosts}
That's a real handful to type, so I mostly don't do it, but you should
be able to do so. There's a blank and a tab inside the square brackets.
>Also, my sqlhosts file is configured as such:
>#---------------------
>demo_on onipcshm on_hostname on_servername>demo_se seipcpip se_hostname sqlexec
>ol_security.secmgmt.com onsoctcp security.secmgmt.com dbservice
I don't know whether the server name (ol_security.secmgmt.com) is
allowed to have dots in it; no obvious reason why not, but it is not
usually done. So, a first step is to change the server name to
something like ol_security, both in sqlhosts and INFORMIXSERVER. Your
Linux box is not, I assume, security.secmgmt.com; that is the AIX box?
>#------------------
>
>I have dbservice setup on /etc/services as port 1525/tcp.
>
>Do I need to have anything on the remote AIX machine for sqlhosts?
Yes, but it ain't trivial. For starters, you need I-Net or I-Star, and
you need to be running the sqlexecd so that it listens to port 1525 on
the AIX box. You have to worry about the 5.x sqlhosts file, which is
not IIRC identical to the 6.00 and later sqlhosts file.
>Jonathan Leffler wrote:
>> On Thu, 21 Sep 2000, Sistema Unico (CNA) wrote:
>> >I want to program a PERL application to access an IDS 7.3x. The question is
>> >this: can I use SQL embeded in the PERL code to access the data base ??? Or
>> >do I have to use a library which allow me to use several SQL functions
>> >implemented to access the engine ??? where can I find them in this case??
>>
>> Set up perl so you can use: perl -MCPAN -e 'install Bundle::DBD::Informix'
>>
>> The setup phase means running:
>>
>> perl -MCPAN -e shell
>>
>> It will ask you some questions and you get to choose where it downloads
>> software from. It will also recommend you install some upgrades
>> (especially the CPAN module itself) and probably the LWP and libnet
>> modules (and Digest::MD5).
>>
>> Perl has a standard database interface, the Perl DBI, and there is a
>> standard driver for that, DBD::Informix. Yeah, I'm mildly biassed.
>> The 'bible' is the Cheetah book:
>> Programming the Perl DBI
>> Alligator Descartes and Tim Bunce
>> O'Reilly (http://www.oreilly.com), February 2000, ISBN 1-56592-699-4
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"