Proposing an API for the extension for simplifying database connections

2005-01-13 Thread David Nicol
That's what DBI wrappers do, and I have one of those too. But my DBI wrapper reads its connection information for each logical data source from a hash. Then there's a build_dsn() method that assembles the pieces according to the name of the driver. If each DBD did that for me, I

cacheing problem

2005-03-28 Thread David Nicol
I am using dbd::mysql on activestate perl 5.8. When I select a row in my program, change the row using the mysql administrator tool, and select the row again in the program, the results are not changed. I can get the new data by selecting a different row, then selecting the changed row again,

Re: cacheing problem

2005-03-29 Thread David Nicol
It appears that DBI/DBD is caching the results. How can I disable this? the problem was not in DBI. In case anyone else has this non-problem, my PEBKAC was that user-provided data, which was current with the previous fetch, was replacing the data from the newer fetch. Disabling this for

Re: inserting data coming from a hash

2005-04-21 Thread David Nicol
On 4/21/05, Robert [EMAIL PROTECTED] wrote: This is my hash structure: Veterans Day = { date= '2005', type= 'US', federal = 'true', active = 'true', }, Would I just use a placeholder (?) in my statement and pass it in via that? It will be in a loop as I

Re: DBI v2 - The Plan and How You Can Help [DRAFT]

2005-07-05 Thread David Nicol
On 7/2/05, Dean Arnold [EMAIL PROTECTED] wrote: - Asynchronous queries (coroutines? threads?) Threads. If you've ever done much Java/JDBC work, you'll realize how much simpler a solution to async it is. (Ignoring the rest of Java/JDBC's undesirable traits) A couple quarters ago I

Re: DBI v2 - The Plan and How You Can Help [DRAFT]

2005-07-05 Thread David Nicol
On 7/5/05, Dean Arnold [EMAIL PROTECTED] wrote: I'm already implementing [a message-passing async] wrapper for DBI (DBIx::Threaded); not a pragma, and very specific to DBIv1, but hopefully it solves at least 85-90% of the problem. (tho async cancel/abort isn't solvable at this point)

Re: Why can I find postings on google groups that I never saw on this list

