Ekanvitha9 has asked for the wisdom of the Perl Monks concerning the following question:
I'm passing the data into MySQL using Perl code.While passing the values dynamically, the values are not inserting in the database.Here is my DB connectivity code
#!C:\Perl\bin\perl.exe use strict; use warnings; use DBI; my $session_id = 723; print $session_id . "\n"; my $employeename='Anvi'; print("Employee name: $employeename\n"); my $dbh = DBI->connect("DBI:ODBC:DSN=databasename;uid=myusername;pwd=m +ypassword") or die $DBI::errstr; my $sth=$dbh->prepare("INSERT INTO employee_details (session_id,Name) +VALUES (?,?)"); $sth->execute; $dbh->disconnect; print "Done\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl with Insert query
by hippo (Archbishop) on Jul 29, 2019 at 10:10 UTC | |
|
Re: Perl with Insert query
by haj (Vicar) on Jul 29, 2019 at 10:11 UTC | |
|
Re: Perl with Insert query
by Tux (Canon) on Jul 29, 2019 at 10:24 UTC | |
|
Re: Perl with Insert query
by erix (Prior) on Jul 29, 2019 at 10:46 UTC |