RE: Suggest an approach for multi-statements?

2011-03-03 Thread Ian Harisay
One thing you can do to speed up your current program is to simply pass a reference instead of a value. Try this instead. my $tablename = $sth-bind_col(1, my \$tablename); While($sth-fetch){ $dbh-do(drop table $db.$tablename) || die $sth-errstr; } -Original Message- From:

RE: Suggest an approach for multi-statements?

2011-03-02 Thread Ian Harisay
Threading your table drops could be problematic if you are dealing with foreign key constraints. If constraints won't get in the way, just create a threaded program to execute multiple statements at a time. Are you just cleaning out a database? Is speed really a factor here? Please better

RE: dbi transactions error handling

2010-09-20 Thread Ian Harisay
I think you would be better off to write it like this. $dbh-{RaiseError} = 0; $dbh-{PrintError} = 0; $dbh-{AutoCommit} = 0; my @record = ($row_id, $file_id, $offset, $country, $date_day, $campaign, $leaf_id, $status_id); my $rv; SWITCH: { last unless($rv = $sql_live-execute(@record)); last

RE: PERL DBI ORACLE DATABASE OUTPUT TO A FILE

2010-05-11 Thread Ian Harisay
I like using Text::CSV_XS for this sort of thing. If your columns in your select are ordered properly you could try the following. use Text::CSV_XS; use IO::File; my $csv = Text::CSV_XS-new({binary=1, eol=$/, always_quote=1}); my $fh = IO::File-new(somefile.csv); if(defined $fh){ my $sth

RE: Looking for clever solution: Different versions of Oracle .so files within single Perl build

2009-12-14 Thread Ian Harisay
Have you considered using database links? Instead of 2 connections, you could just do everything thru oracle 10. -Original Message- From: jeff [mailto:j...@roqc.no] Sent: Monday, December 14, 2009 5:19 AM To: dbi-users@perl.org Subject: Looking for clever solution: Different versions

RE: Problem catching exceptions

2009-08-25 Thread Ian Harisay
I wouldn't even use the eval block. Set PrintError and RaiseError to 0. Try something along these lines. my $rv = $dbh-do( EOS); UPDATE ? set $attribute = $value WHERE decimal_latidude = $dLat ANDdecimal_longitude = $dLon AND image_date = to_date('2008-03-05',

RE: Recurse gives me No more handles

2009-01-20 Thread Ian Harisay
Is your dataset too large to hold in memory? Another approach would be load each result set into memory. From: don.walt...@falconjet.com [don.walt...@falconjet.com] Sent: Tuesday, January 20, 2009 10:39 AM To: dbi-users@perl.org Subject: Recurse gives

RE: Configure DBI logging to be more specific.

2009-01-15 Thread Ian Harisay
An example of your code would be very helpful. -Original Message- From: Deviloper [mailto:devilo...@slived.net] Sent: Thursday, January 15, 2009 6:56 AM To: dbi-users@perl.org Subject: Configure DBI logging to be more specific. Hello, I am using DBI and relativly new to it. I get a

RE: security advice needed

2008-11-12 Thread Ian Harisay
The fact that you're using placeholders will prevent an SQL injection attack from happening. You're good to go. -Original Message- From: James H. McCullars [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2008 1:27 PM To: dbi-users@perl.org Subject: security advice needed Hi, we

RE: Recursive SQL query?

2008-04-15 Thread Ian Harisay
Yes. This isn’t really the right place to ask a design question. So, I hope I don't get blasted for answering here. First, I don't think you quite know what you're trying to solve yet. But to help with what you have here, I think you're going to need a stored procedure that returns your

RE: question for DBD-Oracle driver

2008-03-28 Thread Ian Harisay
perl -e 'use DBD::Oracle 42' This will tell you what version is currently installed. Generally, I always refer to the man page first. But, I didn't see versioning info available in the DBD::Oracle man page. Probably an oversite on my part. -Original Message- From: John Scoles

RE: Accessing Remote LOBs in Oracle

2008-03-05 Thread Ian Harisay
Have you tried handling this thru a stored procedure? I think that would make the database link transparent to you. -Original Message- From: Eric Simon [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 1:13 PM To: dbi-users@perl.org Subject: Accessing Remote LOBs in Oracle Hi,

RE: Using to_dsinterval or INTERVAL with placeholder

2008-02-12 Thread Ian Harisay
Sorry, I haven't tried anything to test what I am about to recommend. It doesn't look like you got your answer though. I think you want your insert statement to look like this: $db-do(EOS,{},1,'0 03:00:00') insert into batch_application_sla (job_id, job_duration)

RE: missing records while running a query using DBI

2008-02-07 Thread Ian Harisay
I don't see how you are getting your results. Are you doing something along these lines? Note: You should always use a placeholder with your variables. It is safer. Use Data::Dumper; $query = qq{ SELECT item.* FROM tmp_loadplan_items item,tmp_loadplans loadplan

RE: Multiple queries (SQL) in 1 connection instance

2007-08-30 Thread Ian Harisay
$dbh_pg = DBI-connect ( DBI:Pg:host=$pg_server_name; port=$pg_server_port, database=$pg_default_db, $pg_user, $pg_passwd, {RaiseError = 0, PrintError = 0} ); $dbh_pg-do(EOS,{},$to_datetime, $table_name) || die $dbh_pg-errstr; update sync_log set

RE: Trouble Installing DBD::ODBC with postgresql

2007-07-13 Thread Ian Harisay
Why not use DBD::Oracle if you are moving to a Oracle server. -Original Message- From: Craig Metzer [mailto:[EMAIL PROTECTED] Sent: Friday, July 13, 2007 1:12 PM To: Alexander Foken Cc: dbi-users@perl.org Subject: RE: Trouble Installing DBD::ODBC with postgresql Yes Alexander, I'm

RE: Updating counts

2007-03-30 Thread Ian Harisay
I don't know if that would be speedy. Updates are far more expensive than an insert. It does sound portable and safe though. -Original Message- From: Tim Bunce [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 9:47 AM To: Ronald Kimball Cc: George Bills; dbi-users@perl.org

RE: Updating counts

2007-03-30 Thread Ian Harisay
From what I see you may want more than one table. One that stores your log information. This table might contain log date,logged by,log statement, etc.. Then create another table that summarizes/counts how many times you find whatever it is you wish to count. For instance, if it is a

RE: DBI Number of fields

2007-02-22 Thread Ian Harisay
You should first make sure your query runs outside of Perl. -Original Message- From: Brian Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, February 22, 2007 10:22 AM To: dbi-users@perl.org Subject: DBI Number of fields Hey Folks - We are having a problem with a script that uses DBI

RE: Touble With Dates

2006-05-26 Thread Ian Harisay
I would only add that I believe the to_char method is more expensive because you are taking temporal data, converting it to a string representation and then doing a string comparison. Really not a big deal but this can be quite expensive with large data sets. Then again with a large data set

RE: select placeholder

2005-12-11 Thread Ian Harisay
Try SELECT * FROM a1 WHERE custnum = ? -Original Message- From: John [mailto:[EMAIL PROTECTED] Sent: Saturday, December 10, 2005 10:40 PM To: dbi-users@perl.org Subject: select placeholder Hi Can anyone see the error in the following code. It has to do with the placeholder in the

DBD::Oracle

2005-11-29 Thread Ian Harisay
Hi, I am upgrading my Oracle client. This probably means I need to recompile DBD::Oracle. Correct? Thanks, Ian

RE: Logging Question

2005-11-09 Thread Ian Harisay
I would look to using Log::Log4perl for all your logging needs. But for what you are doing try setting $| = 1 (autoflush). From: Vergara, Michael (TEM) [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 09, 2005 1:25 PM To: dbi-users@perl.org Subject: Logging

RE: need help to know the column names and data types

2005-09-30 Thread Ian Harisay
You'll want to look for metadata in the man pages of the DBI. You'll also want to make sure your particular DBD supports the DBI calls. -Original Message- From: Umesh Barik [mailto:[EMAIL PROTECTED] Sent: Friday, September 30, 2005 5:36 AM To: dbi-users@perl.org Subject: need help to

Re: Subclassing the DBI - any good examples?

2005-09-27 Thread Ian Harisay
I subclassed the DBI to: -implement logging (log4perl) -password retrieval I experienced no problems subclassing the DBI. The DBI is very well constructed. I still remember using oraperl and sybperl (shudder). Thanks for all you do Tim, et al. -Ian

Re: Cycling through open handles

2005-06-15 Thread Ian Harisay
If you are using a connection pool you could. Haven't done it with Perl but I did do it with Java. Sam Tregar wrote: Hello all. Is there a simple way to cycle through all open database handles, without needing to know anything about them before-hand? Something like: foreach my $dbh

RE: Perl Performance Help.

2005-05-12 Thread Ian Harisay
Again, what DBMS are you using. You should also try your sql outside of Perl. The problem may lie with the DBMS. For instance there are ways to optimize your queries in Oracle using hints. Also, unindexed columns used in your where clause will cause a full table scan and worse. The Perl DBI

Re: Perl Performance Help.

2005-05-12 Thread Ian Harisay
try: my $stime = time; while( @each_record = $stmt_handle-fetchrow){ last; } print time - $stime,$/; If this takes 2 minutes then your problem is with your database, not Perl. Which means you'll need to look at query optimization. Not code optimization. Your query optimization may also include

Re: Select Statements using a Formatted Date

2005-05-11 Thread Ian Harisay
what database? Denesa K Shaw wrote: Hi, How do get the date to be in the format like this? mm/dd/ hh24:mi:ss When I run this code It prints: START TIME: 01-JAN-05, END TIME: 02-JAN-05 Thanks in advance! Here is what I have: my $sql = qq{SELECT MIN(RELOAD_FILE_TS),MIN(RELOAD_FILE_TS)+ 1

Re: Spreadsheet::WriteExcel question

2005-05-10 Thread Ian Harisay
In that case using Data::Dumper is quite nice for figuring those types of things out. Robert wrote: On 5/9/05 9:39 PM, in article [EMAIL PROTECTED], Ian Harisay [EMAIL PROTECTED] wrote: This is really off topic. Not so. I was more interested in how the fetchrow_arrayref works (or wasn't

RE: /usr/bin/ls: 0403-027 The parameter list is too long

2005-05-09 Thread Ian Harisay
Try something like this instead. You should always use native perl calls to get the job done. Also, this isn't something to discuss in the dbi-user list. opendir(DIR, $dirname) or die can't opendir $dirname: $!; while (defined($file = readdir(DIR))) { if( -f $dirname/$file $dirname/$file

RE: Spreadsheet::WriteExcel question

2005-05-09 Thread Ian Harisay
This is really off topic. -Original Message- From: Robert [mailto:[EMAIL PROTECTED] Sent: Mon 5/9/2005 1:45 PM To: dbi-users@perl.org Subject: Spreadsheet::WriteExcel question My ignorance is showing. : ) I am pulling data out of Oracle and putting it into an Excel spreadsheet.

having a problem with trailing spaces

2005-04-19 Thread Ian Harisay
Hi All, I am having problem with spaces. I am loading data from a normalized schema into a denormalized table. Many of the fields I am copying originally come from free form fields and we don't attempt to clean them up at all. What we grab in the form is what we enter into the database. The

Re: Sending Mail

2005-03-25 Thread Ian Harisay
Also, I would recommend you consider using placeholders for all values passed to your prepare statement. eg. my $sth = $dbh-prepare('SELECT email_address FROM users WHERE email_address = ?') || die $dbh-errstr(); $sth-execute($email) || die $dbh-errstr(); but looking at your query I

Re: Sending Mail

2005-03-25 Thread Ian Harisay
Also, I would recommend you consider using placeholders for all values passed to your prepare statement. eg. my $sth = $dbh-prepare('SELECT email_address FROM users WHERE email_address = ?') || die $dbh-errstr(); $sth-execute($email) || die $dbh-errstr(); but looking at your query I

Re: Misunderstood use of Getopt::long

2005-03-25 Thread Ian Harisay
This is the wrong forum for this kind of question. But try this instead it will give you a much clearer picture. use Getopt::Long; use Data::Dumper; my %optctl; Getopt::Long::GetOptions(\%optctl, 'x!', 'z!') or die \nOption Error\n\n; print Dumper(\%optctl),$/; Vergara, Michael (TEM)

RE: NULL field matching problem...

2005-03-16 Thread Ian Harisay
after you populate @data you can do: (code is untested, but I think I have it right) foreach(@data){ $_ = undef if $_ =~ /^$/; } NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] 03/16/2005 9:57:03 AM That sounds good, but I am a little confused on exactly how to achieve that. I'll start

Re: Issue with inserting dates

2005-01-26 Thread Ian Harisay
Which database are you using? Moreno, Javier [EMAIL PROTECTED] 01/26/2005 9:43:45 AM All, I have the following code: $::sql = INSERT into MASTER_Issue; $::sql.= (idIssue, Description, OpenDate, DueDate, idStatus, idPriority, idSeverity, SortDate); $::sql.= VALUES

Re: Subclassing DBI, and PrintError messages

2004-11-18 Thread Ian Harisay
. =back =head1 AUTHOR Ian Harisay, [EMAIL PROTECTED] Copyright (c) 2003 NuSkin Intl. All rights reserved. =cut package

Re: Subclassing DBI, and PrintError messages

2004-11-18 Thread Ian Harisay
Let me apologize. I did not mean to send an attachment to the list. Originally I attached my pm and then decided that I shouldn't do that. I then pasted it into the body of the email but forgot to unattach the file before sending. Sorry Ian Harisay [EMAIL PROTECTED] 11/18 9:55 am I

Off Topic Question

2004-11-15 Thread Ian Harisay
Hi All, Can anyone direct me to a Perl/MySQL shopping cart solution? I would like to use Authorize.net or Verisign as my gateway. Since this is off topic, please reply directly to me. I don't want to clutter the list with this subject. Thanks, Ian

need help capturing an error

2004-11-03 Thread Ian Harisay
Hi All, I have a query that when executed in sqlplus I get the oracle error ORA-02395: exceeded call limit IO usage. But when I execute the same query thru the DBI I am not capturing the error. $sth just doesn't have a result set and does not tell me oracle errored out. Thanks for any

Re: difficulties with utf-8 characters using DBD::Oracle, where works using DBD::Pg (PostgreSQL)

2004-10-15 Thread Ian Harisay
Actually, I have had a similar problem. I can read utf8 characters from the database but can't put them in the database using Perl. My system data is: Fedora Core 1, Perl 5.8.1, DBI 1.43, DBD::Oracle 1.15, Oracle client 9.2.x. Peter J. Holzer [EMAIL PROTECTED] 10/15 4:29 am On

Re: DBD::CSV and large files...

2004-09-20 Thread Ian Harisay
Text::CSV_XS will handle what you want to do just fine. You could do: while(my $rec = $sth-fetchrow_arrayref()){ print OUTFILE $csv-combine(@{$rec}),$/; } If you are pulling large amounts of data across your network, look at doing some optimization by setting RowCacheSize in the DBI to

Re: batch update

2004-09-10 Thread Ian Harisay
Which line is 388? Also, you would be much better off using placeholders. xaver biton [EMAIL PROTECTED] 09/10 5:56 am Hi, I'want to write a script which update a DB in Internet. from thr local DB I do a select query and while the select query run foreach row I do a UPDATE query:

Re: batch update

2004-09-10 Thread Ian Harisay
})) || die $dbh-errstr(); } I added the die statement just as an example that you should test for errors. You can also capture the result if it is needed. Oh, and sorry, I didn't see that you did note where line 388. Just doing this may solve your problem. Ian Harisay [EMAIL PROTECTED] 09/10 11:11

Re: Large SQL statements...

2004-09-07 Thread Ian Harisay
Sorry about this. My groupwise client has a nasty habit of taking all my formatting out. If you like I can send an attachment to you. Just let me know.-Ian Ian Harisay [EMAIL PROTECTED] 09/07 8:33 am A good approach is to to define your dataset. You are just using a CSV so I

Re: inserting into mysql single element from an array

2004-09-01 Thread Ian Harisay
Are you sure you don't have any spaces after EOF? Also, if it is just bugging out on you, you could rewrite as:my $sql = INSERT INTO .. (...,...,...) VALUES(?,?,?,...);foreach my $values (@array){ $dbh-do($sql,undef,@$values);}Also, don't know if this is your actual code, but it is a

Re: How to use sequences in DBI/DBD::Oracle with bind

2004-08-31 Thread Ian Harisay
try $data = 'bar';$sth-prepare (insert into foo (my_id, data) values(my_id_seq.nextval,?));$sth-execute($data);What you are doing below is passing the string value my_id_seq.nextval to the field my_id. Jean-Pierre Utter Lfgren [EMAIL PROTECTED] 08/30 10:19 pm Does anybody

DBI, Oracle and Pro*C

2004-08-17 Thread Ian Harisay
I'm working on a PERL project at work, but my boss wants me to do just enough in Pro*C that it won't integrate with my PERL designs. Is anyone aware of any PERL/C extentions that allow Pro*C functions to be called by PERL? Thanks, Ian

RE: Best Way to Auto Increment with Oracle

2004-06-16 Thread Ian Harisay
I would disagree with this last statement. you are gauranteed to get the correct value from $seq.currval in a non-threaded environment and your session is not shared by anything else. And if you are threading (say in Java. I still don't with perl) I would hope that each of

possible memory leak

2004-06-14 Thread Ian Harisay
Hi All, I am using Fedora Linux Core 1 and redHat 8.0 oraclie client 9.2.0.1.0 DBI 1.37 DBD::Oracle 1.15 I seem to have a memory leak problem when using bind variables and the same prepared statement for hundreds of thousands of rows. Below is my function call. For my test I have only one

RE: need to pull multi-byte out of a varchar2 field

2004-05-19 Thread Ian Harisay
. -Original Message- From: Ian Harisay [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 19, 2004 4:27 PM To: [EMAIL PROTECTED] Subject: need to pull multi-byte out of a varchar2 field Hi, Can anyone tell me how to pull multi-byte characters out of a varchar2 field. The database

RE: need to pull multi-byte out of a varchar2 field

2004-05-19 Thread Ian Harisay
BioPharma, Inc. -Original Message- From: Ian Harisay [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 19, 2004 4:27 PM To: [EMAIL PROTECTED] Subject: need to pull multi-byte out of a varchar2 field Hi, Can anyone tell me how to pull multi-byte characters out of a varchar2

(Fwd) Re: The official word on Oracle 9i support in DBD::Oracle

2004-01-14 Thread Ian Harisay
Hi, What I have had to do to take care fo this problem is copy the rdbms directory over from another linux box that I has a full install of Oracle. Not just the client. I copied it over to the box I just wanted my Oracle client and it worked beautifully after that. System info is: OS: RedHat

Refreshing a database from another

2003-12-16 Thread Ian Harisay
Hi, I know this isn't the right place to post the message, so I apologize in advance. I need to refresh one oracle database from another. The schemas are the same. The only thing I need to refresh is the data in the tables. Can anyone point me to a website or book that would cover this.

Re: SQL statement to find and delete double entries

2003-09-23 Thread Ian Harisay
How about if you put a proper constraint on the table. Then it really doesn't matter how elegant you are in cleaning up your data, since the it should only happen once. -Ian Christian Merz wrote: Hello, i am definitely sure that the statement below would mess up your data. The rowid is an

SQL Parser

2003-09-08 Thread Ian Harisay
Hi, Does anyone know if a SQL tokenizer/parser has been written. We have a need for extracting sql from our logs and then doing some reporting on it. We need to gleen table info and such from statement. Thanks, Ian

Re: fetchrow_hashref doesn't work for me!

2003-09-02 Thread Ian Harisay
I work with both MySQL and Oracle. As a standard practice I will write fetchrow_hashref('NAME_lc'). This forces all column names to be lower case. Thomas A. Lowery wrote: On Mon, Sep 01, 2003 at 09:38:04PM +0300, [EMAIL PROTECTED] wrote: The case of the column is correct. This does work

Re: Oracle and prepare_cached question

2003-08-21 Thread Ian Harisay
You have to cycle individually thru your account list. The following should work fine. my $sth = $conn-prepare_cached(q{SELECT DISTINCT ID, NAME from CUSTOMERS where ID in (?)}); my $recs = []; foreach my $acct_id (701,705,751,754,749,755,756,757,758,780){ $sth-execute($acct_id); while( my

Looking for a mail list about advanced OOP for Perl

2003-08-19 Thread Ian Harisay
Hi All, Forgive me for asking this question here. I went thru the mail lists on perl.org and don't see the appropriate list for my topic of discussion. Can anyone point me to the correct mail list for advanced OOP discussion? Thanks, Ian

Checking your database connection

2003-08-07 Thread Ian Harisay
Hi, What is a convenient way to assert that the database connection you have been working with is still valid? Thanks, Ian

follow up with oracle linked tables

2003-07-18 Thread Ian Harisay
Hi, This is a follow up with my problem on trying to use linked tables in my query. I have a problem with this on my Linux box (rh8). I do not have a problem with this on my Sun box. My perl modules are at the same version level on both boxes. The only difference I can see is with the

Re: follow up with oracle linked tables

2003-07-18 Thread Ian Harisay
would think so. Is the two_task environmental variable set? You may also want to try using DBI-trace and see what that gives you. Thanks, Sam Gold -Original Message- From: Ian Harisay [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 2:58 PM To: Gold, Samuel (Contractor) Subject: Re

Oracle error being thrown

2003-07-15 Thread Ian Harisay
Hi All, I am using the dbish for some adhoc querying and am running into an error and I am not sure why. This will work fine with sqlplus. The query is: SELECT DISTINCT aig.grp_seq_id, aig.rowid, aig.transaction_cd, gta.list_nam AS list, aig.email_addr AS emailaddr,

Re: writing errors to a file.

2003-07-03 Thread Ian Harisay
Well, this is an oversite on my part. Thank you for pointing this out. I am going to have to go thru some of my code and turn this off. Hardy Merrill wrote: Michael A Chase [EMAIL PROTECTED] wrote: On Tue, 01 Jul 2003 16:12:09 -0600 Ian Harisay [EMAIL PROTECTED] wrote: Doing

forcing DBD::Oracle to install

2003-07-03 Thread Ian Harisay
Does anyone know how to force the install of DBD::Oracle? What needs to be added to this command? perl -MCPAN -e 'install DBD::Oracle' Thanks

Re: writing errors to a file.

2003-07-02 Thread Ian Harisay
that something is wrong. All the other stuff in the script gets logged. Michael A Chase wrote: On Tue, 01 Jul 2003 16:12:09 -0600 Ian Harisay [EMAIL PROTECTED] wrote: Doing the redirect can be a bit clunky. If you want to be more precise with how you handle these errors, add this $attr to your connect

Re: writing errors to a file.

2003-07-01 Thread Ian Harisay
Doing the redirect can be a bit clunky. If you want to be more precise with how you handle these errors, add this $attr to your connect statement. my $attr = { PrintError = 0, RaiseError = 1, AutoCommit = 0 }; my $dbh = DBI-connect( @{$login}, $attr ) or die Can't connect to Oracle database:

Re: Query formatting problem

2003-06-19 Thread Ian Harisay
I did this example with a Oracle connection. I am using the quote method from my database handle. The quoting will be specific to your database. I just tried it with MySQL. No problem there either. What db are you using? What errors is it throwing? Steven Lembark wrote: replacing ? for '500'

Re: Query formatting problem

2003-06-13 Thread Ian Harisay
Hi, Here is a code snippet that will accomplish your desired task. This is not meant to be generic. It does have some limitations. It will satisfy the problem presented. How you integrate it with you code will be up to you. Regards, Ian #!/usr/bin/perl use strict; use DBI; my @login =

Re: Vague DBI Error

2003-06-09 Thread Ian Harisay
How large did the file get when you were dumping 4.7 million rows? Did you exceed the max file size for your OS? Igor Korolev wrote: Your Terminated did not come from DBI. Your process got SIGTERM signal from some monitoring process or an administrator. -Original Message- From: Jamin

Re: Determining return type in Perl/MySQL

2003-05-29 Thread Ian Harisay
I read the other responses. It is hard to determine what is happening without seeing some code. but to simply determine if something is a numeric value on could just use a regular expression: ($rv) = $sth-fetchrow_array(); if( $rv =~ /^[^0-9\.]*$/ ){ #-- the regex will work with unformatted

spooling with dbish

2003-04-02 Thread Ian Harisay
Hi all, Can the output of my query be saved to a file when using dbish. If so, how do I do this? Thanks, Ian

Re: db to passwd comparison

2003-03-27 Thread Ian Harisay
Have you evaluated exactly what your split is handing you and also exactly what is in the database? You say maybe a 10th of the time you don't see the result you expect. Could this be due to rogue characters introduced in your db or file data. Since what you are printing when you don't find a

Re: MySQL DBI Problem.

2003-03-24 Thread Ian Harisay
One way to handle this is to validate what you just inserted into the database. Once you are sure of the success of your insert then delete it from the pop server. I don't know how light weight you trying to keep your program. This would certainly add some overhead not only to your database

Re: need some advice

2003-03-10 Thread Ian Harisay
Are you not listening to these people giving you helpful advice? Use the placeholders. I gaurantee you will be glad you did. C'mon man!!! Embrace the change. Rob Benton wrote: There won't be any ['] (read that as reg. expression) inside the fields so that's not a problem. All I need to do

Re: need some advice

2003-03-10 Thread Ian Harisay
. foreach ( $cgi-param() ){ $sql .= $_,; $val .= ?,; push(@{$array_ref}, $cgi-param($_)); } $sql =~ s/,$/) /; ## strip the last comma and add a closing paren. $val =~ s/,$/)/; my $sth = $dbh-prepare($sql.$val); my $result = $sth-execute($array_ref); $dbh-commit(); ## if autocommit is not on. Ian Harisay

Re: DBD::Oracle problem.

2003-02-25 Thread Ian Harisay
Sounds to me like you need to install the oracle client and then recompile DBD::Oracle. [EMAIL PROTECTED] wrote: Hello all, I am trying to run a perl script that from one host has to access a database running on another host. I am encountering some troubels here, that I have a workaround for

Re: Encryption module

2003-02-25 Thread Ian Harisay
Well, the camel book has an example that works well for passwords and such. As far as encryption packages, just search for crypt on the cpan. Nilanjan Das wrote: Hi, Can anyone tell me some of the Perl packages used for Encrypting or Decrypting some data mostly strings using some Public and

Re: DBD:Oracle holding on to cursors ?

2003-02-10 Thread Ian Harisay
Are you explicitly closing your statement handles and explicitly committing? If you are running endlessly and not committing it will lock your tables until that commit happens. There is more to it than just this. The other things to cover are on the DBA side. [EMAIL PROTECTED] wrote: Hi,

RE: MySQL question

2003-02-07 Thread Ian Harisay
just install DBI and DBD::mysql You should be good to go from there. Dan Muey [EMAIL PROTECTED] 02/07/03 10:12AM Those are three different modules. You'll only need one and if any of the others are needed for it to work it will tel you on install. I use DBI, it's pretty cool. -Original

Re: DBD-Oracle-1.12 w/ 8.1.7 on Solaris

2003-02-04 Thread Ian Harisay
I had a similar problem with Oracle 9i on Linux. I installed the 9i client only on my box. This did not give me all the oracle files I needed. I ended up copying the rdbms directory from a full Oracle install to my box. This gave me everything I needed to install the DBD::Oracle module.

Re: DBI and DBD not found

2003-02-04 Thread Ian Harisay
if the OS upgrade your version of Perl then you will find you have two distributions of perl on your system. your @INC most likely only reflects the new dist. If this has occurred, you probably have to go thru the pain of reinstalling your modules. Do a perl -v to see your current version of

spooling dbish

2003-02-04 Thread Ian Harisay
Is it possible to spool your output from the dbish to a file? Thanks.

Re: DBD::Oracle on Mac OS X

2003-01-24 Thread Ian Harisay
depends on the shell you are using. If you are using bash, for instance, put this line in your .bash_profile. export ORACLE_HOME=/opt/oracle (or where ever your oracle home actually is) then at the command line type: source .bash_profile that will update your environment for that shell. to

need help with installing DBD::Oracle

2003-01-23 Thread Ian Harisay
Hi, I migrated to a new box. I am running redhat 8.0 and Oracle client 9.2.0. the DBD::Oracle install is failing. I seem to remember seeing some discussion in the past about a problem with the Oracle 9.x client and DBD::Oracle.pm. If anyone out there can assist me, please please do. What

can't compile DBD::Oracle on redhat 8.0

2003-01-14 Thread Ian Harisay
Hi All, I am migrating hardware. My old system has redhat 7.3 on it. The new one is rh8. I am getting compile errors when I try to make DBD::Oracle. I did copy my oracle client from my old box. I'm wondering if that might be the problem. Any help is very welcome. Thanks, Ian Using DBI

please direct me to the right discussion group.

2003-01-08 Thread Ian Harisay
Hi All, I apologize for using this group to get this message out. I'm looking for a discussion group that would cover build management tools for perl. I am not referring to a makefile. I work for a company that is predominantly java. We are using ant to build and deploy applications to the

selecting a range of records from my result set

2003-01-07 Thread Ian Harisay
Hi all, This is really a mysql question rather than a dbi question. So, I apologize to everyone in advance. In mysql is it possible to retrieve records 50-75 from your result set? Say my result set is 20,000 records. I would like to do this and provide an index for the client to walk thru. I

RE: What's more Efficient - or/in

2002-11-08 Thread Ian Harisay
The number of elements allowed for an IN statement is governed by Oracle. I run into this problem here. I hit different DBs and they are managed differently. So, I run into this problem from time to time. 1 DBA allows me a 1024 entries and another decides to only allow for 256. You can get

Re: Session management in cgi/perl

2002-10-08 Thread Ian Harisay
Look at (or buy) Paul Dubois's Mysql and Perl for the web. I am working on a mgr based on Pauls examples. It isn't ready for primetime yet though. -ian vikas mehta [EMAIL PROTECTED] 10/08/02 07:09AM Can anyone help me how to maintain user session using perl scripts Are there any online

Off topic question on data modeling tools

2002-08-15 Thread Ian Harisay
Hi, Is anyone out there using a RDBMS data modeling tool on Linux. I've looked around but haven't found anything. Thanks in advance for the help. -Ian

RE: best way to insert date/time into oracle table

2002-06-14 Thread Ian Harisay
Are you using this for just a timestamp for record insertion? If so, SYSDATE is your best bet. You can use SYSDATE like so: prepare(insert into table1 (field1, field2, timestamp) values(?, ?, SYSDATE)); execute(Harry, Potter); Your execute statement can then be looped through with different

Re: Fw: mysql query statement

2002-06-10 Thread Ian Harisay
(1) should not be valid either. first_name is not part of your select statement. So, how would you be able to order your result set with it? I think what Hytham wants to do here is dynamically build an SQL statement. Your SQL string should be built before you try to prepare it. -Ian Paul

Re: can I reuse database connections?

2002-05-24 Thread Ian Harisay
yes. It stays intact just fine, until you do something like $d-finish; or $d-disconnect; -Original Message- From: Rory Campbell-Lange [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 5:29 AM To: [EMAIL PROTECTED] Subject: can I reuse database connections? I'm new to the list. I'm

Dynamically generating column headers

2002-05-21 Thread Ian Harisay
Hi, Does anyone know how to generate column headers for output based on the SQL. my $sth = $dbh-prepare(SELECT field1, field2 FROM table1); $sth-execute; print $headers ## how would I do this based on the fields returned?? while ( my $rec = $sth-fetchrow_arrayref ){ print join(, , { $rec } ),

Re: Dynamically generating column headers

2002-05-21 Thread Ian Harisay
++) { print $sth-{NAME}-[$i-1]\t; } print \n; # to return at the end There's probably a more elegant way to do that with attributes but that's how I outputted the column names. Hope this helps, Gordon -Original Message- From: Ian Harisay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 11

Re: SQL stuff

2002-05-20 Thread Ian Harisay
You can't use 'class' in your where clause. Brian Avis wrote: So is there any reason why I can't run this through DBI? SELECT ecls_code || '-' || ecls_long_desc AS class, id_number, last_name || ', ' || first_name AS name FROM

Re: Off Topic Question...

2002-05-04 Thread Ian Harisay
drop the index on that column and then add a non-unique index. NIPP, SCOTT V (SBCSI) wrote: Sorry for posting a slightly off topic question, but I am having trouble figuring out how to do something basic. I have a MySQL database that has a UNIQUE column in a table. My problem is that I

  1   2   >