Running sample scripts

After installation, run these samples scripts.

StepsAdaptive Server Enterprise extension module for Python

  1. Locate Python samples in $SYBASE/$SYBASE_OCS/samples/python directory.

  2. Verify that Adaptive Server is up and running.

  3. Make sure that the PYTHONPATH environment variable or the Python variable sys.path is set to one of the following directories ((these are the default directories where the different versions of the Adaptive Server Python extension module are installed):

    Table 3-1: PYTHONPATH Settings

    Python Version

    Default Installation Path

    2.6, 2.7

    $SYBASE/$SYBASE_OCS/python/python26_64r/lib

    3.1

    $SYBASE/$SYBASE_OCS/python/python31_64r/lib

  4. Run the sample:

    python test.py
    

See the Adaptive Server Enterprise Extension Module for Python Programmers Guide for more details.

StepsAdaptive Server Enterprise extension module for PHP

  1. Locate PHP samples in $SYBASE/$SYBASE_OCS/samples/php directory.

  2. Verify that Adaptive Server is up and running.

  3. Generate a sample php.ini file with:

    $SYBASE/$SYBASE_OCS/config/generate_php_ini.sh in the $SYBASE/$SYBASE_OCS/config directory.

  4. Make sure these environment variables are set:

    • SYBASE

    • SYBASE_OCS

    • LD_LIBRARY_PATH – specifies the $SYBASE/$SYBASE_OCS/lib directory.

  5. Run the sample:

    php -c $SYBASE/$SYBASE_OCS/config firstapp.php
    

    or, execute this to obtain a list of loaded extensions:

    php -c $SYBASE/$SYBASE_OCS/config -m
    

See the Adaptive Server Enterprise Extension Module for PHP Programmers Guide for more details.

StepsAdaptive Server Enterprise database driver for Perl

  1. Locate Perl samples in $SYBASE/$SYBASE_OCS/samples/perl directory.

  2. Verify that Adaptive Server is up and running.

  3. Make sure that the PERL5LIB environment variable is set to:

    • On Linux x86-64 64-bit drivers specify the $SYBASE/$SYBASE_OCS/perl/sybaseperl_64r/lib/lib: \ $SYBASE/$SYBASE_OCS/perl/sybaseperl_64r/lib/arch directory

    • On Solaris x86 32-bit and Solaris SPARC 32-bit drivers specify the $SYBASE/$SYBASE_OCS/perl/sybaseperl_32/lib/lib: \ $SYBASE/$SYBASE_OCS/perl/sybaseperl_32/lib/arch directory.

    • On IBM AIX 32-bit, HP-UX Itanium 32-bit, and Linux on POWER 32-bit drivers specify the $SYBASE/$SYBASE_OCS/perl/sybaseperl_32r/lib/lib: \ $SYBASE/$SYBASE_OCS/perl/sybaseperl_32r/lib/arch directory.

  4. Run the sample:

    perl firstapp.pl
    

See the Adaptive Server Enterprise Database Driver for PERL Programmers Guide for more details.