Re: Problem with DBI and placeholders

2021-04-15 Thread mailing lists via beginners
ong but would appreciate any advice. this is what i did: my $src_dbh = DBI->connect(     sprintf('dbi:mysql:database=%s;host=%s;port=3306',$src_db{'db'}, $src_db{'host'}),    

Re: Problem with DBI and placeholders

2021-04-09 Thread Lawrence Statton
On 4/9/21 7:11 AM, mailing lists via beginners wrote: thanks Andrew I need to insert millions of rows so I need to have a good performance using placeholders You can not use placeholders for the table name. If you have millions of *tables*, there is something very, very, very wrong with

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
SELECT * FROM "test"; rather than  SELECT * FROM test; This isn't a problem for Postgres but MySQL doesn't accept quoted table names. On Fri, Apr 9, 2021 at 1:25 PM mailing lists via beginners wrote: I'm using: CentOS Linux release 7.9.2009 (Core) perl 5.16.3 perl-DBD

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
OM $table"); $sth->execute() && say "OK 2"; Em April 9, 2021 12:25:18 PM UTC, mailing lists via beginners escreveu: I'm using: CentOS Linux release 7.9.2009 (Core) perl 5.16.3 perl-DBD-MySQL-4.023 perl-DBI-1.627 On Friday, April 9, 2021, 2:19:13 PM GMT+2, mailing l

Re: Problem with DBI and placeholders

2021-04-09 Thread Andrew Solomon
pt quoted table names. On Fri, Apr 9, 2021 at 1:25 PM mailing lists via beginners < beginners@perl.org> wrote: > I'm using: > > CentOS Linux release 7.9.2009 (Core) > perl 5.16.3 > perl-DBD-MySQL-4.023 > perl-DBI-1.627 > On Friday, April 9, 2021, 2:19:13 PM GM

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
I'm using: CentOS Linux release 7.9.2009 (Core) perl 5.16.3 perl-DBD-MySQL-4.023 perl-DBI-1.627 On Friday, April 9, 2021, 2:19:13 PM GMT+2, mailing lists via beginners wrote: without using the variable $table it also fails with the same error $sth = $dbh->prepare("

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
ed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test'' at line 1 at ./test.pl line 28.END Does anyone know where the problem is? 1    #!/usr/bin/perl      2    use strict;   

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
 use strict; 3    use warnings;      4    use 5.010; 5    use DBI; 6     7    my %db = ( 8       host => 'mysql.local', 9       user => 'app',     10       password => '12345678',     11       db   =>

Re: Problem with DBI and placeholders

2021-04-09 Thread Andrew Solomon
server version for the right > syntax to use near ''test'' at line 1 at ./test.pl line 28. > END > > > Does anyone know where the problem is? > > > 1#!/usr/bin/perl > 2use strict; > 3use warnings; > 4use

Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
your MySQL server version for the right syntax to use near ''test'' at line 1 at ./test.pl line 28.END Does anyone know where the problem is? 1    #!/usr/bin/perl 2    use strict; 3    use warnings; 4    use 5.010; 5    use DBI; 6       

Problem with interaction of open3, sysread and DBI (pg)

2020-03-22 Thread Mike Martin via beginners
G{__WARN__} = sub {}; my ($fileno, $condition,$tag) = @_; if ($condition =~ /hup/) { close $file; Gtk3->main_quit(); return 1; } my $line ; sysread $output, $line, 256 or die print $!; my @line=split /\n/,$line; foreach my $l (@line){ print $DBI::err,"\n";#,$ins->{errstr

Re: DBI and hosts file entries

2017-06-06 Thread Davide Olivieri
Hi, According to my experience with DBD::Sybase + Freetds, the name resolution is done for the host names specified in the freetds.conf file. The following code will try to create an handler object for the host+port specified in the [ENGINEERING] section of the freetds.conf file $dbh = DBI

Re: DBI and hosts file entries

2017-06-01 Thread Bruce Ferrell
Hi Paul, I'm going to assume you're on a Linux system. I have exactly that configuration on my system (name to ip address mapping in /etc/hosts) and here's my understanding of how it's supposed to work: DBI uses a database driver (DBD). DBD uses the database client li

Re: DBI and hosts file entries

2017-06-01 Thread Chris Fedde
e /etc/hosts file? Is this correct? > Ping works fine in shell. > How would I point a server name to different IP addresses locally? > What does DBI use for name resolution? > > Thanks! >

DBI and hosts file entries

2017-06-01 Thread Paul M via beginners
I have a hosts entry that points to a specific IP address. It does not appear that DBI:Sybase:server uses the /etc/hosts file? Is this correct?Ping works fine in shell.How would I point a server name to different IP addresses locally?What does DBI use for name resolution? Thanks!

Re: DBI and field type 'bit'

2016-10-08 Thread hw
ould break existing code that expects it to be broken). use strict <https://metacpan.org/source/strict>; use warnings <https://metacpan.org/source/warnings>; use Test::More <https://metacpan.org/source/Test::More>; use DBI <https://metacpan.org/source/DBI>

Re: DBI and field type 'bit'

2016-10-01 Thread Chas. Owens
e would break existing code that > expects it to be broken). > > use strict <https://metacpan.org/source/strict>; > use warnings <https://metacpan.org/source/warnings>; > > use Test::More <https://metacpan.org/source/Test::More>; > use DBI <https://metac

Re: DBI and field type 'bit'

2016-10-01 Thread Chas. Owens
cpan.org/source/Test::More>; use DBI <https://metacpan.org/source/DBI>; use vars <https://metacpan.org/source/vars> qw($test_dsn $test_user $test_password); use lib <https://metacpan.org/source/lib> '.', 't'; require 'lib.pl'; sub VerifyBit ($) { } m

Re: DBI and field type 'bit'

2016-10-01 Thread Chas. Owens
unction as an lvalue to build a bitstring. > Interestingly, selecting with bitstrings doesn't seem to work and you have > to use the number. I am not sure if this is a bug or not. The > inconsistent behavior for select and insert is certainly surprising enough > that I would e

Re: DBI and field type 'bit'

2016-10-01 Thread Chas. Owens
ld a bitstring. Interestingly, selecting with bitstrings doesn't seem to work and you have to use the number. I am not sure if this is a bug or not. The inconsistent behavior for select and insert is certainly surprising enough that I would expect it to be mentioned in the docs, but I didn

DBI and field type 'bit'

2016-10-01 Thread hw
Hi, what´s the correct way with DBI to update a field in a mysql database when the field type is 'bit'? I´m getting, for example, converted to integer, 53 instead of 3 into the field. It goes like this: my $sth = $dbh->prepare("INSERT INTO t (`status`) VALUES (?)

Re: Is DBD installed with DBI?

2015-03-24 Thread Shlomi Fish
Hi Sherman, On Tue, 24 Mar 2015 08:23:07 -0600 Sherman Willden wrote: > Thank you, Shlomi. I am on Ubuntu when I try to install. I am looking at > the links and I see there is also a DBD::msql. I will try that. > DBD::mSQL is part of https://metacpan.org/release/Msql-Mysql-modules (whose last

Re: Is DBD installed with DBI?

2015-03-24 Thread Sherman Willden
> > I am trying to use perl with mysql. I have a tutorial open which prompted > > me to perform the following. > > > > $ sudo perl -MCPAN -e shell > > cpan> install DBI > > cpan[2]> install DBD::mysql > > > > DBI installed. The 'install DBD::

Re: Is DBD installed with DBI?

2015-03-24 Thread Shlomi Fish
Hi Sherman, On Mon, 23 Mar 2015 14:42:54 -0600 Sherman Willden wrote: > I am trying to use perl with mysql. I have a tutorial open which prompted > me to perform the following. > > $ sudo perl -MCPAN -e shell > cpan> install DBI > cpan[2]> install DBD::mysql > &g

Is DBD installed with DBI?

2015-03-23 Thread Sherman Willden
I am trying to use perl with mysql. I have a tutorial open which prompted me to perform the following. $ sudo perl -MCPAN -e shell cpan> install DBI cpan[2]> install DBD::mysql DBI installed. The 'install DBD::mysql' failed. Is DBD part of DBI? What am I missing? The DBD run is

Re: Wanted: Help with DBI/CGI in Windows 8.1/IIS

2014-06-26 Thread Robert Wohlfarth
On Thu, Jun 26, 2014 at 1:04 AM, Bruce Ferrell wrote: > On 06/25/2014 09:52 PM, Bruce Ferrell wrote: > >> On 06/25/2014 07:53 PM, siegfr...@heintze.com wrote: >> >>> use DBI; >>> use strict; >>> use warnings; >>> use POSIX; >>>

Re: Wanted: Help with DBI/CGI in Windows 8.1/IIS

2014-06-25 Thread Bruce Ferrell
ygwin bash command prompt. It displays the expected HTML. However, if I only remove the first comment character in column one and run it in IIS, internet explorer times out and complains about a bad header being returned. Can someone help me so I can incorporate DBI and microsoft access in my web pa

Re: Wanted: Help with DBI/CGI in Windows 8.1/IIS

2014-06-25 Thread Bruce Ferrell
ected HTML. However, if I only remove the first comment character in column one and run it in IIS, internet explorer times out and complains about a bad header being returned. Can someone help me so I can incorporate DBI and microsoft access in my web page? Thanks Siegfried use DBI; use strict; us

Wanted: Help with DBI/CGI in Windows 8.1/IIS

2014-06-25 Thread siegfried
aracter in column one and run it in IIS, internet explorer times out and complains about a bad header being returned. Can someone help me so I can incorporate DBI and microsoft access in my web page? Thanks Siegfried use DBI; use strict; use warnings; use POSIX; use CGI qw(:standard); use CGI::C

Perl DBI upload a csv file to Access database

2012-06-27 Thread Yu-Shan Wang
I try to upload a csv file to access database using perl DBI. But keep failing. The* number* and *type* of the field in csv file are not fixed. Might be integer or character. ( I was able to make it if they are fixed) ---start of code #connect

Re: Working with Perl DBI

2012-06-13 Thread Dr.Ruud
On 2012-06-08 12:49, Dmitry Korzhevin wrote: perl check2.pl DBI::db=HASH(0x1e40ae0)->disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting) at check2.pl line 17. You didn't fetch all the rows. #!/usr/bin/per

Re: Working with Perl DBI

2012-06-08 Thread John SJ Anderson
On Friday, June 8, 2012 at 6:49 AM, Dmitry Korzhevin wrote: What makes you think it's not working? Yes, you are getting this warning: > DBI::db=HASH(0x1e40ae0)->disconnect invalidates 1 active statement > > handle (either destroy statement handles or call finish on them befor

Working with Perl DBI

2012-06-08 Thread Dmitry Korzhevin
Hello guys, Please help me with debugging of following script: #!/usr/bin/perl use strict; use warnings; use DBI; my $dbh = DBI->connect('DBI:mysql:exim_mx1', 'root', 'PASSWORD') || die "Could not connect to database: $DBI::errstr"; my $sth = $dbh

Re: perl DBI n00b

2012-01-12 Thread Mark Haney
On 01/11/2012 09:58 AM, Mark Haney wrote: I'm pretty new to the perl DBI world, so can someone point me to a good tutorial/reference site or book or something? I'm very proficient with databases and pretty good with basic perl, but not used together. Any help would be appreciated.

Re: perl DBI n00b

2012-01-11 Thread pengyh
The doucument for DBI on CPAN is excellent. Or you may look at this thread: http://www.perlmonks.org/?node_id=22050 -Ursprüngliche Nachricht- Von: "Mark Haney" Gesendet: 2012-1-11 15:58:30 An: "beginners@perl.org" Betreff: perl DBI n00b >I'm pretty new t

Re: perl DBI n00b

2012-01-11 Thread Natal Ngétal
Le 11 janv. 2012 15:59, "Mark Haney" a écrit : > > I'm pretty new to the perl DBI world, so can someone point me to a good tutorial/reference site or book or something? I'm very proficient with databases and pretty good with basic perl, but not used together. Any help

perl DBI n00b

2012-01-11 Thread Mark Haney
I'm pretty new to the perl DBI world, so can someone point me to a good tutorial/reference site or book or something? I'm very proficient with databases and pretty good with basic perl, but not used together. Any help would be appreciated. -- To unsubscribe, e-mail: beginner

Re: problem with dbi oracle blob

2011-05-31 Thread Chris Nehren
/bin/perl > use warnings; > use strict; > use DBI; > > my $db = DBI->connect("dbi:Oracle:host=;sid=???", "???", "???", > {RaiseError => 1}) or die "$DBI::errstr"; > > open XML, ">./xmlfile" > or di

Re: How to execute xxx.sql in DBI in perl

2011-05-26 Thread Abhinav Kukreja
o get the query result using by > x.sql file. > > It mean that I want to execute x.sql file after connecting oracle, then I > want to get the output. > > Is it possible or not ? > > > > > > use DBI; > > ... > ... > > my $dbh = DBI->connect ($dsn,

How to execute xxx.sql in DBI in perl

2011-05-26 Thread Woo, Hye Jin
Would you help me how to execute like @xx.sql in PL/SQL in perl? If I do not execute select query, I want to get the query result using by x.sql file. It mean that I want to execute x.sql file after connecting oracle, then I want to get the output. Is it possible or not ? use DBI

problem with dbi oracle blob

2011-05-25 Thread Marco van Kammen
^@^K^@^@^@^Auq^@~^@^N^@^@^@^Esq^@~^@^Xq^@~^@^^t^@^CTSVq^@~^@^^t^@^KpartnerNameq^@~^@^\q^@~^@ Etc etc Code below... #!/usr/bin/perl use warnings; use strict; use DBI; my $db = DBI->connect("dbi:Oracle:host=;sid=???", "???", "???", {RaiseError => 1}) or die

Re: [use DBI] - how to improve security in perl script (

2011-05-18 Thread Pete Smith
On 17/05/11 22:46, Woo, Hye Jin wrote: But, I have to enter id and pw in perl script.(example below) It make security weak. If you make sure the script is only readable by the user executing it then only they will be able to see the password. Alternatively, on a *NIX system, store the passwo

[use DBI] - how to improve security in perl script (

2011-05-17 Thread Woo, Hye Jin
Do you know how to improve security on perl? Do you know how to encrypt the ID and PW in perl Specious guy can get ID and PW in perl script. I have been making the script to get DB healthcheck info about 20 DB servers everyday. I use DBI module. But, I have to enter id and pw in perl script

Re: inteligent DBI

2011-04-07 Thread marcos rebelo
st likely not > work but I assume you will understand where I am going with this... > Working with Perl in companies you will often see wrappers for DBI that do > things like what you are looking for or that provide other methods of > returning result sets (XML or JSON rather then P

Re: inteligent DBI

2011-04-07 Thread Rob Coops
(the code above will most likely not work but I assume you will understand where I am going with this... Working with Perl in companies you will often see wrappers for DBI that do things like what you are looking for or that provide other methods of returning result sets (XML or JSON rather then

inteligent DBI

2011-04-07 Thread marcos rebelo
Probably it is impossible, but it would be really usefull. I'm doing something like: my $sth = $dbh->prepare('INSERT INTO my_table(field_1) VALUES (?)'); $sth->bind_param( 1, 'pippo', { 'ora_type' => SQLT_BIN } ); $sth->execute; since I need to pass a parameter in the bind_param I would really

Re: DBI interaction with postgres

2011-01-04 Thread Brandon McCaig
On Tue, Jan 4, 2011 at 8:12 AM, jankes wrote: > my $nowe = $generuj->fetchrow_array; I haven't had the pleasure of using DBI yet, but CPAN says to exercise caution when using fetchrow_array in scalar context. Perhaps you should switch to list context. Either way, check the status

DBI interaction with postgres

2011-01-04 Thread jankes
Hi list, My problem will be best explained with an example: my $generuj = $dbh->prepare("SELECT plpgsql_function(par1, par2, par3)"); $generuj->execute(); my $nowe = $generuj->fetchrow_array; generuj->finish(); print "$nowe\n"; Now the plpgsql_function(par1, par2, par3) does some inserts and oth

Re: perl dbi question

2010-11-24 Thread Jim Gibson
At 12:31 PM -0800 11/24/10, Jim Green wrote: Hello Perl community, here is a question I encountered dbi and till now I use brute force to solve it, but I figured I may see better way to do it here. in orable sqlplus If I do select * from table, it will print out the results nicely, all aligned

perl dbi question

2010-11-24 Thread Jim Green
Hello Perl community, here is a question I encountered dbi and till now I use brute force to solve it, but I figured I may see better way to do it here. in orable sqlplus If I do select * from table, it will print out the results nicely, all aligned. in dbi what I do now my $body = sprintf

Re: DBI - bind_param_inout

2010-10-25 Thread Brandon McCaig
On Mon, Oct 25, 2010 at 3:27 PM, Shlomi Fish wrote: > 2. $bind_value is the variable where you want to supply and receive the value. > You need to take a reference to it so it can be modified. I imagine she knows this already, but I believe the stored procedure's parameter will need to be marked

Re: DBI - bind_param_inout

2010-10-25 Thread Shlomi Fish
Hi Nora, On Monday 25 October 2010 10:05:05 HACKER Nora wrote: > Hi list, > > I have a sql package which returns a value after execution. I figured > out that, when calling this package from Perl, I need a bind parameter > (http://search.cpan.org/~timb/DBI-1.615/DBI.pm#bind_pa

DBI - bind_param_inout

2010-10-25 Thread HACKER Nora
Hi list, I have a sql package which returns a value after execution. I figured out that, when calling this package from Perl, I need a bind parameter (http://search.cpan.org/~timb/DBI-1.615/DBI.pm#bind_param_inout) that this return can be saved into so that I can use it afterwards in my Perl

RE: Strange behaviour while using DBI with binding

2010-08-19 Thread Babale Fongo
Normally I would expect a quoted string to represent one value, this is probably not true for DBI binding as you mentioned. Cheers => -Original Message- => From: Chas. Owens [mailto:chas.ow...@gmail.com] => Sent: 19 August 2010 13:22 => To: Babale Fongo => Cc: Uri Gut

Re: Strange behaviour while using DBI with binding

2010-08-19 Thread Dr.Ruud
mit $limit }); $sth->execute($gender, $role); In the first example, DBI always passed the value for offset and ignored the second value after the comma. If you have 2 values, you need to "prepare" with two placeholders. (I quoted "prepare" because a limit is not r

Re: Strange behaviour while using DBI with binding

2010-08-19 Thread Chas. Owens
On Wed, Aug 18, 2010 at 19:55, Babale Fongo wrote: snip > In the first example, DBI always passed the value for offset and ignored the > second value after the comma. > > I'm now using the second code as it works without problem even if string > contains space. I just need t

Re: Strange behaviour while using DBI with binding

2010-08-19 Thread Robert Wohlfarth
er by lname limit $limit >}); > $sth->execute($gender, $role); > If DBI treats it as two values, maybe passing two value will work. Something like this code... my $sth = $dbh->prepare(qq{ Select fname, lname, dob, substr(desc, 1, 200) from user left j

RE: Strange behaviour while using DBI with binding

2010-08-18 Thread Babale Fongo
and position = ? order by lname limit $limit }); $sth->execute($gender, $role); In the first example, DBI always passed the value for offset and ignored the second value after the comma. I'm now using the second code as it works without problem even if string contains space. I

Re: Strange behaviour while using DBI with binding

2010-08-18 Thread Uri Guttman
I was desperate to find the error, so I tried several option to see whether DBI will parse the string correctly. i don't see any code where there is no space after the comma. MC> Below I tried quoting the string as you mentioned below, but it MC> still didn't work as exp

RE: Strange behaviour while using DBI with binding

2010-08-18 Thread Mimi Cafe
You asked why I am concatenating the 2 scalars, comma and the space below? my $limit = "$offset" . ', ' . "$number_rows"; I agree your suggestion below should work as well, but I was desperate to find the error, so I tried several option to see whether DBI wi

Re: Strange behaviour while using DBI with binding

2010-08-17 Thread Uri Guttman
>>>>> "MC" == Mimi Cafe writes: MC> I experienced a strange behaviour while using DBI binding for MySQL query MC> with LIMIT clause. My CGI program behaved so strange and the result was MC> always unpredictable and it took me several hours before I f

Strange behaviour while using DBI with binding

2010-08-17 Thread Mimi Cafe
I experienced a strange behaviour while using DBI binding for MySQL query with LIMIT clause. My CGI program behaved so strange and the result was always unpredictable and it took me several hours before I finally detected the problem. In my program I use binding as in the example below

Re: Accessing array from Perl & DBI using Template Toolkit

2010-08-14 Thread MySelf rdtan.net
within it. > > Here is an example I've cobbled together quickly (using an email template): snip > I believe what you want to do is fetch the data from the db as a hashref > instead, and push the rows into an array to generate your loop topology. > untested... I haven

perl DBI problem while installing bugzilla

2010-08-11 Thread perl pra
> Hi All, > > I am having a problem while isntalling Bugzilla , Checksetup.pl throws > errors and exits.Below is the detail. > > when I run checksetup.pl in bugzilla folder I get the following error, > Though I have installed latest DBD-mysql which is available in CPAN. > > ERROR

Re: Accessing array from Perl & DBI using Template Toolkit

2010-08-11 Thread Steve Bertrand
that is different from how >> you retrieve data from the DBI. You turned that data into a hash of >> hash references when you did this: >> > You're absolutely correct about I'm confused. I can't differentiate > what's array & array references, hash &

Re: Accessing array from Perl & DBI using Template Toolkit

2010-08-10 Thread MySelf rdtan.net
able, so yes array, hash references > (or any reference that returns a list) but that is different from how > you retrieve data from the DBI. You turned that data into a hash of > hash references when you did this: > You're absolutely correct about I'm confused. I can't

Re: Accessing array from Perl & DBI using Template Toolkit

2010-08-10 Thread Dermot
On 9 August 2010 13:25, me @ wrote: > Hi, Hi, Not sure why you had to send this twice. I'm trying to pickup CGI web application programming using Perl, DBI & ... ... >>>> start of list.tt <<< > Content-type: text/html > > > [% PROCESS heade

Accessing array from Perl & DBI using Template Toolkit

2010-08-09 Thread me @
Hi, I'm trying to pickup CGI web application programming using Perl, DBI & TT (Template Toolkit). This small application is about storing data (using CGI::FormBuilder) list it using Template Toolkit. After retrieving records from MySQL using DBI, I've problem understanding how to pa

Re: DBI under SOAP/mod_perl

2010-07-20 Thread Dermot
Hi Octavian, On 19 July 2010 06:07, Octavian Rasnita wrote: > Does the $dsn contain the full path to the database? Yes. The dsn line is declared like this: #### DBI SQLite3 ### my $dsn = 'dbi:SQLite:dbname=/var/db/MyApp/myapp.db'; It's outside the constructor which I a

Re: DBI under SOAP/mod_perl

2010-07-18 Thread Octavian Rasnita
Does the $dsn contain the full path to the database? -- Octavian - Original Message - From: "Dermot" To: "Perl Beginners" Sent: Friday, July 16, 2010 7:29 PM Subject: DBI under SOAP/mod_perl Hello All, (This is perl, v5.8.8). Sorry if this is a bit s

DBI under SOAP/mod_perl

2010-07-18 Thread Dermot
Hello All, (This is perl, v5.8.8). Sorry if this is a bit specialised (EG not v. beginner) but I'm getting rather frustrated and could use some help. I have a strange issue with a DBI/DBD::SQLite. I have a class that creates an instance of DBI, EG: package Foo; use strict; use warnings

Re: Some DBI question -

2010-05-31 Thread John Scoles
On Sun, May 30, 2010 at 1:33 AM, newbie01 perl wrote: > Hi, > > Am trying out DBI for Oracle and just want to know if for example, I need > to > include column formatting stuff etc., is it best to just put them into a > .sql file and then execute the .sql file instead of p

Re: Some DBI question -

2010-05-30 Thread Chas. Owens
On Sun, May 30, 2010 at 01:33, newbie01 perl wrote: > Hi, > > Am trying out DBI for Oracle and just want to know if for example, I need to > include column formatting stuff etc., is it best to just put them into a > .sql file and then execute the .sql file instead of placing t

Some DBI question -

2010-05-29 Thread newbie01 perl
Hi, Am trying out DBI for Oracle and just want to know if for example, I need to include column formatting stuff etc., is it best to just put them into a .sql file and then execute the .sql file instead of placing them in the Perl DBI script? Also, is there anyway to sort of "hide" th

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread Rob Coops
question for the time being. Let's assume that I >> will >> > have to change @INC which is okay to do if I need to, but before I do, >> is >> > there any way to verify that DBI is installed at all? Will the simple >> > existence of the file DBI.pm e

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread newbie01 perl
gt; that will be my last option in case I really want to use OEM's Perl > > install. > > > > > > Let me re-phrase my question for the time being. Let's assume that I will > > have to change @INC which is okay to do if I need to, but before I do, is > &

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread Shlomi Fish
ill be my last option in case I really want to use OEM's Perl > install. > > > Let me re-phrase my question for the time being. Let's assume that I will > have to change @INC which is okay to do if I need to, but before I do, is > there any way to verify that DBI is ins

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread newbie01 perl
se my question for the time being. Let's assume that I will have to change @INC which is okay to do if I need to, but before I do, is there any way to verify that DBI is installed at all? Will the simple existence of the file DBI.pm enough to say that DBI is installed? As for the error mess

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-06 Thread Rob Coops
On Tue, Apr 6, 2010 at 2:06 PM, Shlomi Fish wrote: > Hi Chen, > > "newbie01 perl" has asked a question about Oracle and Perl 5/DBI. Would you > be > able to enlighten them? (Everyone should note that Chen is an Oracle DBA > and a > good friend of mine). Please

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-06 Thread Shlomi Fish
Hi Chen, "newbie01 perl" has asked a question about Oracle and Perl 5/DBI. Would you be able to enlighten them? (Everyone should note that Chen is an Oracle DBA and a good friend of mine). Please hit reply all as the @perl.org mailing lists accept replies from non-subscribers and oth

Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-06 Thread newbie01 perl
. Both of these require the DBI/DBD module. At the moment, am not allowed to do another install of Perl. I checked the OEM's .pl Perl scripts and just wrote a simple Perl script that has the use DBI; line on it and the full path to the Perl binary of the OEM install. Unfortunately, this does not

Perl error trapping help, for example DBI

2010-02-10 Thread newbie01 perl
Hi all, Just want to know if there is an alternative to these error "trapping" that am using for the following code: #!/usr/bin/perl use DBI; $dbh = DBI->connect('dbi:Oracle:host=localhost;sid=test1;port=1521', 'test1_user', 'test1_password'); if

Perl DBI Oracle SYSDBA help/advise please:

2010-02-10 Thread newbie01 perl
Hi all, To anyone who had been using Perl DBI and Oracle, can you please confirm if connection by SYSDBA works or doesn't? I currently have the following DBI / DBD installed on this problem: DBI Version : 1.43 DBD Version : 1.15 Unfortunately, am not the SA so can't just install

Re: Oracle DBI::ODBC and SELECT FOR UPDATE

2009-12-26 Thread Uri Guttman
>>>>> "TE" == Tony Esposito writes: TE> Has anyone successfully used, in Oracle, a 'SELECT ... FOR UPDATE' TE> using the Perl DBI:: ODBC? i can't answer that, but that is far from a question for the perl beginner's list. please post this in

Oracle DBI::ODBC and SELECT FOR UPDATE

2009-12-26 Thread Tony Esposito
Has anyone successfully used, in Oracle, a 'SELECT ... FOR UPDATE' using the Perl DBI:: ODBC?

Re: How to catch the DBI module error message

2009-11-09 Thread Parag Kalra
Thanks to All.. It did the trick for me - http://search.cpan.org/~timb/DBI/DBI.pm#$DBI::errstr<http://search.cpan.org/%7Etimb/DBI/DBI.pm#$DBI::errstr> Cheers, Parag On Mon, Nov 9, 2009 at 6:43 PM, Arun G Nair wrote: > On Mon, Nov 9, 2009 at 6:37 PM, Parag Kalra wrote: >

AW: How to catch the DBI module error message

2009-11-09 Thread Thomas Bätzler
Parag Kalra asked: [DBI] > However I just wanted to know if there is a way to catch this error > message through some standard DBI variable so that I can print it in a log > file You can use the errstr() class and instance methods to access the last error message. In order to stop

Re: How to catch the DBI module error message

2009-11-09 Thread Dermot
se :) > I am executing a Perl script which makes use of 'DBI' module. > > I am performing a select operation on a table through the Perl script and I > am getting following error on the console: > > DBD::ODBC::st execute failed: [Oracle][ODBC][Ora]ORA-00942: table or v

How to catch the DBI module error message

2009-11-09 Thread Parag Kalra
Hello All, This is my first post here. I am executing a Perl script which makes use of 'DBI' module. I am performing a select operation on a table through the Perl script and I am getting following error on the console: DBD::ODBC::st execute failed: [Oracle][ODBC][Ora]ORA-00942: tab

Re: DBI escape_string

2009-11-05 Thread jm
your last field included in the query ('msg') has an apostrophe in the middle of the text, as well as not be closed with a single quote before the entire string is closed with the double quote. you can't include an unescaped single quote inside a single-quoted string, nor can you include an unesca

DBI escape_string

2009-11-05 Thread cerr
Hi There, On http://www.codepedia.com/1/PerlDBITutorial I found that prepare() would escape a string. Now I have a query like this: "INSERT INTO logs (source, date, time, program, msg, inserttime) VALUES ('NovaxPRG-T0029', '2009-11-02', '09:51:11', 'NovaxPRG', 'NovaxPRG [931]: T0029: CRITICAL: cou

Re: DBI driving me nuts ... !

2009-10-29 Thread Pau Marc Munoz Torres
Have you tried to print @row? #!/usr/bin/perl use Mysql; $dbh = Mysql->connect("localhost"," > > mailscanner","root","c0nc3pt") or > die ("Error " . Mysql->errno . " - " . Mysql->errstr); > $sql = "SELECT to_address FROM maillog LIMIT 10;"; > $sth = $dbh->query($sql) or die ("Error " . Mysql->e

Re: DBI driving me nuts ... !

2009-10-07 Thread Jenda Krynicky
> Please can you advise ? > > #!/usr/bin/perl > > use Mysql; > > $dbh = Mysql->connect("localhost","mailscanner","root","c0nc3pt") or > die ("Error " . Mysql->errno . " - " . Mysql->errstr); > ...

Re: DBI driving me nuts ... !

2009-10-06 Thread Shawn H Corey
Gregory Machin wrote: > Hi > Please can you advise ? > > #!/usr/bin/perl use strict; use warnings; > > use Mysql; > > $dbh = Mysql->connect("localhost","mailscanner","root","c0nc3pt") or > die ("Error " . Mysql->errno . " - " . Mysql->errstr); my $dbh = ... > $sql = "SELECT to_address FROM m

DBI driving me nuts ... !

2009-10-06 Thread Gregory Machin
Hi Please can you advise ? #!/usr/bin/perl use Mysql; $dbh = Mysql->connect("localhost","mailscanner","root","c0nc3pt") or die ("Error " . Mysql->errno . " - " . Mysql->errstr); $sql = "SELECT to_address FROM maillog LIMIT 10;"; $sth = $dbh->query($sql) or die ("Error " . Mysql->errno . " - " .

Re: Limit on number of columns pulled using DBI::ODBC

2009-10-05 Thread Tony Esposito
e of using row_num instead of LIMIT (which I believe is MySQL)?   thanks --- On Wed, 30/9/09, Steve Bertrand wrote: From: Steve Bertrand Subject: Re: Limit on number of columns pulled using DBI::ODBC To: "Tony Esposito" Cc: "Beginners Perl" Date: Wednesday, 30 September,

Re: Limit on number of columns pulled using DBI::ODBC

2009-09-30 Thread Steve Bertrand
Tony Esposito wrote: Please try to fix your email application (Yahoo) to wrap lines at ~76 chars per line ;) > I am trying to retrieve all columns and some (not all) rows from an Oracle > table which contain - among other things - 2 CLOB columns and print this to a > flat file (ASCII file). >

Re: Limit on number of columns pulled using DBI::ODBC

2009-09-30 Thread Tony Esposito
am running on WindowsXP SP2 and using the DBI::ODBC driver with the Oracle Client ODBC driver. The SQL statement is just SELECT * FROM table, nothing fancy here.  I just believe that the data is 'too big/wide' for the variables I am using to hold them and that is why I am leani

Re: Limit on number of columns pulled using DBI::ODBC

2009-09-30 Thread Steve Bertrand
Tony Esposito wrote: > Is there a limit on the number of columns pulled from a table using DBI::ODBC? Although I just received your own reply to this message, I'll respond to this one as I have some questions. > I am getting an 'out of memory' error if I try to retrie

Re: Limit on number of columns pulled using DBI::ODBC

2009-09-30 Thread Tony Esposito
I notice the behaviour changes as I adjust the following parameter ...  $dbh->{LongReadLen} = 2; This is an Oracle database I am going against - version 10gR2 --- On Wed, 30/9/09, Tony Esposito wrote: From: Tony Esposito Subject: Limit on number of columns pulled using DBI::ODBC

  1   2   3   4   5   6   7   8   9   10   >