Perl Tutorial : Perl data types
Perl Tutorial : Perl Operators
Perl Tutorial : Perl loops
Perl Tutorial : Perl Conditionals
Perl Tutorial : Perl Subroutines
Perl Tutorial : Perl regex
Perl Tutorial : Perl Files
Perl Tutorial : Perl & Databases
Perl Tutorial : Perl OOPs
Perl Tutorial : Perl signals
Perl Tutorial : Perl threads
Perl Tutorial : Perl Debugging

Introcution to Perl CGI

Introduction to modperl
Home >> perldatabases >>

How to use Bind Variables?

#!/usr/bin/perl
use DBI;
my $dsn = "dbi:mysql:database=database:host=hostname:port";
my $dbuser = "tpmon";
my $dbpass = "merrill";
my $dbh = DBI->connect($dsn,$dbuser,$dbpass);

my $SEL = "SELECT e.name,e.job,d.name   emp e, dept d WHERE e.deptno=d.deptno AND e.empno=? and dob=?";
my $sth = $db->prepare($SEL);
print "Enter EMPNO:";
my $empno = ;
my $dob=”19550606”; 
$sth->bind_param( 1, $empno );
$sth->bind_param( 2, $dob);
$sth->execute();
The general idea here is that if the statement already exists within the Shared SQL Cache, the database doesn't need to reprocess that statement before returning a handle to the statement. It can simply reuse the information stored in the cache. This process can increase performance quite dramatically in cases where the same SQL is executed over and over again.

Perl functions

scalars and strings

lc
ord

regex (regular expressions)

arrays

shift
split

More..

eval
Share |

Perl and Databases: MySQL,Sybase Oracle, dbi

Perl examples

  • How to use Data::Dumper?
  • How to parse config file?
  • Include external module in perl..
  • Download perl

    download stable version of perl
    Perl 5.10.1
    Perl interview Questions
    sed tutorial
    awk tutorial

    Join us on Google Groups

    Subscribe to perl
    Email:
    Visit this group
    Perl Jobs


    privacy | sitemap | disclaim | contact us
    © 2009 perlhome.com