2005-12-06 Thread David Nicol
On 12/6/05, Martin J. Evans [EMAIL PROTECTED] wrote: On 06-Dec-2005 Andy Hassall wrote: If this is the case, then it seems that Google Groups should either make their version of the group read-only (this would seem to be the most sensible option since it's really a mailing list you should

Re: NET::FTP

2006-04-05 Thread David Nicol
On 4/4/06, Gupta, Razat [EMAIL PROTECTED] wrote: We have a coonection through a NAT IP. Simultaneously , five or six scripts runs and fetch data from the same server. Sometimes we got files successfully while sometimes we are getting error : UNEXPECTED EOF FILE ON COMMAND CHANNEL.

Re: how to set a DEFAULT value !!

2006-04-26 Thread David Nicol
On 4/24/06, Greg Sabino Mullane [EMAIL PROTECTED] wrote: I've proposed adding something simlilar to DBI itself, but I don't recall getting any feedback on it. Presumably once in place DBIx::Class will someday support it. DBI is complex enough, and AIUI the DBI philosophy opposes adding

Re: Help with my perl script

2006-08-23 Thread David Nicol
On 8/23/06, Rutherdale, Will [EMAIL PROTECTED] wrote: Again, I recommend simply using fork(), in a loop. a rabbit doesn't need a loop... $start_time = time + 10; ... # one process fork; # two here fork; # four here fork; # eight here fork; # 16 fork;

Re: When is a string a number?

2006-10-04 Thread David Nicol
On 10/4/06, Martin J. Evans [EMAIL PROTECTED] wrote: With DBI/DBD::Oracle all values read from the database are scalars. As everyone will know, whether something read from the database is a string or a number in Perl purely depends on the context it is used in so: internally, there are flags

Re: Bar Code

2007-05-08 Thread David Nicol
if you're using a label printer, the label printer will have primitives for that. If you're using a normal high-resolution laser or bubblejet, I would suggest looking into barcode support with the GD graphics library. Also, this issue is off-topic for dbi-users; after finding a bar code

Re: Cross-Database query engine?

2007-07-24 Thread David Nicol
On 7/24/07, Daniel Kasak [EMAIL PROTECTED] wrote: doing cross-database queries is drop-dead simple in MS Access, really? please explain.

Re: Cross-Database query engine?

2007-07-24 Thread David Nicol
I'm no database expert but I believe I can answer your question. On 7/24/07, Daniel Kasak [EMAIL PROTECTED] wrote: Link some tables from one database server. Link some tables from another database server. Go to the query builder. Add tables from both database servers. Join tables where

Re: DBIx::Chart real Candlestick

2007-07-31 Thread David Nicol
http://gnuplot.sourceforge.net/demo_4.3/candlesticks.html On 7/31/07, Dean Arnold [EMAIL PROTECTED] wrote: Christian Maier wrote: Hello Do anybody know how to draw a real candlesick bar chart with open, high, low, close instead of high and low? -- Prioritize based on common sense? Is

Re: security advice needed

2008-11-12 Thread David Nicol
On Wed, Nov 12, 2008 at 3:50 PM, Ulisses Montenegro [EMAIL PROTECTED] wrote: Also, if you ever need to display those values in any other potentially interpreted format (such as a Web page -- browsers interpret and render HTML), remember to escape them. Even if you are protecting yourself

inline placeholder DBIx now on CPAN

2008-12-17 Thread David Nicol
Enjoy! http://search.cpan.org/~davidnico/DBIx-bind_param_inline-0.02/lib/DBIx/bind_param_inline.pm -- Refusing to move when ordered, he was tragically mulched. -- The Onion

What is a good reference for what bind_col types to use when?

2009-06-03 Thread David Nicol
trial and error brings results, but seems sub-optimal. Specifally, I tried lots of other things before finding that SQL_DECIMAL allows 9223372036854775807 to enter into Perl as a string rather than as 9.blahblahblahe+18. (useing sqlite.) Are these things driver-specific or are there sane

Re: Which SQLite DBD To Use

2010-03-17 Thread David Nicol
amalgamation includes the optional Full Text Search Engine module, which is extremely cool if you need it. -- question doubt

a tool to reverse-engineer a schema

2010-04-27 Thread David Nicol
Has anyone extended DBD::Null to make a tool that after you run a mess of prepare statements against the handle, it will give you some DDL to create a schema that they will all make sense on? -- I like to think that when I ramble on, I'm speaking for others who share my opinions or point of

Re: a tool to reverse-engineer a schema

2010-04-27 Thread David Nicol
I mean of course DBD::Mock, sorry http://search.cpan.org/~drolsky/DBD-Mock-1.39/lib/DBD/Mock.pm On Tue, Apr 27, 2010 at 9:24 AM, David Nicol davidni...@gmail.com wrote: Has anyone extended DBD::Null to make a tool that after you run a mess of prepare statements against the handle, it will give

anyone accessing h2 java database with DBI?

2010-05-04 Thread David Nicol
I don't suppose anyone has bothered to construct a DBD for h2? http://www.h2database.com/html/main.html the unfortunate choice to name it the same as the level two header html tag makes it somewhat tricky to search for.

Re: DBIx::DBH - Perl extension for simplifying database connections

2004-12-01 Thread David Nicol
instead of having to haul around the code to figure this out, why not create a handy documentary web service somewhere where you fill out the blanks and get an appropriate connection string? Loading a module every time you start the program just to create something that is a permanent

Re: DBI Layer documentation

2010-10-12 Thread David Nicol
please keep the list cc'ed. I disagree with this sentiment when it comes to off-topic personal assertions. [sybase] The sybase DBD builds against a TDS module of some kind; for writing C front end and Sybase back-end unless there is an existing codebase to copy more than the SQL from it might

Re: SQLite Concurrency Issue

2010-12-23 Thread David Nicol
Are you trying to use Apache pooling within mod_perl? I tried that for a while and gave up due to lock contention issues, switching to a paradigm where I opened, transacted, closed without caching any database stuff and my locking issues went away. This means among other things, no persistent

Re: read loop

2011-02-19 Thread David Nicol
my @ids_ary = []; my @names_ary = []; my @age_ary   = []; Why do you need an empty arrayref as the first element of these?   $name_ary[$i] = $name;   $i++; push @name_ary, $name also works, and makes it more clear that you're using a parallel arrays data structure. here's an alternative:

Re: Proposed change to disconnect in DBD::ODBC

2011-03-16 Thread David Nicol
A non-fatal warning is the right thing here. do nothing |warn |die notifies in new dev no | yes | yes darkpan safeyes | probably |no -- This is not a 'bug'. Being

Re: can $dbh-do take a prepared statement handle?

2011-06-03 Thread David Nicol
=pod if you've got enough control over the flow of control to have the code below work safely, you probably don't need it =cut sub Super_do($){ if (ref $_[0]){ $_[0]-execute(); }else{ $dbh-do($_[0]); } };

Re: can $dbh-do take a prepared statement handle?

2011-06-17 Thread David Nicol
I don't think the answer is yes at all and I don't think David was saying yes. I don't think you can pass a prepared statement handle to the do method, it needs to be some SQL text. The above example from David does not pass a statement handle to do. It checks if $_[0] is a ref (which it will

Re: is it possible to use two sth from same dbh at the same time ?

2011-07-12 Thread David Nicol
when it isn't possible, you can create two database handles, and they can have different attributes. my $dbhA = DBI-connect(); my $dbhB = DBI-connect(); my $sth1 = $dbhA-prepare( $sql_a ); my $sth2 = $dbhB-prepare( $sql_b ); $sth1-execute; $dbhB-begin_work; END { $dbhB-commit} while ( my

Re: same query, two different approaches, vastly different performance

2012-02-13 Thread David Nicol
On Mon, Feb 13, 2012 at 7:16 PM, Puneet Kishor a... that makes sense. I would like to confirm this, because, if true, then it is a strike against statements prepared with bind values. the postgres reference about when LIKE statements get to use indices states that they are only

Re: same query, two different approaches, vastly different performance

2012-02-13 Thread David Nicol
On Mon, Feb 13, 2012 at 9:52 PM, Greg Sabino Mullane When you do that prepare and execute, DBD::Pg is asking Postgres to create a prepared statement, such that it can send just the arguments, and not the full statement, each time execute() is called. You can force it to *not* do so by

Re: Dereference a HASH reference

2012-06-18 Thread David Nicol
this is entirely off-topic for dbi-users. That said, what you're seeing is due to $q-param('dow') called in array context returning some number of things other than one thing. There are various ways to fix it, depending on how $q works. The approach you tried, putting one of the param lookups

Re: cross database queries?

2013-06-26 Thread David Nicol
On Wed, Jun 26, 2013 at 7:26 AM, Andrew Snyder a...@dancingjars.com wrote: I want to write a query like: select clients.client.client_id, columnar.sales.total_sales, web.page_hits from clients, columnar, web where clients.client_id = columnar.client_id and clients.client_id = web.client_id

Surprising DBD::Oracle error raised

2014-02-04 Thread David Nicol
$price_sth-execute; my ($o_file_price) = $price_sth-fetchrow_array(); if ($price_sth-fetch) { $this-log_error('ERROR: scalar select returned second row at %s line %d', __FILE__, __LINE__); } I expected the fetch to return undef, but it throws an Oracle error. My best

Re: Surprising DBD::Oracle error raised

2014-02-04 Thread David Nicol
the error message claimed I hadn't executed the statement. I changed it to if (eval { $price_sth-fetch}) { $this-log_error('ERROR: scalar select returned second row at %s line %d', __FILE__, __LINE__); } but I think I'll change it again to if ($price_sth-{Active} and

Re: Surprising DBD::Oracle error raised

2014-02-05 Thread David Nicol
On Wed, Feb 5, 2014 at 7:25 AM, Martin J. Evans martin.ev...@easysoft.com wrote: That is indeed interesting. When I run the following with DBD::ODBC to MS SQL Server: use strict; use warnings; use DBI; my $h = DBI-connect(); eval { $h-do(q/drop table mje/); }; $h-do(q/create

Re: Escaping placeholders

2014-12-19 Thread David Nicol
On Fri, Dec 19, 2014 at 6:12 AM, Alexander Foken alexan...@foken.de wrote: Problem was using named placeholders (:foo) in DBI and at the same time use PL/SQL code containing variables (:bar), DBI considered both :foo and :bar to be placeholders instead of leaving :bar alone and pass it to

Re: Escaping placeholders

2014-12-19 Thread David Nicol
. On Fri, Dec 19, 2014 at 10:27 AM, David Nicol davidni...@gmail.com wrote: I think the suggestion of making ::(\w+) become :$1 and exempting that from placeholder recognition seems like a complete winner and DBD maintainers could do that right away, and by do that I mean accepting, applying

Re: Perl 6 and DBI

2015-02-04 Thread David Nicol
Does this mean the floor is open for brainstorming? I'd like to see more transparent integration, so p6+dbi would be like pl/sql or pro*C or whatever that language Peoplesoft scripts used to be in that I was working with when I wrote DBIx::bind_param_inline.

Re: Perl 6 and DBI

2015-02-06 Thread David Nicol
Perl 6 may need its own Tim Bunce, rather than somehow pressing the original into service. On Fri, Feb 6, 2015 at 4:40 PM, Greg Sabino Mullane g...@turnstep.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Tim Bunce said: On MoarVM the perl5 DBI can be accessed via the

Re: help to connect

2016-05-13 Thread David Nicol
Are you sure Oracle is expecting UTF8 for the password? Because it works without accented chars in the password, the simplest thing might be to change to a password without encoding issues. On Thu, May 12, 2016 at 10:38 AM, Bruce Johnson < john...@pharmacy.arizona.edu> wrote: > > > On May 12,

Re: sth->prepare() setting Active?

2016-09-30 Thread David Nicol
On Fri, Sep 30, 2016 at 4:57 AM, Tim Bunce wrote: >> > > Should a call to prepare() return an Active statement? (i.e. >> > > $sth->{Active} == 1) >> > > >> > > This appears to be the behaviour of DBD::Sybase, but not DBD::Pg >> > >> That's unfortunate, because Class::DBI

Re: sth->prepare() setting Active?

2016-09-30 Thread David Nicol
sorry, this one is better "Active" Type: boolean, read-only The "Active" attribute is true if the handle object is "active". This is rarely used in applications. The exact meaning of active depends on the database driver, but some aspects of the semantics are

Re: sth->prepare() setting Active?

2016-10-03 Thread David Nicol
this isn't tested -- i'm writing it here in e-mail -- but it or something very close to it might work. supporting prepare_cached or other forms of sth reuse could require a way to clear the flag. package DBIx::WrapActive; our $AUTOLOAD; ### invoke like $sth = DBIx::WrapActive::wrap($sth); sub

Re: Fork DBD::mysql

2017-08-28 Thread David Nicol
It looks like this fork happened some time ago, and a DBD::maria is now needed, to keep up. Is that not what it looks like? -- everything has to be just so or the magic won't work

Re: Translate between DBI and SQL

2019-02-12 Thread David Nicol
Tie::Function can be used to bind $dbh->quote to a syntactical hash, so you can interpolate arbitrary strings easier. When I do that I name the hash %Q, and then it's safe to do things like $sql_text = "select id from mytable where foo=$Q{$foo}"; rather than counting placeholders. On Fri, Feb

Re: [EXTERNAL] Re: DBI.pm - Memoryfault(coredump)

2020-10-28 Thread David Nicol
I wonder what the difference between "$sid" and "dbi:$db_driver:$db" is. If nothing, it would look like Oracle::DBD might have some kind of weakness regarding multiple active connections, if the fault happens later instead of right at connect time, like on the second time through, with a different

Re: DBI.pm - Memoryfault(coredump)

2020-10-26 Thread David Nicol
if the Oracle module is maintained by red hat, yum update should help. If you built it in-house, you may need to yum update the perl development environment and reinstall. On Fri, Oct 23, 2020 at 11:27 PM Srikantha wrote: > Hello, > We are having the below issue from one of the perl modules. We