RE: Parsing

2004-09-20 Thread Sterin, Ilya \(I.\)
Ah, first this is a DBI list and this is a non-database related
question.

But as a hint, take a look at Text::CSV_XS, which will allow you to do
what you want without any replacements, since CVS fillows strict rules.
You can even do it with a pretty simple regex, but you should use the
module I mentioned.

Ilya

-Original Message-
From: Erich Singer [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 17, 2004 3:07 PM
To: [EMAIL PROTECTED]
Subject: Parsing


Hello

I have to replace any comma (,) between quotation marks () only, with
a ~ For example

ABC, 123, 456, DE,F, 789   ...
should be
ABC, 123, 456, DE~F, 789  ...

This way I can use the comma as a field delimiter for parsing purposes
in order to insert the various fields into the database

Any PERL code to do this is welcome

Thanks for your time
Respectfully
Erich




RE: bind_param_inout

2004-09-14 Thread Sterin, Ilya \(I.\)
Or better yet

$sth-bind_param($_, $execute_args[$_]) for (0..$#execute_args);

Arrays start from zero.

Ilya

-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 14, 2004 11:56 AM
To: Martin Moss
Cc: Tim Bunce; Jenda Krynicky; [EMAIL PROTECTED]
Subject: Re: bind_param_inout


On Tue, Sep 14, 2004 at 02:33:41PM +0100, Martin Moss wrote:
 I've got one further issue thats driving me nuts.
 
 Here is the code I'm running,
 
  $sth-bind_param($_, $execute_args[$_]) for ([EMAIL PROTECTED]);

Actually that needs to be $execute_args[$_-1]

That may fix your other problem. If not please post a small
self-contained example.

Tim.

   $sth-bind_param_inout(scalar @execute_args+1,\$new_id,38);

 N.b. using scalar @execute_args produces rebind
 errors, unless I do the +1. Can you explain why I
 shouldn't use the +1??
 
 Here is the SQL I'm generating:-
 
 INSERT INTO table (CompID, User_ID, Referral, Newregistration, 
 Phonecontact, Created, Updated) VALUES (COMPID_seq.nextval, ?, ?, ?, 
 ?, from_unixdate_func(1095168082),
 from_unixdate_func(1095168082)) returning CompID into
 ?
 
 And here is a dump of the @execute_args array
 
 $VAR1 = 3738;
 $VAR2 = 'Y';
 $VAR3 = 'Y';
 $VAR4 = 'Y';
 
 When I run this query I get the following error:-
 
 DBD::Oracle::st execute failed: ORA-01722: invalid
 number (DBD ERROR: OCIStmtExecute) at 
 /opt/apps/embperl2-apache-matt/perl/perl-5.6.1/lib/site_perl/5.6.1/III
 /Oracle/Object.pm
 line 974.
 
 If I run the insert without the column which contains
 a number (e.g. run the query without the User_ID
 value, so that ALL the variables passed to the binds
 are of type varchar (perl string) it works. And if I
 run the query for only Numbers it works, but as soon
 as I try to have strings and numbers inside my
 @execute_args array my code breaks. We're running
 Oracle 8i.
 
 If I expressly say to_num(?) for the num column Then
 the query works when the rest of the columns are
 strings.
 
 This whole issue seems to be 'quirky' and it's
 probably my lack of Oracle thats causing me to do
 somethign stupid, but I can't tell what.
 
 Any help would be so much appreciated!
 
 Marty
 
 
  --- Martin Moss [EMAIL PROTECTED] wrote:
  Thanks for you help,
  
  Marty
  
  
   --- Tim Bunce [EMAIL PROTECTED] wrote:
   On Tue, Sep 14, 2004 at 12:34:09AM +0200, Jenda
   Krynicky wrote:
From: Tim Bunce [EMAIL PROTECTED]
 
 Use bind_param() or bind_param_inout() for all
   the params
 and then call execute() with no arguments.
 
 Tim.

I wonder ... how about adding a method
   bind_params() like this:

sub bind_params {
my $sth = shift;
my $pos = (ref($_[0]) ? 1 : shift);
for my $param (@{$_[0]}) {
$sth-bind_param($pos++, $param);
}
}
   
   No need. See below.
   
So that this could be shortened to

$sth-bind_params([EMAIL PROTECTED]); # default
   position is 1

  
 
 $sth-bind_param_inout($#execute_args+1,\$new_id,38);
   
   Without adding any new methods it can be shortened
   to
   
 $sth-bind_param($_, $execute_args[$_]) for ([EMAIL PROTECTED]);
 $sth-bind_param_inout($#execute_args+1,
  \$new_id,
   38);
   
   I'll add that to the docs.
   
   Tim.
   
   p.s. I'd use scalar @execute_args or
   [EMAIL PROTECTED] instead of $#execute_args+1.

  
  
  
  
  
 
 ___ALL-NEW
  Yahoo! Messenger - all new features - even more fun!  
  http://uk.messenger.yahoo.com
   
 
 
   
   
   
 ___ALL-NEW 
 Yahoo! Messenger - all new features - even more fun!  
 http://uk.messenger.yahoo.com
 


RE: How to read LONG data type

2004-09-14 Thread Sterin, Ilya \(I.\)
Set LongTruncOK and LongReadLen, also make sure you are always binding
anything that has to do with Longs.

See docs for above parameters.

Ilya

-Original Message-
From: Shah, Urmil [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 14, 2004 12:23 PM
To: [EMAIL PROTECTED]
Subject: How to read LONG data type


I have a column in a table that has a data type=LONG. The content of
this column is a text file(it is not a pointer to a text file but the
raw text file itself). When I try to simple select statement in perl it
gives following error.

 

Do I need to notify perl that it is a LONG data type and read it
differently.

 

DBD::Oracle::st fetchrow_array failed: ORA-01406: fetched column value
was truncated (DBD: ORA-01406 error on field 3 of 3, ora_type 8, DBI
attribute LongTruncOk not set and/or LongReadLen too small) at
pgmsetup.pl line 22.

 

Thanks in advance.

 

Regards,

Urmil



RE: web development tool

2004-08-10 Thread Sterin, Ilya \(I.\)
I just looked at it, although it claims to be like Struts, having used Struts for a 
while, I truly don't see how.  Struts creates bindings between your objects's 
properties and methods and is easy to set up.  Basically you create a class for Model 
(your business logic), then use JSP for view and Struts serves as a controller.

Within JSP you embed the logic, although Maypole tries, there is more to struts, build 
in error classes, that repost back to forms with errors, etc..., redirection based on 
business logic, and many many more features.

But Maypole is new, maybe they'll get there one day.

Ilya

-Original Message-
From: Scott T. Hildreth [mailto:[EMAIL PROTECTED]
Sent: Monday, August 09, 2004 12:43 PM
To: MCMULLIN, NANCY
Cc: [EMAIL PROTECTED]
Subject: RE: web development tool


I would check out HTML::Mason or Maypole which can use Template::Toolkit
or Html::Mason.  Maypole is like Java Struts a MVC(?).  Anyway it seems
very easy to setup giving web interfaces to db tables.  I have not used
it, worth checking out though.  There are articles on perl.com.

On Mon, 2004-08-09 at 10:57, MCMULLIN, NANCY wrote:
 From: Hardy Merrill [mailto:[EMAIL PROTECTED]
 
 I think you'll find that Perl can do any and all of what you asked
 about, but you're asking about pretty general topics.  If you can be
 more specific it's likely you'll get more specific answers.
 
 Hardy,
 Specifically, we need to do Oracle database development running in a browser, which 
 includes: 
 - add, delete, modify records
 - display on-screen reports of that data
 - print hard-copy reports
 - run batch processes
 - allow for concurrent use
 We've already put together some simple Perl / HTML / SQL scripts that display data, 
 but I  just didn't know if Perl and HTML were robust enough to do all the 
 aforementioned.
 
 Thanks.
 Nancy
 
 Since you ask here on the Perl *DBI* mailing list, in my experience,
 which includes (not to say I'm an expert in these ;-) Perl, PHP, Python,
 some ASP, no other tool in that list has the mature database independent
 interface that Perl does.  This is an excellent tool that allows you to
 write database independent code for any application that interfaces with
 a database.  The major pro of DBI is that if you write your apps for
 Oracle (DBD::Oracle), that sometime down the road if you change your
 database to DB2, that your code will not have to change much - assuming
 that you don't take advantage of oracle-specific functionality provided
 by Oracle.
 
 I don't know Coldfusion or Java so I can't offer any insight there.
 
 HTH.
 
 Hardy Merrill
 
  MCMULLIN, NANCY [EMAIL PROTECTED] 08/09/04 11:26AM 
 Generic question to the group...
 
 It's been requested that we expand our Perl / Database / Web
 development to do more advanced things, such as database maintenance,
 reporting and monitoring (over the web).  
 
 Would you recommend continuing to use strictly Perl for all of this, or
 jump to another tool, such as Coldfusion, PHP, Java or something else?  
 I guess I'm wondering how easy or hard it would be to develop everything
 using only Perl.
 
 Thanks for the advice.
 Nancy


RE: web development tool

2004-08-09 Thread Sterin, Ilya \(I.\)


Hardy,
Specifically, we need to do Oracle database development running in a browser, which 
includes: 
- add, delete, modify records

Ah, yes, what do you think database interface stands for???


- display on-screen reports of that data

That's up to you to pull the data and generate the output, in HTML or any other format 
you want.  Has nothing to do with Perl DBI nor any other language's db interface 
module.

- print hard-copy reports

Again, printing has nothing to do with the database.  If you want to generate the 
report in Excel, again you'd use DBI to pull the data and then output to Excel or what 
ever format you'd want.  There are modules available for almost any propietary format.

- run batch processes

Ah, that's cron on *NIX systems and something else on Windows.  Again, DBI won't do 
that for you, but neither will any other language's db class.

- allow for concurrent use

Yes, it does.  Depends on how robust you need the application to be, concurrency 
depends on your database server, DBI just connects to it, the server manages the rest. 
 If you want database connection pooling, you might want to look into mod_perl, though 
you can also achieve that with a regular perl interpreter.  mod_perl is similar to 
(J2EE) java application server where it maintains it's state within the actual server 
threading.


We've already put together some simple Perl / HTML / SQL scripts that display data, 
but I  just didn't know if Perl and HTML were robust enough to do all the 
aforementioned.

Perl, just like most other languages can handle anything, it just depends on how you 
want to handle things.

Honestly, if you are looking to create enterprise level large web applications (and 
this doesn't sound like one), Java has a better support for development patterns, 
especially MVC (Struts).  You might want to look into that, but for all else, perl is 
perfect.



Ilya



RE: DBI Module.

2004-06-30 Thread Sterin, Ilya \(I.\)
That's not true.  You can have one persistant connection and reuse that for all 
requests, it'll just take away from having to connect/disconnect all the time.  No one 
said you have to open 40 different connections and pay for 40 concurrent licenses.



 -Original Message-
 From: Terry Maragakis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 30, 2004 12:42 PM
 To: Tim Bunce; Dave Mullen - Marikina CGI
 Cc: [EMAIL PROTECTED]
 Subject: RE: DBI Module.
 
 
 Mr Bunce, 
 
 Not all of the rest of the world is using persistent database 
 connections.
 
 There is a good reason not to use persistent database 
 connections, it is database licensing.
 
 Licensing may not be an issue with mysql but it is an issue 
 with commercial databases.
 
 I use Informix with hundreds of users accessing the database 
 for extremely short queries from a GUI. I cannot afford to 
 have them connected constantly, I would have to spent 
 $100,000 per server in licensing. Having them connect and 
 disconnect for every query has cost me about $3,000 per 
 server using concurrent user licensing.
 
 Even in the case of mysql you can have applications (web 
 access to a database for example) that can only be 
 implemented with non persistent connections.
 
 I have not experienced any connection delays like Mr Mullen 
 describes, as a matter of fact I am very satisfied with the 
 connection times (they average less than 1ms on a 2.4GHz dual 
 CPU Xeon on Linux) but I do have a problem with the 
 discconnect statements, they consistently take about 1 
 second. This is generaly not an issue since the users have to 
 proccess the information after it is returned to them on the 
 GUI but I occasionaly get a complaint.
 
 Connect/disconnect times are important and they should be 
 given due consideration.
 
 By the way, since this is my first posting to this group I 
 would like to thank you for all your work on the Perl 
 database interfaces, they are extremely valuable tools.
 
 Thanks,
 
 Terry Maragakis
 Database Administrator
 The Inteq Group Inc. 
 5445 La Sierra Dr. Suite 400 
 Dallas, TX 75231 
 214-739-9494 
 214-739-7979 Fax
 [EMAIL PROTECTED]
 www.inteqrx.com
 __
 __
 IMPORTANT: This message is intended only for the use of the 
 individual or entity to which it is addressed and may contain 
 information that is privileged, confidential and exempt from 
 disclosure under federal or state law. If you received this 
 communication in error, please destroy and notify the sender 
 by return message or call our Privacy Administrator at 800-324-7799.
 
 
 -Original Message-
 From: Tim Bunce [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 30, 2004 10:27 AM
 To: Dave Mullen - Marikina CGI
 Cc: [EMAIL PROTECTED]
 Subject: Re: DBI Module.
 
 
 On Wed, Jun 30, 2004 at 03:19:15PM +0200, Dave Mullen - 
 Marikina CGI wrote:
  Dear Mr Bunce,
  
  We are using perl 5.005 and mysql 3.23 on a Linux Redhat 7.2 system.
  
  We are trying to implement a better timeout for the DBI 
 connections, as
  the one incorporated in the DBI module only has a 
 granularity of seconds.
  
  We don't use persistent connections or mod-perl, so 
 connection time is an
  important factor for us, and we wish to avoid excessive 
 times, as this
  affects our server performance.
 
 So why not use persistent connections or mod-perl like the 
 rest of the world?
 
  Herewith is the test script, which basically wraps the 
 connection in an eval
  block, and the Time::HiRes alarm will cause the eval to 
 die after 10ms.
 
  This script perfomed well over a 24 hour period, our only 
 concern is that
  sometimes we recorded the following error message during 
 the eval cleanup
  
  (in cleanup) dbih_getcom handle DBI::db=HASH(0x8258a28) is 
 not a DBI handle
  (has no magic)
  
  Obviously, the alarm triggers and the eval block dies at 
 some point during
  the creation of the DBI object, our concern is that this 
 eval cleanup
  failure may be leaving resources behind on the system ???
 
 Probably.
 
  Your comments please.
 
 Don't do it. Honestly. It's not reliable and can't be made reliable.
 Search the web for discussions of perl and signals. Even if you got
 it to work (and appear reliable) it'll probably break when you
 upgrade perl to a later one that has safe signals. Here be dragons.
 
 The rest of the world uses persistent connections or mod-perl 
 for a reason.
 
 Tim.
 


RE: DBI Module.

2004-06-30 Thread Sterin, Ilya \(I.\)
What connection pooling?  You have one open database connection and the rest of the 
scripts wait for it?  There is no concurrent access happening.  The only thing that 
might matter is if you're using threads and/or processes.  Each db vendor has 
different concurrent license schemes, I always found it very annoying, as they 
themselves don't know a clear definition of it, just ask any sales person at that 
company, but they basically leave it open so that they can charge large enterprises 
more by furnishing them a different definition of the license each time it suites 
their needs.



 -Original Message-
 From: Terry Maragakis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 30, 2004 12:50 PM
 To: Sterin, Ilya (I.); Tim Bunce; Dave Mullen - Marikina CGI
 Cc: [EMAIL PROTECTED]
 Subject: RE: DBI Module.
 
 
 Yes, it is true. The licensing agreement clearly states that 
 connection pooling like you describe is not allowed under the 
 concurrent licensing structure.
 
 Terry Maragakis
 Database Administrator
 The Inteq Group Inc. 
 5445 La Sierra Dr. Suite 400 
 Dallas, TX 75231 
 214-739-9494 
 214-739-7979 Fax
 [EMAIL PROTECTED]
 www.inteqrx.com
 __
 __
 IMPORTANT: This message is intended only for the use of the 
 individual or entity to which it is addressed and may contain 
 information that is privileged, confidential and exempt from 
 disclosure under federal or state law. If you received this 
 communication in error, please destroy and notify the sender 
 by return message or call our Privacy Administrator at 800-324-7799.
 
 
 -Original Message-
 From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 30, 2004 11:46 AM
 To: Terry Maragakis; Tim Bunce; Dave Mullen - Marikina CGI
 Cc: [EMAIL PROTECTED]
 Subject: RE: DBI Module.
 
 
 That's not true.  You can have one persistant connection and 
 reuse that for all requests, it'll just take away from having 
 to connect/disconnect all the time.  No one said you have to 
 open 40 different connections and pay for 40 concurrent licenses.
 
 
 
  -Original Message-
  From: Terry Maragakis [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 30, 2004 12:42 PM
  To: Tim Bunce; Dave Mullen - Marikina CGI
  Cc: [EMAIL PROTECTED]
  Subject: RE: DBI Module.
  
  
  Mr Bunce, 
  
  Not all of the rest of the world is using persistent database 
  connections.
  
  There is a good reason not to use persistent database 
  connections, it is database licensing.
  
  Licensing may not be an issue with mysql but it is an issue 
  with commercial databases.
  
  I use Informix with hundreds of users accessing the database 
  for extremely short queries from a GUI. I cannot afford to 
  have them connected constantly, I would have to spent 
  $100,000 per server in licensing. Having them connect and 
  disconnect for every query has cost me about $3,000 per 
  server using concurrent user licensing.
  
  Even in the case of mysql you can have applications (web 
  access to a database for example) that can only be 
  implemented with non persistent connections.
  
  I have not experienced any connection delays like Mr Mullen 
  describes, as a matter of fact I am very satisfied with the 
  connection times (they average less than 1ms on a 2.4GHz dual 
  CPU Xeon on Linux) but I do have a problem with the 
  discconnect statements, they consistently take about 1 
  second. This is generaly not an issue since the users have to 
  proccess the information after it is returned to them on the 
  GUI but I occasionaly get a complaint.
  
  Connect/disconnect times are important and they should be 
  given due consideration.
  
  By the way, since this is my first posting to this group I 
  would like to thank you for all your work on the Perl 
  database interfaces, they are extremely valuable tools.
  
  Thanks,
  
  Terry Maragakis
  Database Administrator
  The Inteq Group Inc. 
  5445 La Sierra Dr. Suite 400 
  Dallas, TX 75231 
  214-739-9494 
  214-739-7979 Fax
  [EMAIL PROTECTED]
  www.inteqrx.com
  __
  __
  IMPORTANT: This message is intended only for the use of the 
  individual or entity to which it is addressed and may contain 
  information that is privileged, confidential and exempt from 
  disclosure under federal or state law. If you received this 
  communication in error, please destroy and notify the sender 
  by return message or call our Privacy Administrator at 800-324-7799.
  
  
  -Original Message-
  From: Tim Bunce [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 30, 2004 10:27 AM
  To: Dave Mullen - Marikina CGI
  Cc: [EMAIL PROTECTED]
  Subject: Re: DBI Module.
  
  
  On Wed, Jun 30, 2004 at 03:19:15PM +0200, Dave Mullen - 
  Marikina CGI wrote:
   Dear Mr Bunce,
   
   We are using perl 5.005 and mysql 3.23 on a Linux Redhat

RE: DBI Module.

2004-06-30 Thread Sterin, Ilya \(I.\)
Commercial databases have commercial support behind them, that's what is driving it.  
Most non-IT companies, do not want to invest in internal departments that are 
responsible for supporting an open source software product.  Until a giant like IBM, 
HP, or similar puts their support behind an open source db product, you will not see 
wide enterprise adoption of them.  And I totally agree with the CIOs, CEOs, etc...  
Money is not necessarily an issue, at least it's not when it comes to business 
continuity.

Here is a good example.  We sold a large company on SuSE (before Novell bought them 
and put their support behind them).  My sales guy was great, but 7 months later they 
ran into a support issue and SuSE at the time offered 24/7 enteprise support from 
Germany.  No problem right, well they called to get an answering machine, send an 
email that came back with questions about the specifics.  In the case of a large 
corporation, they would either send someone on site within 4 hours, or help by phone 
right away.  There is also the risk of a small company going under, etc...

Not many companies are willing to take the risk these days, that's why other benefits 
are important.  Before Linux became enterprise ready, with Novell, IBM, HP support 
behind it, you rarely saw any public company adapt it in mission critical 
environments, that has now changed.  Though this is a case for open source DBs right 
now and because IBM has their own db product, they won't put support behind MySQL and 
PostgreSQL.

Ilya Sterin

 -Original Message-
 From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 30, 2004 2:23 PM
 To: Terry Maragakis
 Cc: Tim Bunce; Dave Mullen - Marikina CGI; [EMAIL PROTECTED]
 Subject: Re: DBI Module.
 
 
 
  Licensing may not be an issue with mysql but it is an issue 
 with commercial databases.
  
  I use Informix with hundreds of users accessing the 
 database for extremely short queries from a GUI. I cannot 
 afford to have them connected constantly, I would have to 
 spent $100,000 per server in licensing. Having them connect 
 and disconnect for every query has cost me about $3,000 per 
 server using concurrent user licensing.
 
 Oi, Why would anyone want to pay thousands for that when there are so 
 many free ones that work the same or better?
 
 Tell you what, I'll build you an SQL server for the low low price of 
 $10,000 incuding the hardware, OS, and database system.
 
 I'd make about $9000 on the deal for doing hardly anything at 
 all, which 
 is what the informix people seem to be doing :)
 
 Or I'll license you the same server that you can have persistant 
 connections and unlimited queries for $3000 a year.
 
 That way your apps will be faster running persistantly and you don't 
 have to worry about too many queries costing you too much.
 
 Does it really charge bases on the amount of queries or 
 connection time?
 
 I'm sure everyone has reasons for tossing cash into the fire 
 but I'm not 
 real clear on why...
 
 Just .02 from a MySQL guy (IE mostly ignorant of the others 
 by choice) :)
 
 Sorry for being sort of OT, won't happen again :)
 


RE: DBI Module.

2004-06-30 Thread Sterin, Ilya \(I.\)
I know Tim will kill me for this OT stuff:-)


  I feel the likely hood of the economy changing and causing 
 major issues 
 for big companies is way more likely than the open source 
 community to 
   stop supporting and developing.

It's not that the open source community doesn't support, it's that it's an 
unstructured/unguranteed support structure.  Do you guarantee me that if my Linux 
kernel came crashing in some specific environment that can't be easily debugged on a 
home computer, that Linus and the team will come running to the rescue?  Within 4 
hours?  I doubt it, Linus might be spending time with his wife and the rest of the 
team might be on a geek cruise:-)

I'm serious, and I used to think the same way as you, until we sold a few open source 
products and ran into huge support issues, that were raised before, but we convinced 
them otherwise.  We actualy lost a few clients that way.


 
 To me all the enterprise level nonsense is just a bunch of 
 big words 

Most are, but support and some other legal arrangements are very valid issues.


 


RE: Avoiding coding username/password directly into perl script

2004-03-10 Thread Sterin, Ilya (I.)
well, if your database requires a username/password, then you can't just pass it the 
path (DSN).  Not even sure how you expect anyone to do that.  I believe certain ODBC 
clients might have the capability to embed that either inside the DSN and/or somewhere 
else on the system, so that when a certain DSN is recognized, that username/password 
is used, but not sure what clients and/or version do that.

Thanks.

Ilya

 -Original Message-
 From: News Reader [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 10, 2004 1:36 PM
 To: [EMAIL PROTECTED]
 Subject: Avoiding coding username/password directly into perl script
 
 
 Hi there,
 
 I figured this would be a pretty common problem, but I didn't see
 anything in the FAQ or docs.
 
 We've got a script that uses DBI to connect to SQL Server.
 
 There is a system DSN set up and this already has the username and
 password. So do we really need to pass them again, as shown below?
 
 my $db = DBI-connect(dbi:ODBC:$dsn,$db_user_name,$db_password);
 
 We tried the following (removing the username/password parameters),
 but we got a connection error.
 
 my $db = DBI-connect(dbi:ODBC:$dsn);
 
 It would be nice (for maintenance) and obviously more secure if we
 could pass only the DSN name.
 
 Thanks,
  - ML
 


RE: Request For Help - Perl DBI DBD::mysql

2003-12-09 Thread Sterin, Ilya (I.)
Sure.  Just install ActivePerl, and then use ppm to install DBI and DBD::mysql.  See 
the ppm docs for more info.

You can also find useful info in the DBI Site (especially see the link for the DBI 
FAQ). 

http://dbi.perl.org



 -Original Message-
 From: Vinayak Javaly [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2003 11:05 PM
 To: [EMAIL PROTECTED]
 Subject: Request For Help - Perl DBI  DBD::mysql
 
 
 Hello.  I am an adjunct professor at the New York Institute 
 of Technology.  I am developing an undergraduate computer 
 science course in Database Interfaces  Programming and would 
 like to use Perl DBI  DBD::mysql in a Windows environment.  
 I currently use MySQL in my introductory Database courses.  
 Do you know where I can find pre-built packages (for Windows) 
 of Perl DBI and DBD::mysql?
 
 Thanks for your help.
 
 Vinayak Javaly
 


RE: Help for DBI installation

2003-12-09 Thread Sterin, Ilya (I.)
Try setting LD_LIBRARY_PATH.

Ilya

 -Original Message-
 From: Edward Pang [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 09, 2003 12:11 PM
 To: Andy Crichton
 Cc: [EMAIL PROTECTED]
 Subject: RE: Help for DBI installation
 
 
 
 
 
 
 Hi Andy,
 
 When link the cc, I got following error when I run make:
 
 ###Start of error###
 cc -c   -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384
 -qnoansial
 ias -DUSE_NATIVE_DLOPEN -I/usr/local/include -q32 
 -D_LARGE_FILES -qlonglong
 -
 DVERSION=\1.39\ -DXS_VERSION=\1.39\  -I/usr/local/lib/perl5/5.8.0
 /aix/CORE
   -DDBI_NO_THREADS Perl.c
 cc: unrecognized option `-qmaxmem=16384'
 cc: unrecognized option `-qnoansialias'
 cc: unrecognized option `-q32'
 cc: unrecognized option `-qlonglong'
 In file included from /usr/local/lib/perl5/5.8.0/aix/CORE/perl.h:371,
  from DBIXS.h:19,
  from Perl.xs:1:
 /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/3.3.2/include/sy
 s/types.h:60:23:
 s
 tandards.h: No such file or directory
 /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/3.3.2/include/sy
 s/types.h:64:26:
 s
 ys/inttypes.h: No such file or directory
 In file included from /usr/local/lib/perl5/5.8.0/aix/CORE/perl.h:371,
  from DBIXS.h:19,
  from Perl.xs:1:
 /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/3.3.2/include/sy
 s/types.h:125:
 err
 or: parse error before time_t
 ...
 ...
 ###End of error###
 
 Thanks.
 
 
 Edward Pang
 Systems Programmer
 (Tivoli Certified Consultant)
 Enterprise Systems Management
 Voice: 416-510-6418
 
 
 
 
   
  
  Andy Crichton  
  
  [EMAIL PROTECTED]  
  
  uildingdata.com 
   To 
  Edward Pang 
 [EMAIL PROTECTED]
  2003-12-09 12:05 PM  
   cc 
   
  
   
  Subject 
  RE: Help for DBI 
 installation 
   
  
   
  
   
  
   
  
   
  
   
  
 
 
 
 
 gcc usually creats a link. This will work assuming /usr/bin 
 is in your path
 
 ln -s `which gcc` /usr/bin/cc
 
 
 Andy Crichton
 
 -Original Message-
 From: Edward Pang [mailto:[EMAIL PROTECTED]
 Sent: 09 December 2003 16:52
 To: [EMAIL PROTECTED]
 Subject: Help for DBI installation
 
 
 
 
 
 
 Hi,
 
 I'm installing DBI on my AIX4.3.3 (4330-10) system. I use 
 gcc-3.3.2 and I
 have
 installed perl 5.8.0. But I got following error when run 
 make command:
 
 1. perl Makefile.PL == OK
 2. make == ERROR
 cp lib/DBI/ProfileData.pm blib/lib/DBI/ProfileData.pm
 /usr/local/bin/perl -e 'use ExtUtils::Mksymlists; \
 Mksymlists(NAME = DBI, DL_FUNCS = {  }, FUNCLIST = 
 [], DL_VARS
 =
 [
 ]);'
 /usr/local/bin/perl -p -e s/~DRIVER~/Perl/g 
 blib/arch/auto/DBI/Driver.xst
 
 Pe
 rl.xsi
 /usr/local/bin/perl 
 /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp  -typemap
 /usr/lo
 cal/lib/perl5/5.8.0/ExtUtils/typemap -typemap typemap  
 Perl.xs  Perl.xsc 
 mv
 Perl.xsc Perl.c
 cc -c   -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384
 -qnoansial
 ias -DUSE_NATIVE_DLOPEN -I/usr/local/include -q32 
 -D_LARGE_FILES -qlonglong
 -
 DVERSION=\1.39\ -DXS_VERSION=\1.39\  -I/usr/local/lib/perl5/5.8.0
 /aix/CORE
   -DDBI_NO_THREADS Perl.c
 /bin/sh: cc:  not found.
 make: *** [Perl.o] Error 127
 
 It looks like make program is trying to call cc instead of 
 gcc. Is there a
 solution to fix this problem.
 
 Thanks.
 
 Edward Pang
 Systems Programmer
 (Tivoli Certified Consultant)
 Enterprise Systems Management
 Voice: 416-510-6418
 
 
 
 __
 __
 This e-mail has been scanned for all viruses by Star Internet. The
 service is powered by MessageLabs. For more information on a proactive
 anti-virus service working around the clock, around the globe, visit:
 http://www.star.net.uk
 __
 __
 
 
 __
 This email and any files transmitted with it are confidential 
 and intended
 solely for the use of the individual or entity to whom they 
 are addressed. The
 contents are 

RE: Problem installing DBI on Win2000

2003-12-08 Thread Sterin, Ilya (I.)
It's really hard to help, if you didn't describe what problem you are having.

Ilya

 -Original Message-
 From: Tshimanga Minkoka [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2003 8:51 AM
 To: [EMAIL PROTECTED]
 Subject: Problem installing DBI on Win2000
 
 
 Dear All,
 
 Can someone help me in installing DBI module (and drivers for 
 PostgreSQL,
 Oracle 8, Informix and MS SQL 2000) for my ActiveState Perl 
 on my Office
 Workstation running Windows 2000 SP4.
 I have searched the list and the web for similar problem, but 
 I didn't find
 any advice that get me out of trouble.
 
 Below are outputs of some commands:
 
 C:\perl -v
 
 This is perl, v5.8.1 built for MSWin32-x86-multi-thread
 (with 1 registered patch, see perl -V for more detail)
 
 Copyright 1987-2003, Larry Wall
 
 Binary build 807 provided by ActiveState Corp. 
 http://www.ActiveState.com
 ActiveState is a division of Sophos.
 Built 18:19:11 Nov  3 2003
 
 
 Perl may be copied only under the terms of either the 
 Artistic License or
 the
 GNU General Public License, which may be found in the Perl 5 
 source kit.
 
 Complete documentation for Perl, including FAQ lists, should 
 be found on
 this system using `man perl' or `perldoc perl'.  If you have 
 access to the
 Internet, point your browser at http://www.perl.com/, the 
 Perl Home Page.
 
 
 C:\perl -V
 Summary of my perl5 (revision 5 version 8 subversion 1) configuration:
   Platform:
 osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
 uname=''
 config_args='undef'
 hint=recommended, useposix=true, d_sigaction=undef
 usethreads=undef use5005threads=undef useithreads=define
 usemultiplicity=def
 ine
 useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
 use64bitint=undef use64bitall=undef uselongdouble=undef
 usemymalloc=n, bincompat5005=undef
   Compiler:
 cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
 -D_CONSOLE -
 DNO_STRICT -DHAVE_DES_FCRYPT  -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT
 -DPERL_IMPL
 ICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
 optimize='-MD -Zi -DNDEBUG -O1',
 cppflags='-DWIN32'
 ccversion='', gccversion='', gccosandvers=''
 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
 ivtype='long', ivsize=4, nvtype='double', nvsize=8, 
 Off_t='__int64',
 lseeksi
 ze=8
 alignbytes=8, prototype=define
   Linker and Libraries:
 ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
 -libpath:C:
 \Perl\lib\CORE  -machine:x86'
 libpth=C:\PROGRA~1\MICROS~3\VC98\lib
 libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
 comdlg32
 .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  
 netapi32.lib uuid.lib
 wsoc
 k32.lib mpr.lib winmm.lib  version.lib odbc32.lib 
 odbccp32.lib msvcrt.lib
 perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib 
 winspool.lib
 comd
 lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
 uuid.lib
 wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
 msvcrt.lib
 libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
 gnulibc_version='undef'
   Dynamic Linking:
 dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
 cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
 -opt:ref,icf  -
 libpath:C:\Perl\lib\CORE  -machine:x86'
 
 
 Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
 PERL_IMPLICIT_
 CONTEXT PERL_IMPLICIT_SYS
   Locally applied patches:
 ActivePerl Build 807
   Built under MSWin32
   Compiled at Nov  3 2003 18:19:11
   @INC:
 C:/Perl/lib
 C:/Perl/site/lib
 .
 
 
 C:\ver
 
 Microsoft Windows 2000 [Version 5.00.2195]
 
 Tshimanga.
 
 
 


RE: DBI and subqueries

2003-12-04 Thread Sterin, Ilya (I.)
how about turning on trace(2, log.txt).

Just insert DBI-trace(2, log.txt); after or before connect.

Ilya

 -Original Message-
 From: Marc Lambrichs [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 04, 2003 11:48 AM
 To: [EMAIL PROTECTED]
 Subject: DBI and subqueries
 
 
 Using perl DBI, mysql 4.1, we don't get any rows back. The query is
 perfectly ok, works on mysql-client. Trying to get some 
 results from this
 code: (do not worry about the usefullness of the query. the 
 fact that it's a
 subquery is probably the cause, or isn't it?) Please help.
 
 my $sql2 = EOF;
 select max.max_id
 from
  ( select qu2.id as max_id
   , max(qa2.value) as max_value
  from question_answer qa2
 , question qu2
  where qa2.ref_question  = qu2.id
and qa2.ref_questionnaire = 5
  group by qu2.id ) as max
 where max.max_id  0
 EOF
 
# Trust me, this works.
$dbh  = Web::Util-get_ctrl_dbh();
# Get the list from the database
eval {
   $sth = $dbh-prepare( $sql2 );
   $sth-execute();
   my $name = undef;
   $sth-bind_columns(undef, \$name);
   while ($sth-fetch) {
 $doc .= $name/$name;
   }
   Web::Util-log('info', $self-load(), $doc);
   $self-xml($doc);
};
if ($@) {
   Web::Util-log('error', $self-load(), Error: $@);
}
 
 Any ideas?
 
 Cheers,
 -- 
 Marc Lambrichs
 
 


RE: Keeping PERL DBI Quiet

2003-11-25 Thread Sterin, Ilya (I.)
Look into the docs.  RaiseError and PrintError attributes need to be turned off.

Ilya

 -Original Message-
 From: CDitty [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, November 25, 2003 1:15 PM
 To: [EMAIL PROTECTED]
 Subject: Keeping PERL DBI Quiet
 
 
 Can someone tell me how to keep perl dbi silent when something goes 
 wrong?  ie.I do a table cleanup before I start importing my 
 data.  Basically, I just delete what temp tables are there.  
 If my script 
 crashed on a previous run, it leaves some temp tables behind. 
  I need to 
 clear those tables before I can import data.
 
 In php, I leave off the or die() statement and php doesn't 
 fuss if those 
 tables are not there.  But with perl dbi, it fusses if the tables are 
 missing even with the DIE command missing.
 
 I've done google searches and haven't been able to find 
 anything useful.
 
 Chris
 


RE: New to DBI

2003-09-29 Thread Sterin, Ilya (I.)
my $sth = $dbh-prepare(select .);
$sth-execute();

my $data = $sth-fetchrow_hashref();

my $list = $data-{'Col1'};



Ilya

-Original Message-
From: Goodman Kristi - kgoodm [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 11:19 AM
To: '[EMAIL PROTECTED]'
Subject: New to DBI


Hello!

I am a Win32::ODBC user and I am trying to convert to DBI.  However, I am
having trouble trying to figure out how to do one thing.  How can you return
a hash where you can assign the values returned to a variable.


This is the code I have from using the WIN32::ODBC module and I would like
to do the same thing using DBI.

$db1-Sql(SELECT * FROM WORKREQUEST WHERE (WRID = '$wrnum' ) );
$db1-FetchRow();
%db1hash = $db1-DataHash();
$list   = $db1hash{'ListID'};  #ListID is the column name
$proj   = $db1hash{'ProjID'}; #ProjID is the column name
ect...



Can anyone help?  Please let me know if this is not a clear explanation on
what I am trying to do.

Thanks!
Kristi








Kristi Goodman 
Technical Support Specialist 
AECMS, O/ITS
Acxiom Corporation , Conway Campus








**
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.


RE: SQL Parser

2003-09-08 Thread Sterin, Ilya (I.)
Sure, look at SQL::Statement module.  It has an SQL::Parser packaged with it.

Ilya

-Original Message-
From: Ian Harisay [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 2:05 PM
To: [EMAIL PROTECTED]
Subject: SQL Parser


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: Oracle 9i, CGI error.

2003-08-12 Thread Sterin, Ilya
It should work, make sure your connection parameters are OK.  If not,
fix them. 

Another thing to do, is run a trace...

DBI-trace(5, trace.log);

And you can increase the levels up to 10, for more info.  See what's
going on at connect.

Ilya

 -Original Message-
 From: Karpagam, Madhana (M.) [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 08, 2003 4:02 PM
 To: '[EMAIL PROTECTED]'
 Cc: Broski, Jeffrey (J.M.)
 Subject: Oracle 9i, CGI error.
 
 
 We moved to Oracle 9i recently. The perl scripts are giving 
 out the following error. it is working fine when connecting 
 to Oracle 7.3. An error has occurred that prevents this. The 
 most likely reason is : 
 [08/Aug/2003:15:57:18] failure (15444): for host 19.49.159.74 
 trying to GET /cgi-bin/PPMHome.cgi, cgieng_scan_headers 
 reports: the CGI program 
 /ford/thishost/u/eppm/www.80/cgi-bin/PPMHome.cgi did not 
 produce a valid header (name without value: got line can't 
 call method prepare without a package or object reference 
 at /ford/thishost/u/eppm/www.80/cgi-bin/ppmhome.cgi line 357.) 
 Please contact the application owner to correct this problem. 
 Please advise what needs to be done for the DB connection to 
 work with Oracle 9i. What is a compatible version on DB  to 
 work with 9i. Thanks, Madhana Karpagam.
 
 


RE: DBI FAQ (FAQ-O-Matic) Back Up!!!

2003-07-22 Thread Sterin, Ilya
Yes, sorry, the users file wasn't cascaded.

Thanks.

Ilya

 -Original Message-
 From: Thomas A. Lowery [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, July 22, 2003 6:28 PM
 To: [EMAIL PROTECTED]
 Subject: Re: DBI FAQ (FAQ-O-Matic) Back Up!!!
 
 
 Do we need to re-register to contribute?
 
 On Tue, Jul 22, 2003 at 03:02:08AM -0400, Ilya Sterin wrote:
  In the midst of learning Combust (the new perl.org development 
  framework), so that I can get the dbi.perl.org site up and running 
  fairly quickly, I took an evening to set up the DBI FAQ, 
 that so many 
  of you have contributed to and it has been down for quite a 
 while now.
  
  
  Here is the new URL.
  
  http://dev.isystek.com/dbi/fom.cgi
  
  
  Please take a note a refer people to it as needed.
  
  Any and all contributions are also welcomed.
 


RE: SQL Statement Size

2003-07-18 Thread Sterin, Ilya
DBI will pass any length you give it, it's up to the database to be able
to except the size.  If your DB has a limitation and needs to be
configured, you can't do this through DBI.  DBI is to run queries,
etc... against database, you can't perform native DB functions through
it.

Ilya

 -Original Message-
 From: Rasoul Hajikhani [mailto:[EMAIL PROTECTED] 
 Sent: Friday, July 18, 2003 5:06 PM
 To: dbi
 Subject: SQL Statement Size 
 
 
 Hello there,
 I am trying to find out if there is a way of setting INSERT/UPDATE 
 statement size to some large number. I have a 6867 kb data 
 that I need 
 to insert into a table. The man pages mention the LongReadLen but 
 nothing about insert/update statement length.
 I am using Informix US w/ DBI version 1.21
 
 Any help will be appreciated...
 Thanks in advance
 -r
 


RE: SQL Statement Size

2003-07-18 Thread Sterin, Ilya
Yes, but not for all functions.  That function has to be supported by
the driver, correct?

Ilya

 -Original Message-
 From: Rudy Lippan [mailto:[EMAIL PROTECTED] 
 Sent: Friday, July 18, 2003 9:47 PM
 To: Sterin, Ilya
 Cc: 'dbi'; 'Rasoul Hajikhani'
 Subject: RE: SQL Statement Size 
 
 
 On Fri, 18 Jul 2003, Sterin, Ilya wrote:
 
  configured, you can't do this through DBI.  DBI is to run queries, 
  etc... against database, you can't perform native DB 
 functions through 
  it.
  
 
 $h-func(@func_arguments, $func_name);
 
 -r
 


RE: dbd-oracle for perl 5.8 ppm module

2003-07-18 Thread Sterin, Ilya
Please see the archives for this group.  It's been brought up numerous
times in the last few weeks.

Ilya

 -Original Message-
 From: Jeffrey Beckstrom [mailto:[EMAIL PROTECTED] 
 Sent: Monday, June 30, 2003 2:57 PM
 To: [EMAIL PROTECTED]
 Subject: dbd-oracle for perl 5.8 ppm module
 
 
 Looking for the ppm version of dbd-oracle.  A google search 
 turned up www.xmlproj.com for it, but that server no longer exists.
 
 I have no C compiler so I can not get the source to compile.
 
 
 
 Jeffrey Beckstrom
 Database Administrator
 Greater Cleveland Regional Transit Authority
 1240 W. 6th Street
 Cleveland, Ohio 44113
 (216) 781-4204
 


RE: 'built with DBI' image?

2003-07-15 Thread Sterin, Ilya
I'll let Tim respond with contest details, but for what it's worth...

Tim if we would have the contest now, it'd be in time for the launching of
the new DBI site.

Ilya

-Original Message-
From: John Costello
To: [EMAIL PROTECTED]
Sent: 7/15/03 12:54 PM
Subject: 'built with DBI' image?


This is part question, part very-late-reminder-to-Ilya.  Is there an
image
for 'built with DBI' or some such?  I recall that someone (Tim?) wanted
to
have a contest for the image.

John
cos at indeterminate dot net



RE: DBD MySQL Installation Help...

2003-07-15 Thread Sterin, Ilya
You will have to at least install the myswl development libraries, so you
won't have to install the server itself.  And, no, you can't compile it
without the libs...

For windows, you can install the binary ppm but to run it you'll still need
the proper dlls installed.  I believe Randy's repository at the university
of winnipeg, he includes the proper dlls in the ppm distros, so you don't
have to install them.

But I don't know of any non-win32 distros for DBD::Mysql binaries.  Also,
even if you do transfer the binaries, the mysql libraries might not work,
given if they are compiled on different architectures.

I don't know if there is a way to compile DBD::mysql statically, though I
doubt it.

Ilya

-Original Message-
From: NIPP, SCOTT V (SBCSI)
To: '[EMAIL PROTECTED]'
Sent: 7/15/03 10:43 AM
Subject: DBD MySQL Installation Help...

Is it possible to install the Perl DBD for MySQL on a system
that
does not have MySQL installed?  Basically, I am wanting for numerous
servers
to be able to connect and interact with a MySQL database on another
server.
Only 2 servers have MySQL installed, none of the others do.  how do I
get
the DBD driver to install on systems without MySQL installed?  Thanks in
advance for the help.  If I missed this in the docs, I apologize in
advance.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



RE: Broken link at dbi.perl.org

2003-07-15 Thread Sterin, Ilya
Yes, we know.  We still have the FAQ, but it's not up.  I'll be back up
within a few days once we get the new dbi.perl.org site up.

Ilya

 -Original Message-
 From: Ron Savage [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, July 15, 2003 6:56 PM
 To: DBI users
 Subject: Broken link at dbi.perl.org
 
 
 Hi Folks
 
 If you go to http://dbi.perl.org/doc/index.html
 and click on DBI FAQ-o-Matic (New!), you ain't New!, you are History!
 -- 
 Cheers
 Ron Savage, [EMAIL PROTECTED] on 07/16/2003 
 http://savage.net.au/index.html
 


RE: Remote SQL Server Database Connection (examples please !)

2003-07-13 Thread Sterin, Ilya
Yes, looks like install went fine.  Now the next step would be to read
perldoc for DBI and DBD::ODBC.

All examples are there, if you have issues, then post again.

Ilya

-Original Message-
From: Walter Lamagna
To: DBI-Users Mail List
Sent: 7/13/03 7:47 PM
Subject: Remote SQL Server Database Connection (examples please !)

Hello:

I am new in this list and have just a little experience with Perl.

I want to connect to a remote SQL Server database and would like to
receive an example of how to do this.
I installed the iodbc (Drivers Manager) and then the DBD::ODBC, modules,
i had to download the .rpms from libodbc because the installation with
perl -MCPAN -e shell gave some errors, i have the perl v 5.8.0.

Now, i have the ODBC database driver, so i suppose that the installation
was successful, i see the database drivers with this script:

#!/usr/bin/perl
# dbdrivers.pl
use DBI;
@drivers = DBI-available_drivers(1);
foreach $text (@drivers) {
  print ($text\n);
}

-- 

Walter M. Lamagna
Systems Analyst
http://www.walterlamagna.com.ar


RE: DBI/DBD Oracle

2003-07-11 Thread Sterin, Ilya (I.)
perl -MDBI

and 

perl -MDBD::Oracle

If either hang, that means that module is installed, if it shows something
about can't find in @INC, then it's not.

Ilya

-Original Message-
From: Robert [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 3:36 PM
To: [EMAIL PROTECTED]
Subject: DBI/DBD Oracle


Hi list,
How do I verify whether DBI/DBD Oracle is installed on Solaris 7 server?,
please let me know.
 




-
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!


RE: location of PPM for DBD-Oracle?

2003-07-10 Thread Sterin, Ilya (I.)
Read the archive from this morning.  I replied to a similar question.

Ilya

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 1:00 PM
To: [EMAIL PROTECTED]
Subject: location of PPM for DBD-Oracle?


I'm running ActiveState Perl 5.08 on Windows XP. I wish to query an Oracle
8.1.7 database via a Perl script. I have used PPM to install the DBI module,
but so far I can't find a PPM repository with a copy of DBD-Oracle. Can
someone point me to one or suggest an alternative for querying Oracle from
Perl? Thanks.

-- 
Charles Knell
[EMAIL PROTECTED] - email


RE: dbd-oracle for perl 5.8 ppm module

2003-07-09 Thread Sterin, Ilya
Yes, unfortunately xmlproj.com is now owned by a domain sales company,
as I was screwed by a registrar.
In the future we might set up something on dbi.perl.org, but right now
we're just updating the site, etc... so any extra project might take a
bit of time.  Getting the FAQ back up is #1 priority.

Recently, Jeff was very kind enough to set up a repository...
ftp://ftp.esoftmatic.com/outgoing/DBI

Just use 'ppm set rep DBI-STUFF ftp://ftp.esoftmatic.com/outgoing/DBI'

and then the regular ppm install commands to install.

Ilya


 -Original Message-
 From: Jeffrey Beckstrom [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, June 26, 2003 1:59 PM
 To: [EMAIL PROTECTED]
 Subject: dbd-oracle for perl 5.8 ppm module
 
 
 Looking for the ppm version of dbd-oracle.  A google search 
 turned up www.xmlproj.com for it, but that server no longer exists.
 
 I have no C compiler so I can not get the source to compile.
 
 
 
 Jeffrey Beckstrom
 Database Administrator
 Greater Cleveland Regional Transit Authority
 1240 W. 6th Street
 Cleveland, Ohio 44113
 (216) 781-4204
 


RE: Module can't find itself

2003-06-06 Thread Sterin, Ilya (I.)
Ah, I know what it is...

go to ~/perl, you'll see that that directory has something like site_perl, etc... 
drill down until you get to the part where DBI.pm is stored, and add that path.

Ilya

-Original Message-
From: Antonio Garcia [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 1:18 PM
To: Sterin, Ilya (I.)
Cc: [EMAIL PROTECTED]
Subject: RE: Module can't find itself



But as the error messages show, the correct path is being added to @INC,
regardless of the possible ambiguity in the use of $ENV{HOME}. A.

~
Antonio Garcia-Martinez
cryptologia.com

On Thu, 5 Jun 2003, Sterin, Ilya (I.) wrote:

 Well, $ENV{HOME} is specific to your environment.  If you are executing it through 
 the server (browser), then it runs under a different environment.  Hardcoding the 
 use lib part would be better.

 Ilya

 -Original Message-
 From: Antonio Garcia [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 05, 2003 1:02 PM
 To: [EMAIL PROTECTED]
 Subject: Module can't find itself



 I am intalling DBI on a Sun workstation. Since I don't have root access, I
 simply put DBI.pm in ~/perl, and then add it to @INC at runtime via

 use lib $ENV{HOME}/perl;

 However, while my perl script finds DBI, DBI does not seem to find itself:

 [EMAIL PROTECTED]:/pseudo/ 96% perl loadFastaDB.pl
 2L_translation_dmel_RELEASE3-1.QUER
 Y Drosophila tblastn_results
 Can't locate loadable object for module DBI in @INC (@INC contains:
 /home/agm/pe
 rl /home/agm/perl/DBI /home/agm/perl /usr/perl5/5.00503/sun4-solaris
 /usr/perl5/
 5.00503 /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005
 .) at
  /home/agm/perl/DBI/DBI.pm line 256
 BEGIN failed--compilation aborted at /home/agm/perl/DBI/DBI.pm line 256.
 BEGIN failed--compilation aborted at loadFastaDB.pl line 7.


 Using the perl debugger:

 [EMAIL PROTECTED]:/pseudo/ 98% perl -d loadFastaDB.pl
 2L_translation_dmel_RELEASE3-1.QUERY Drosophila tblastn_results

 Loading DB routines from perl5db.pl version 1.0402
 Emacs support available.

 Enter h or `h h' for help.

 Can't locate loadable object for module DBI in @INC (@INC contains:
 /home/agm/perl /home/agm/perl/DBI /home/agm/perl
 /usr/perl5/5.00503/sun4-solaris /usr/perl5/5.00503
 /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005 .) at
 /home/agm/perl/DBI/DBI.pm line 256
 Carp::croak('Can\'t locate loadable object for module DBI in @INC
 (@INC conta...') called at /usr/perl5/5.00503/sun4-solaris/DynaLoader.pm
 line 93
 DynaLoader::croak('Can\'t locate loadable object for module DBI in
 @INC (@INC conta...') called at
 /usr/perl5/5.00503/sun4-solaris/DynaLoader.pm line 144
 DynaLoader::bootstrap('DBI') called at /home/agm/perl/DBI/DBI.pm
 line 249
 DBI::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 256
 eval {...} called at /home/agm/perl/DBI/DBI.pm line 256
 require DBI/DBI.pm called at loadFastaDB.pl line 7
 main::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 256
 eval {...} called at /home/agm/perl/DBI/DBI.pm line 256
 BEGIN failed--compilation aborted at /home/agm/perl/DBI/DBI.pm line 256.
 require DBI/DBI.pm called at loadFastaDB.pl line 7
 main::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 256
 eval {...} called at /home/agm/perl/DBI/DBI.pm line 256
 main::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 7
 eval {...} called at /home/agm/perl/DBI/DBI.pm line 7
 BEGIN failed--compilation aborted at loadFastaDB.pl line 7.
 Debugged program terminated.  Use q to quit or R to restart,


 Oddly, it seems there is an error within DBI, in that it can't find DBI.pm
 (!).

 I have two copies of DBI.pm: ~/perl/DBI.pm and ~/perl/DBI/DBI.pm (if that
 might have anything to do with it).

 Any ideas what to do to get DBI running?

 Thanks, A.


 ~
 Antonio Garcia-Martinez
 cryptologia.com



RE: Module can't find itself

2003-06-06 Thread Sterin, Ilya (I.)
@INC, is used within all cripts included in the script.

Look at Ronald's reply, that might be an issue as well.

Ilya

-Original Message-
From: Antonio Garcia [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 1:25 PM
To: Sterin, Ilya (I.)
Cc: [EMAIL PROTECTED]
Subject: RE: Module can't find itself



Actually, ~/perl does not have a directory in it called site_perl. In any
case it would not have to drill down, as with the @INC pointing to both
~/perl and ~/perl/DBI, it has access to two copies of DBI.pm.

The error is being thrown WITHIN DBI.pm, so clearly it is being
found...hence the confusion of how a module cannot find itself.

Is the @INC passed to all modules called within a script, or must @INC be
reconfigured within every module called? I can't imagine the latter is
true...

A.

~
Antonio Garcia-Martinez
cryptologia.com

On Thu, 5 Jun 2003, Sterin, Ilya (I.) wrote:

 Ah, I know what it is...

 go to ~/perl, you'll see that that directory has something like site_perl, etc... 
 drill down until you get to the part where DBI.pm is stored, and add that path.

 Ilya

 -Original Message-
 From: Antonio Garcia [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 05, 2003 1:18 PM
 To: Sterin, Ilya (I.)
 Cc: [EMAIL PROTECTED]
 Subject: RE: Module can't find itself



 But as the error messages show, the correct path is being added to @INC,
 regardless of the possible ambiguity in the use of $ENV{HOME}. A.

 ~
 Antonio Garcia-Martinez
 cryptologia.com

 On Thu, 5 Jun 2003, Sterin, Ilya (I.) wrote:

  Well, $ENV{HOME} is specific to your environment.  If you are executing it through 
  the server (browser), then it runs under a different environment.  Hardcoding the 
  use lib part would be better.
 
  Ilya
 
  -Original Message-
  From: Antonio Garcia [mailto:[EMAIL PROTECTED]
  Sent: Thursday, June 05, 2003 1:02 PM
  To: [EMAIL PROTECTED]
  Subject: Module can't find itself
 
 
 
  I am intalling DBI on a Sun workstation. Since I don't have root access, I
  simply put DBI.pm in ~/perl, and then add it to @INC at runtime via
 
  use lib $ENV{HOME}/perl;
 
  However, while my perl script finds DBI, DBI does not seem to find itself:
 
  [EMAIL PROTECTED]:/pseudo/ 96% perl loadFastaDB.pl
  2L_translation_dmel_RELEASE3-1.QUER
  Y Drosophila tblastn_results
  Can't locate loadable object for module DBI in @INC (@INC contains:
  /home/agm/pe
  rl /home/agm/perl/DBI /home/agm/perl /usr/perl5/5.00503/sun4-solaris
  /usr/perl5/
  5.00503 /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005
  .) at
   /home/agm/perl/DBI/DBI.pm line 256
  BEGIN failed--compilation aborted at /home/agm/perl/DBI/DBI.pm line 256.
  BEGIN failed--compilation aborted at loadFastaDB.pl line 7.
 
 
  Using the perl debugger:
 
  [EMAIL PROTECTED]:/pseudo/ 98% perl -d loadFastaDB.pl
  2L_translation_dmel_RELEASE3-1.QUERY Drosophila tblastn_results
 
  Loading DB routines from perl5db.pl version 1.0402
  Emacs support available.
 
  Enter h or `h h' for help.
 
  Can't locate loadable object for module DBI in @INC (@INC contains:
  /home/agm/perl /home/agm/perl/DBI /home/agm/perl
  /usr/perl5/5.00503/sun4-solaris /usr/perl5/5.00503
  /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005 .) at
  /home/agm/perl/DBI/DBI.pm line 256
  Carp::croak('Can\'t locate loadable object for module DBI in @INC
  (@INC conta...') called at /usr/perl5/5.00503/sun4-solaris/DynaLoader.pm
  line 93
  DynaLoader::croak('Can\'t locate loadable object for module DBI in
  @INC (@INC conta...') called at
  /usr/perl5/5.00503/sun4-solaris/DynaLoader.pm line 144
  DynaLoader::bootstrap('DBI') called at /home/agm/perl/DBI/DBI.pm
  line 249
  DBI::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 256
  eval {...} called at /home/agm/perl/DBI/DBI.pm line 256
  require DBI/DBI.pm called at loadFastaDB.pl line 7
  main::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 256
  eval {...} called at /home/agm/perl/DBI/DBI.pm line 256
  BEGIN failed--compilation aborted at /home/agm/perl/DBI/DBI.pm line 256.
  require DBI/DBI.pm called at loadFastaDB.pl line 7
  main::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 256
  eval {...} called at /home/agm/perl/DBI/DBI.pm line 256
  main::BEGIN() called at /home/agm/perl/DBI/DBI.pm line 7
  eval {...} called at /home/agm/perl/DBI/DBI.pm line 7
  BEGIN failed--compilation aborted at loadFastaDB.pl line 7.
  Debugged program terminated.  Use q to quit or R to restart,
 
 
  Oddly, it seems there is an error within DBI, in that it can't find DBI.pm
  (!).
 
  I have two copies of DBI.pm: ~/perl/DBI.pm and ~/perl/DBI/DBI.pm (if that
  might have anything to do with it).
 
  Any ideas what to do to get DBI running?
 
  Thanks

RE: Module can't find itself

2003-06-06 Thread Sterin, Ilya (I.)
just do a perl -V and see what compiler was used.  Then use that compiler's command.  
Inside the makefile, you can edit the compiler.

Ilya

-Original Message-
From: Antonio Garcia [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 1:45 PM
To: Ronald J Kimball
Cc: [EMAIL PROTECTED]
Subject: Re: Module can't find itself



Actually, the /usr/ucb/cc compiler on my system is bizarrely
non-functional (hence the error). Would you know what parameter I can pass
to Makefile.PL to change what compiler it uses?

Thanks, A.

~
Antonio Garcia-Martinez
cryptologia.com

On Thu, 5 Jun 2003, Ronald J Kimball wrote:

 On Thu, Jun 05, 2003 at 10:02:06AM -0700, Antonio Garcia wrote:
 
  I am intalling DBI on a Sun workstation. Since I don't have root access, I
  simply put DBI.pm in ~/perl, and then add it to @INC at runtime via

 Did you actually install the module, or did you just copy DBI.pm into
 ~/perl?  DBI has to be installed properly to work, because it includes C
 code that must be compiled.

 You can easily install DBI anywhere you like, by running e.g.:

 perl Makefile.PL PREFIX=~/perl

 Ronald



RE: DBI FAQ off-line

2003-03-30 Thread Sterin, Ilya
Yes, but that one was a static mirror, and it needs updating:-)

Ilya

-Original Message-
From: Michael A Chase
To: Sterin, Ilya; '[EMAIL PROTECTED]'
Sent: 3/30/03 9:48 AM
Subject: Re: DBI FAQ off-line

On Sat, 29 Mar 2003 23:48:46 -0700 Sterin, Ilya [EMAIL PROTECTED]
wrote:

 Guys, for the last few days, the DBI FAQ has been off-line, due to a
 registrar problem, who has the name on hold and there is a up to 7 day
 process to transfer the domain name registrars.
 
 Sorry for the inconvenience.  The FAQ will be up and running very
 shortly.
 
 In the meantime, if someone wants to mirror it for the time being, let
me
 know and I'll send you all the required files, though you'll have to
install
 the FAQ-o-matic on the server.

The JSB mirror still is up.

http://trantor.jsbsystems.com/DBI-FAQ/ 

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


RE: $dbh-unquote()

2003-03-27 Thread Sterin, Ilya (I.)
This depends on what field in the db you are writting to.  If it's a raw
type or binary field, then you wouldn't have that problem.  There might be
some conversion going on between the db field, as \n is not a standard
carriage return, it's the way Perl interpreter interprets carriage returns
on what ever platform it was build on.  It might very possibly be converted
between an ascii field and DBI.

Ilya

-Original Message-
From: Brian Spindler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:33 AM
To: 'Paul DuBois'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()


If printed in a windows environment \n is a carriage return.
Brian


-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 11:32 AM
To: Brian Spindler; [EMAIL PROTECTED]
Subject: Re: $dbh-unquote()

At 11:19 -0500 3/27/03, Brian Spindler wrote:
Hi guys, gals!

   I have a pretty big string that I am inserting into MySQL via the
$dbh-quote($str) function, this works great however now when I pull the
data back out of the database and go to write it to a file the \n
characters
that were inserted by quote are not being written back out as carriage
returns as desired.  How can do a reverse of quote() or just get those
\n's to print out as they should! =) ahh.. I'm frustrated, I tried
everything even split('\n',$str) and then reinserting the \n.  Doesn't
work, please help!

Thanks in advance!
Brian

What do you mean by as they should?  After all, \n isn't a carriage
return.


RE: $dbh-unquote()

2003-03-27 Thread Sterin, Ilya (I.)
Yes, I'd try long raw, see if that helps.  Also, as Jeff mentioned, try using binmode.

Ilya

-Original Message-
From: Brian Spindler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 12:24 PM
To: 'Sterin, Ilya (I.)'; 'Paul DuBois'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()


Interesting, in my MySQL database the field is a longtext should I change it
to a one of the binary types?

Brian 

-Original Message-
From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 11:38 AM
To: 'Brian Spindler'; 'Paul DuBois'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()

This depends on what field in the db you are writting to.  If it's a raw
type or binary field, then you wouldn't have that problem.  There might be
some conversion going on between the db field, as \n is not a standard
carriage return, it's the way Perl interpreter interprets carriage returns
on what ever platform it was build on.  It might very possibly be converted
between an ascii field and DBI.

Ilya

-Original Message-
From: Brian Spindler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:33 AM
To: 'Paul DuBois'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()


If printed in a windows environment \n is a carriage return.
Brian


-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 11:32 AM
To: Brian Spindler; [EMAIL PROTECTED]
Subject: Re: $dbh-unquote()

At 11:19 -0500 3/27/03, Brian Spindler wrote:
Hi guys, gals!

   I have a pretty big string that I am inserting into MySQL via the
$dbh-quote($str) function, this works great however now when I pull the
data back out of the database and go to write it to a file the \n
characters
that were inserted by quote are not being written back out as carriage
returns as desired.  How can do a reverse of quote() or just get those
\n's to print out as they should! =) ahh.. I'm frustrated, I tried
everything even split('\n',$str) and then reinserting the \n.  Doesn't
work, please help!

Thanks in advance!
Brian

What do you mean by as they should?  After all, \n isn't a carriage
return.


RE: $dbh-unquote()

2003-03-27 Thread Sterin, Ilya (I.)
Well, if the file is transfered using FTP binary mode, the Unix new line is
never converted to a Windows new line, therefore, it won't show up on
windows files as a new line break.

Ilya

-Original Message-
From: Brian Spindler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 12:59 PM
To: 'Paul DuBois'; 'Sterin, Ilya (I.)'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()


Ok, I don't know how its happening either but here is the entire breakdown:

MySQL field: longtext

Step(1) - Text File is created on unix machine, transferred via FTP to a
Windows machine.

Step(2) - Perl script reads in the file and parses it grabbing certain lines
and inserts them into the database like so:

@inv_data = $dbh-quote(@inv_data);
$dbh-do(INSERT INTO ads_ff VALUES (?,?,?,?,?,?,?,?,?,?,?), undef,
$inv_no,$ord_no,$date.'!',$tp,'1',$cust_po_num,$cust_num,@inv_data,
$mysql_date,$inv_tot,$file);  

All the values are derived from substr() commands and passed to the method
which executes the latter.

Brian

-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 12:40 PM
To: Brian Spindler; 'Sterin, Ilya (I.)'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()

At 12:24 -0500 3/27/03, Brian Spindler wrote:
Interesting, in my MySQL database the field is a longtext should I change
it
to a one of the binary types?

That won't make any difference.

I don't know how your problem occurred in fact, but here's one way that
it *can* occur.  Maybe this will shed some light on your problem.

$x = $dbh-quote (\n);

$dbh-do (INSERT INTO t SET col = $x);

That will insert a newline into the database.

$x = $dbh-quote ('\n');

$dbh-do (INSERT INTO t SET col = $x);

That will insert a literal backslash-n into the database.

See the difference?




Brian

-Original Message-
From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:38 AM
To: 'Brian Spindler'; 'Paul DuBois'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()

This depends on what field in the db you are writting to.  If it's a raw
type or binary field, then you wouldn't have that problem.  There might be
some conversion going on between the db field, as \n is not a standard
carriage return, it's the way Perl interpreter interprets carriage returns
on what ever platform it was build on.  It might very possibly be converted
between an ascii field and DBI.

Ilya

-Original Message-
From: Brian Spindler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:33 AM
To: 'Paul DuBois'; [EMAIL PROTECTED]
Subject: RE: $dbh-unquote()


If printed in a windows environment \n is a carriage return.
Brian


-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:32 AM
To: Brian Spindler; [EMAIL PROTECTED]
Subject: Re: $dbh-unquote()

At 11:19 -0500 3/27/03, Brian Spindler wrote:
Hi guys, gals!

  I have a pretty big string that I am inserting into MySQL via the
$dbh-quote($str) function, this works great however now when I pull the
data back out of the database and go to write it to a file the \n
characters
that were inserted by quote are not being written back out as carriage
returns as desired.  How can do a reverse of quote() or just get those
\n's to print out as they should! =) ahh.. I'm frustrated, I tried
everything even split('\n',$str) and then reinserting the \n.  Doesn't
work, please help!

Thanks in advance!
Brian

What do you mean by as they should?  After all, \n isn't a carriage
return.


RE: MySQL and JDBC

2003-02-05 Thread Sterin, Ilya (I.)
This is a Java language, more than Perl, unless you'll use the Perl's JDBC bridge.  
And Tomcat really has nothing do with that at that point, it's a server.

If you are looking for a Java answer, refer your question to either a java list, or I 
strongly recommend looking into the Struts framework.  (IMO it's the best web 
development framework available period and utilizes the MVC (Model View Controler) 
infrastructure.

You can get info on all on jakarta.apache.org.

Ilya

-Original Message-
From: Tay, William [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 2:16 PM
To: '[EMAIL PROTECTED]'
Subject: MySQL and JDBC


Hi,

I am developing a Web application that uses servlets as the server side
scripting language, and Mysql as the database engine. Could you point me to
where I can get information about how to use JDBC to connect Tomcat to
Mysql?

Thanks.

Will  



RE: ODBC via tcp

2003-02-04 Thread Sterin, Ilya (I.)
Hmmm, is your client on Unix/Linux?  If not, just set up a DSN in ODBC to point to the 
db, if yes, then an appropriate driver (and there are many) for Linux/Unix needs to be 
installed and DSN set up in a similar way.

Ilya

-Original Message-
From: Skorpion [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 10:05 AM
To: [EMAIL PROTECTED]
Subject: ODBC via tcp


how to use DBD::ODBC to connect sql server on nt machine
do i have to install odbc-odbc bridge on client and server or is any
simplest way to connect mssql via tcp ?
greg




FW: (Fwd)

2003-01-31 Thread Sterin, Ilya
Hey, contact me in person, and I'll try to help.

Here is the deal.  www.xmlproj.com/PPM now has perl 5.6 and perl 5.8
PPMs.  ppm utility does not have to take the full URL.  All you really
have to do, is add the www.xmlproj.com/PPM or any other respository to
your PPM database, like this...

ppm add respository XMLPROJ http://www.xmlproj.com/PPM/

Ilya Sterin

-Original Message-
From: Kulahalli Steve-ESK035 [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 21, 2003 2:26 PM
To: 'Sterin, Ilya'; 'Tim Bunce ';
[EMAIL PROTECTED]@il06exr04.mot.com
Cc: [EMAIL PROTECTED]@il06exr04.mot.com
Subject: RE: (Fwd)


Hi Tim and Ilya,
I have encountered this problem and many more have encountered this
problem! The standard PERL/PPM install on WIndows will not load/install
the DBD::Oraperl package as it is not on the default repository that is
set when standard PERL is installed. Not many people understand PPM
takes an URL for install; but assuming they did, how will they know
where such a PPD exists. If somebody can take the little trouble of
installing the PPD in the standard repository location it will be of
great help! The problem is compounded due to the fact that the
ActiveState PERL web site shows latest version 5.8.x available. We spent
more than 10 days to figure out that 5.8 or latest PERL releases do not
things set up properly. I could not find one Net searchable site that
explains this issue 100's have encountered. Pls. let me know if you need
some manpower for this. May be I can be of help! It was amazingly
frustrating for all PERL experts at work here (using it for 3-4 years on
UNIX). 
Thanks and sorry for sounding a little frustrated, but ready to help if
you think I can, Steve [EMAIL PROTECTED]

-Original Message-
From: Sterin, Ilya [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 2:06 PM
To: 'Tim Bunce '; [EMAIL PROTECTED]@il06exr04.mot.com
Cc: [EMAIL PROTECTED]@il06exr04.mot.com
Subject: RE: (Fwd)


Where did you find that information out.  Of course they are available.

The latest can be obtained from

ppm install http://xmlproj.com/PPM/DBD-Oracle.ppd

Ilya

-Original Message-
From: Tim Bunce
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: 1/21/03 4:17 AM
Subject: (Fwd)

- Forwarded message from Mustafa Attaree [EMAIL PROTECTED] -

Delivered-To: [EMAIL PROTECTED]
From: Mustafa Attaree [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: 
Date: Fri, 17 Jan 2003 11:17:30 +0530

I have been using Perl in my company extensively since last 3 yrs i have
reqularly update all my perl versions 
and almost all reporting programs are written in perl front ends are too
developed in perl using backend databases 
like PostgreSql, MySql Oracle, DB2 and DBASE, but since 14th Jan -2003 i
tried to download module 
for DBD-Oracle 1.12 or later but my ppm flashed an eror stating that
.ppd not found, on searching for the 
desired module  i found out to my notice that the DBD-Oracle1.12 or
later modules are not available for windows 
can you please help as we in a deep mess 

Thanks

Mustafa Attari
DIREM Marketing Services Pvt. Ltd.
Tel - 24960033
Site - www.direm.com

- End forwarded message -



RE: (Fwd)

2003-01-21 Thread Sterin, Ilya
Where did you find that information out.  Of course they are available.

The latest can be obtained from

ppm install http://xmlproj.com/PPM/DBD-Oracle.ppd

Ilya

-Original Message-
From: Tim Bunce
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: 1/21/03 4:17 AM
Subject: (Fwd)

- Forwarded message from Mustafa Attaree [EMAIL PROTECTED] -

Delivered-To: [EMAIL PROTECTED]
From: Mustafa Attaree [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: 
Date: Fri, 17 Jan 2003 11:17:30 +0530

I have been using Perl in my company extensively since last 3 yrs i have
reqularly update all my perl versions 
and almost all reporting programs are written in perl front ends are too
developed in perl using backend databases 
like PostgreSql, MySql Oracle, DB2 and DBASE, but since 14th Jan -2003 i
tried to download module 
for DBD-Oracle 1.12 or later but my ppm flashed an eror stating that
.ppd not found, on searching for the 
desired module  i found out to my notice that the DBD-Oracle1.12 or
later modules are not available for windows 
can you please help as we in a deep mess 

Thanks

Mustafa Attari
DIREM Marketing Services Pvt. Ltd.
Tel - 24960033
Site - www.direm.com

- End forwarded message -



RE: installation trouble

2003-01-17 Thread Sterin, Ilya (I.)
Hmmm, I think that would be because ActiveState does not yet have a DBD::Oracle ppm 
for 5.8 architecture.

I might start one this weekend on xmlproj.com, if someone with Oracle libs can compile 
and send me the .tar.gz of the blib dir or create the ppm.

In the meantime, try something like this...


ppm install http://xmlproj.com/PPM/DBD-Oracle.ppd

Let me know if that works.

Ilya

-Original Message-
From: Kirilenkov, Andrei [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:00 AM
To: [EMAIL PROTECTED]
Subject: installation trouble


Hi Tim,

I have installed ActivePerl-5.8.0.804-MSWin32-x86.msi under Windows XP, SP1

install DBD::mysql has worked alright.

but I can't install DBD::Oracle:

ppm installDBD::Oracle
searching for 'DBD::Oracle' returned no results. try a broader search first.

I would be grateful to you for any advice on how to install DBD Oracle.
I failed to find anything in the documentation.

Andrei Kirilenkov




FW: Why nobody can help me?

2003-01-17 Thread Sterin, Ilya
The reason no one has answered is because you sent the question to the wrong
list.  dbi-dev is only for the DBI and DBD core developers, not for users
that utilize it for their programs.  Here we discuss new features, bugs,
etc...

You should send everything to [EMAIL PROTECTED], hopefuly you subscribed to
that one as well.

I'm forwarding this message there.

Ilya

-Original Message-
From: Nikolay Melekhin
To: [EMAIL PROTECTED]
Sent: 1/17/03 2:57 AM
Subject: Why nobody can help me?


  Hi!
  I already sent message about ORA-01722 error.
  But anybody has not answered. Why?

  If NLS_TERRITORY set to territory for which a decimal separator is the
comma
  (for example, CIS) and create following table and one data record
  in it:

  CREATE TABLE TEST (A NUMBER(6,2));
  INSERT INTO TEST VALUES (2.5);

  $dbh-connect(...);
  $sth-prepare('SELECT * FROM TEST');
  $sth-execute;
  @row=$sth-fetchrow_array;
  print $row[0];

  The result will be string '2,5', but not number 2.5

-- 
Best regards, Nikolay Melekhin mailto:[EMAIL PROTECTED]



xmlproj.com is back up

2003-01-16 Thread Sterin, Ilya (I.)
Ok, site back up.

Ilya



-Original Message-
From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 3:07 PM
To: 'Bart Lateur'; [EMAIL PROTECTED]
Subject: RE: What's with xmlproj.com?


Ah, great.  I thought he'd be gone to Boston before that.  Nice to know it'll be 
fixed.  I take it he's going to the LinuxWorld in NYC.

Ilya

-Original Message-
From: Bart Lateur [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 2:58 PM
To: [EMAIL PROTECTED]
Subject: Re: What's with xmlproj.com?


On Wed, 15 Jan 2003 11:08:24 -0700, Sterin, Ilya wrote:

Matt Sergeant is hosting xmlproj.com on his AxKit server.  That server is
down as well, maybe he's upgrading or something, I'll ping him in a bit.

Ah, OK, now I see. See Matts' journal on http://use.perl.org. From
what I gather, his own server is normally connected to the internet via
DSL, and his DSL modem (router?) is broken.

http://use.perl.org/~Matts/journal

-- 
Bart.



RE: What's with xmlproj.com?

2003-01-15 Thread Sterin, Ilya
NO, this is not hosted with Verio, I'd never pay such rediculous prices:-)
Hosting should be cheap or free, it's just bandwidth and a little space.

Matt Sergeant is hosting xmlproj.com on his AxKit server.  That server is
down as well, maybe he's upgrading or something, I'll ping him in a bit.

Ilya

-Original Message-
From: Jeff Thies
Cc: [EMAIL PROTECTED]
Sent: 1/15/03 10:38 AM
Subject: Re: What's with xmlproj.com?

 I tried to check out some of the latest modules for Windows, using the
 URL http://xmlproj.com/PPM/. (I tried www.xmlproj.com, too.) After
 some time, I get a DNS lookup error.  It looks like this domain has
 expired.

They were dead yesterday also. It looks like the domain is up to date:

http://www.networksolutions.com/cgi-bin/whois/whois?STRING=xmlproj.com;
SearchType=doSTRING2.x=31STRING2.y=13

Curiously, my latest project is hosted on Verio also, and my opinion of
them is currently low, very low.

  Jeff

 
 If so, can anyone tell where the modules that were available there,
have
 moved to? I'm mainly interested in DBD::mysql.
 
 --
 Bart.



RE: What's with xmlproj.com?

2003-01-15 Thread Sterin, Ilya (I.)
Ah, great.  I thought he'd be gone to Boston before that.  Nice to know it'll be 
fixed.  I take it he's going to the LinuxWorld in NYC.

Ilya

-Original Message-
From: Bart Lateur [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 2:58 PM
To: [EMAIL PROTECTED]
Subject: Re: What's with xmlproj.com?


On Wed, 15 Jan 2003 11:08:24 -0700, Sterin, Ilya wrote:

Matt Sergeant is hosting xmlproj.com on his AxKit server.  That server is
down as well, maybe he's upgrading or something, I'll ping him in a bit.

Ah, OK, now I see. See Matts' journal on http://use.perl.org. From
what I gather, his own server is normally connected to the internet via
DSL, and his DSL modem (router?) is broken.

http://use.perl.org/~Matts/journal

-- 
Bart.



RE: (OT) List files - Thanks and new one :-)

2003-01-10 Thread Sterin, Ilya (I.)
Besides the fact that the first questions was totally unrelated to DBI, you've now 
asked a second question.

Guys, by answering off-topic questions, we do nothing but encourage such behaviours.  
One of the reasons people ask such questions here, is because this is one of the best 
lists on the net, due to the fact that it's about 99% on topic and people are 
knowledgable and respond quick.  Please let's keep it this way.

Thanks.

Ilya Sterin

-Original Message-
From: Don Mathews [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 09, 2003 7:11 PM
To: [EMAIL PROTECTED]
Subject: RE: List files - Thanks and new one :-)


Thanks to all who replied. Now for a slightly tougher one . 

I have a subroutine say FOO in my program. Before my program executes I want to know 
how may times FOO is called in my program which is going to execute. Kind of parser ? 
Any design ideas? samples ? will be appreciated !

Don


_
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plusref=lmtplus



RE: Small Footprint Database

2002-12-24 Thread Sterin, Ilya
This is the wrong list to ask this question.  This list is for topics
related to DBI (Perl's database interface) API issues.

Thanks for the understanding.

Ilya

-Original Message-
From: Bob X [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 24, 2002 2:24 PM
To: [EMAIL PROTECTED]
Subject: Small Footprint Database


What are the options for a good small footprint database...on Windows (XP).

Bob



RE: Testing - the DBI lists have gone very quiet!

2002-12-22 Thread Sterin, Ilya
Yes, I think so.  Guess it's just me and you:-)  We can use the list as
private chat for now, until everyone returns:-)

Ilya

-Original Message-
From: Jonathan Leffler [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 12:31 AM
To: DBI Users Mailing List; DBI Developers Mailing List
Subject: Testing - the DBI lists have gone very quiet!


I got one email from the DBI lists overnight, instead of thirty or so.
Did everyone go away for Christmas?

--
Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED])
#include disclaimer.h
Guardian of DBD::Informix 1.04.PC1 -- http://dbi.perl.org/



RE: Nested prepares

2002-12-18 Thread Sterin, Ilya (I.)
Yes, that is what prepares are for.

Ilya

-Original Message-
From: John Day [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: Nested prepares


I would like to rewrite an application using DBI, DBD and mySQL so that I can prepare 
a several statements once using placeholders and then execute them within a loop 
without re-preparing them.

Basically for each of about 2,000 clients I have to read up to 750,000 records, modify 
each one and write it back. I would like to improve efficiency by not having to 
prepare the statement each time (as the version I am rewriting does).

Will this work?

I am using latest DBI, DBD, mySQL on Linux with Perl 5.6

John Day
Words  Images





RE: SQL query problem

2002-12-18 Thread Sterin, Ilya (I.)
Send us the relavant part of the code as well as the error messages you are
getting.  Before you do that, you might want to try tracing your problem
with trace(2, log.txt)

Ilya

-Original Message-
From: Khaliq, Abdul (A.) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 11:19 AM
To: '[EMAIL PROTECTED]'
Subject: SQL query problem


I am migrating the application from old environment (PERL 5.004, CGI 2.36,
DBI 0.91) to new environment (PERL 5.6.0, CGI 2.68, DBI 1.14). One of the
SQL queries in PERL  program not executing.  It is a query in which I am
selecting about 40 fields from a single database table and SUM functions is
used on most of the fiedls. There is no error in query itself because It is
running fine in SQL PLUS. If I take out some of the fields (reduce the no.
of fields in the select statement) then the query executes but It does not
execute if I include all the required fields in select statement. The
execute statement $csr-execute(); does not return.

Thanks,
[EMAIL PROTECTED]




RE: :JDBC and Oracle CLOB

2002-12-18 Thread Sterin, Ilya (I.)
Why are you using DBD::JDBC?  What's the advantage over using a native DBD driver?

Ilya

-Original Message-
From: Alan Thompson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 10:29 AM
To: [EMAIL PROTECTED]
Subject: DBD::JDBC and Oracle CLOB


I am using DBD::JDBC (0.64) with DBI 1.27 to connect to various databases. I have come 
across a problem reading Oracle CLOBs.
 
Eventually, I noted that the DBD::JDBC readme says this isn't supported, and I also 
found a discussion about 2 years ago on this list indicating the same. 
 
Has anyone solved this problem, or is there an update to DBD::JDBC available that I 
haven't seen.
 
Any solution ideas would be appreciated.
 
Alan Thompson
 



RE: DBI question

2002-12-18 Thread Sterin, Ilya
Well, just using CGI, it's pretty complex.  You'll have to somehow cache it
in a running daemon and somehow share that env.  Now if you are using
mod_perl is pretty much doable and recommended, since the database
connections attribute to about 80% of the slowdown of web applications, so
caching the handles, will give you about an 80% speed gain, on average.

I haven't done so in Perl, though I'm 99.% sure it's doable and not
hard, since mod_perl keeps a persistant environment as other server build in
solutions, like Servlets, JSP, ASP, etc...

With Servlets and JSP, you'd use connection pooling, where a controller
would say, cache about 5+ connections, and each thread would ask for an
available connection, it will then recycle it back to the controller once
done.

I've seen some replies to this post saying, maybe and no, but the answer is
definitely a big yes.  The connection pooling is the major purpose of having
a persistant environment like mod_perl.  Actually, though I'm a big Perl
supporter, for serious web apps, I would never really recommend CGI any
more, as solutions like mod_perl, JSP, Servlets, ASP have such great
benefits in every area, that it's almost not serious not to utilize them.

Go mod_perl, get Geoff's and Randy's book, Mod_perl cookbook, and do
persistant connection pooling.

Ilya

-Original Message-
From: G S [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 10:43 AM
To: [EMAIL PROTECTED]
Subject: DBI question


Is it possible for a perl script to use a database connection that was
previously opened in another perl script, or must each perl script open it's
own database connection?





_
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



RE: Perl DBI Installation

2002-12-12 Thread Sterin, Ilya (I.)
Well, I'm not sure what Tried my best to install it means.  Did you get errors?  Did 
it install fine?  Did you follow install instructions?  Did you install it in the 
standard directory?  Do you have more than one perl interpreter on your system?

We need more info:-)

Ilya

-Original Message-
From: Sath Maripitchai [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 1:39 PM
To: '[EMAIL PROTECTED]'
Subject: Perl DBI Installation


Hello there,

I installed Perl on my new server a few days ago.  As far as Perl,
everything is working except I couldn't get DBI.pm working correctly.  I
downloaded the DBI.pm from
http://search.cpan.org/author/TIMB/DBI-1.32/DBI.pm site and tried my best to
install it.  

The following error shows up every time I run my script.

Can't locate loadable object for module DBI in @INC (@INC contains:
/usr/local/perl/lib/5.6.1 /usr/local/perl/lib
/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi /opt/perl/lib/5.6.1
/opt/perl/lib/site_perl/5.6.1/PA-RISC1.1-thread-multi
/opt/perl/lib/site_perl/5.6.1 /opt/perl/lib/site_perl .) at
/usr/local/perl/lib/5.6.1/DBI.pm line 250
BEGIN failed--compilation aborted at /usr/local/perl/lib/5.6.1/DBI.pm line
250.

I understand that a loadable object is required, but I am not sure what that
file is.  I urgently need to get this loaded for my development work.

Could someone help me on this ?

Thank you,

Sath Maripitchai
1-425-254 4194



RE: Having Problems with DBD::CSV (Ilya - FAQ?)

2002-12-12 Thread Sterin, Ilya (I.)
Anyone can add to the FAQ, they just need to register and create a password first, 
which can be done from the FAQ screen.

Ilya

-Original Message-
From: Jeff Zucker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 1:39 PM
To: David Steinbrunner; dbi-users
Subject: Re: Having Problems with DBD::CSV (Ilya - FAQ?)


Hi David,

SQL string values must occur between single quotes, not double quotes:

 SELECT * FROM foo WHERE bar = 'baz'   CORRECT
 SELECT * FROM foo WHERE bar = baz   WRONG

Values that have single quotes inside them must not appear in the SQL as 
  raw single, quotes, they must be escaped.  In DBD::CSV they can be 
escaped with either a backslash or by using two single quotes (not a 
double quote):

 SELECT * FROM foo WHERE bar = 'Tim O\'Reilly'  CORRECT
 SELECT * FROM foo WHERE bar = 'Tim O''Reilly'  CORRECT
 SELECT * FROM foo WHERE bar = 'Tim O'Reilly'   WRONG

Although you can manually escape the quotes, it is much better to use 
the methods provided by DBI to handle this situation (in all DBDs, not 
just DBD::CSV) - the $dbh-quote() method and placeholders.  See the DBI 
docs for the quote() method and placeholders.

The placeholders method is best since it also offers other protections. 
  Here's a sample:

 my $sth = $dbh-prepare(
   SELECT * FROM foo WHERE bar = ?
 );
 $sth-execute(Tim O'Reilly);

Notice the O'Reilly is not escaped, the placeholder method does that for 
you.  Also notice that there are no quotes around the question mark in 
the SQL.  If you always use placeholders or the quote() method, you 
won't have to manually escape anything and you won't have to know or 
care whether values have embedded quotes.

Placeholders can also be passed as part of a do() call, so here's a 
small script that illustrates four different ways to correctly use 
embedded single quotes:

#!/usr/local/bin/perl -w
use strict;
use DBI;
my $table = 'foo';
my $dbh = DBI-connect('dbi:CSV(RaiseError=1):')
   or die $DBI::errstr;
my $val  = q~Tim O'Reilly~;
my $escaped_val1 = q~Tim O\'Reilly~;
my $escaped_val2 = q~Tim O''Reilly~;
my $quoted_val   = $dbh-quote($val);
$dbh-do(DROP TABLE IF EXISTS $table);
$dbh-do(CREATE TABLE $table ( id INTEGER, txt CHAR(4) ));
$dbh-do(INSERT INTO $table VALUES (1,?),{},$val);
$dbh-do(INSERT INTO $table VALUES (2,'$escaped_val1'));
$dbh-do(INSERT INTO $table VALUES (3,'$escaped_val2'));
$dbh-do(INSERT INTO $table VALUES (4,$quoted_val));
my $sth=$dbh-prepare(SELECT * FROM $table);
$sth-execute;
while (my $r=$sth-fetch) {
 print @$r\n;
}

Except for the method of escaping quotes (which can vary between SQL 
implementations) all of this applies to any DBD, not just DBD::CSV.

-- 
Jeff




David Steinbrunner wrote:

 Hello,
 
 I'm having two problems with DBD::CSV.  I am working with two comma
 delimited files and to start out on the small project I need to match
 names from one file to a name in the other file.  Here is the block of
 code that I am using to get an idea of how many matches I have and what
 is not matching:
 
   my $dir = /path/to/files/;
   my $dbh = DBI-connect(DBI:CSV:f_dir=$dir;csv_eol=\n;csv_sep_char=,;)
   or die Cannot connect:  . $DBI::errstr;
 
   my $sql = Select fname, lname from customer_info;
   my $sth = $dbh-prepare($sql)
 or die Cannot prepare $sql:  . $DBI::errstr;
   my $rc = $sth-execute
 or die Cannot execute SQL Statement:  . $DBI::errstr;
 
   my ($yes,$no);
 
   while (my ($fname,$lname) = $sth-fetchrow)
   {
 my $name = $fname $lname;
 my $sql2 = Select email from order_info where name = '$name';
   print $sql2\n;
 my $sth2 = $dbh-prepare($sql2)
 or die Cannot prepare $sql2:  . $DBI::errstr;
 my $rc2 = $sth2-execute
 or die Cannot execute SQL Statement:  . $DBI::errstr;
 
 my $rows = $sth2-rows;
 
 if ($rows  0) {
   $yes++;
   print 1\n;
 } else {
   $no++;
   print $name\n;
 }
   }
   print \nyes: $yes\no: $no\n;
   $sth-finish if $sth;
   $dbh-disconnect if $dbh;
 
 On the first run I found I have one Irish man to contend with.  The
 error follows but the name has been changed to protect the innocent:
 
 
 Select email from order_info where name = 'Tim O'Reilly'
 DBD::CSV::db prepare failed: Mismatched single quote before: 'Reilly'
 Cannot prepare Select email from order_info where name = 'Tim O'Reilly':
 Mismatched single quote before: 'Reilly'
 
 
 So I changed the single quotes to escaped double quotes (\) as it
 likely should have been in the first place but found my self with a new
 error:
 
 
 Select email from order_info where name = George W. Bush
 SQL ERROR: Table 'George W' in WHERE clause not in FROM clause!
 
 SQL ERROR: Couldn't find predicate!
 
 SV = PVIV(0x83b86c0) at 0x82cbd48
   REFCNT = 1
   FLAGS = (PADBUSY,PADMY,ROK)
   IV = 0
   RV = 0x81eefd8
 DBD::CSV::st execute failed: dbih_getcom handle
 DBD::CSV::Statement=HASH(0x81eefd8) is not a DBI 

RE: (Fwd) Question about Oracle DBD:DBI

2002-12-06 Thread Sterin, Ilya (I.)
I'd also recommend getting Perl 5.6.1 or above, with 5.8.* available now.

Ilya

-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 06, 2002 12:37 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: (Fwd) Question about Oracle DBD:DBI


- Forwarded message from Pauley, Alan [EMAIL PROTECTED] -

Delivered-To: [EMAIL PROTECTED]
From: Pauley, Alan [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Question about Oracle DBD:DBI
Date: Thu, 5 Dec 2002 16:24:02 -0700 


I'm a little confused can you help me understand this. I'm installing a
application called RptView on my
Solaris system. One of the requirements is to have Perl 5.002 which I have
or above with Oracle DBD:DBI libraries.
I went to www.perl.org and downloaded DBD-Oracle-1.12. Is this what I need
or am I missing something?

Thanks for you help
Alan Pauley




*

This e-mail and any files transmitted with it are the property of Americas
Mining Corporation and/or its affiliates, are confidential, and are intended
solely for the use of 
the individual or entity to whom this e-mail is addressed. If you are not a
named recipient or otherwise have reason to believe that you have received
this message in error, 
please notify the sender and delete this message immediately from your
computer. Any other use, retention, dissemination forwarding, printing or
copying of this e-mail is 
strictly prohibited.  Although this email and any attachments are believed
to be free of any virus or other defect that might affect any computer
system into which it is 
received, and opened, it is the responsibility of the recipient to ensure
that it is virus free and no responsibility is accepted by Americas Mining
Corporation and/or its 
affiliates for any loss or damage arising in any way from its use

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com

*

- End forwarded message -



RE: perl.exe crashes with 2 connects

2002-12-04 Thread Sterin, Ilya (I.)
Use trace...

DBI-trace(2, trace.log);

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 8:01 AM
To: [EMAIL PROTECTED]
Subject: perl.exe crashes with 2 connects


Hi,

I have a problem with the following code:


use DBI;
my $msdbh = DBI-connect(dbi:ODBC:EasyArchiv, user, pass, { RaiseError
= 1, PrintError = 1, AutoCommit = 1 } ) or die $DBI::errstr;
$mssth = $msdbh-prepare(USE REFDB) ;
$mssth-execute;
print $DBI::errstr\n;

my $db2dbh = DBI-connect(dbi:ODBC:DB2J21, user, pass, { RaiseError =
1, PrintError = 1, AutoCommit = 1} ) or die $DBI::errstr;
print $DBI::errstr\n;
$msdbh-disconnect;
$db2dbh-disconnect;
-

As soon as I run this, perl.exe crashes. When I remove either the MSSQL
(EasyArchiv) or the DB2 part, it works. Am I not allowed to have to connects
running?

Lars




RE: perl.exe crashes with 2 connects

2002-12-04 Thread Sterin, Ilya (I.)
No, you don't, that's something else, send us the trace output.

Ilya

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 10:12 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: perl.exe crashes with 2 connects


 Use trace...
 DBI-trace(2, trace.log);

Tried already, though I couldn't read much from the information I got there.
But I found out something else, when I do some SELECT statement with the
second handle also, the error disappears. Seems you have to *use* the DBI
handle ;)

Lars



RE: perl.exe crashes with 2 connects

2002-12-04 Thread Sterin, Ilya (I.)
Ok, code wise, nothing is failing.  Your first problem is there is no need to do (or 
die $DBI::errstr) since you set RaiseError on.  Also, you should disable PrintError, 
you don't need it printed twice.  PrintError is like warning, if both RaiseError and 
PrintError are turned on, then you get the messages twice.

also, the print $DBI::errstr is useless.

Ilya

-Original Message-
From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 10:06 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: perl.exe crashes with 2 connects


Use trace...

DBI-trace(2, trace.log);

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 8:01 AM
To: [EMAIL PROTECTED]
Subject: perl.exe crashes with 2 connects


Hi,

I have a problem with the following code:


use DBI;
my $msdbh = DBI-connect(dbi:ODBC:EasyArchiv, user, pass, { RaiseError
= 1, PrintError = 1, AutoCommit = 1 } ) or die $DBI::errstr;
$mssth = $msdbh-prepare(USE REFDB) ;
$mssth-execute;
print $DBI::errstr\n;

my $db2dbh = DBI-connect(dbi:ODBC:DB2J21, user, pass, { RaiseError =
1, PrintError = 1, AutoCommit = 1} ) or die $DBI::errstr;
print $DBI::errstr\n;
$msdbh-disconnect;
$db2dbh-disconnect;
-

As soon as I run this, perl.exe crashes. When I remove either the MSSQL
(EasyArchiv) or the DB2 part, it works. Am I not allowed to have to connects
running?

Lars



RE: Connecting to MS Access

2002-12-01 Thread Sterin, Ilya
Tom, no longer it is there:-)  That was my home server, and I no longer
maintain it, it's now on a better server at www.xmlproj.com/cgi/fom.cgi


DBI FAQ (www.xmlproj.com/cgi/fom.cgi)

Ilya

-Original Message-
From: Thomas A. Lowery
To: DBI List
Sent: 12/1/02 5:19 PM
Subject: Re: Connecting to MS Access

See FAQ:
See DBI/FAQ http://xmlproj.dyndns.org/cgi-bin/fom

On Sun, Dec 01, 2002 at 12:01:50PM -0600, Mike(mickako)Blezien wrote:
 I'm sure this must have been discussed many time in the past, but I
just 
 need to get some refresher information or directions. I believe data
can be 

-- 
Thomas A. Lowery
See DBI/FAQ http://xmlproj.dyndns.org/cgi-bin/fom



RE: How to insert a question mark?

2002-12-01 Thread Sterin, Ilya
That's definitely a bug.  For now, try to escape it with \?, or if that
doesn't work, then try using a placeholder ? and then bind 'val?' to it.

Ilya

-Original Message-
From: Anton Pitts
To: [EMAIL PROTECTED]
Sent: 12/1/02 11:16 PM
Subject: How to insert a question mark?

I'm running postgresql 7.3, perl 5.6.0, DBI 1.30 on mac os x 10.2 and 
am having trouble with inserting values ending in a question mark.

I first tried interpolating the value into a query string:
   $dbh-do(INSERT INTO ref (citekey, title) VALUES ('why?', 'bob'));
This doesn't raise an error, but the values get inserted into the
database as
citekey | title
   -+---
whyNULL | bob

Using $dbh-quote did not resolve the problem.  My best guess was 
that the ? is interpreted as a placeholder which isn't being bound to 
anything, and I could not figure out how to escape it from the DBI, 
so I tried using placeholders as:

   my $sth = $dbh- prepare('INSERT INTO ref (citekey, title) VALUES
(?,?)');
   $sth-execute('bob', 'what?');
   $sth-execute('why?', 'john');

The first execute works fine; the second fails with

   DBD::PgPP::st execute failed: ERROR:  parser: parse error at or 
near john at character 47

What might I be missing here?

Thanks,

Anton.



RE: DBI drivers for Oracle on Windows NT - PLEASE HELP!!

2002-11-26 Thread Sterin, Ilya (I.)
You need to have a Visuall C++ compiler in order to compile the modules, which comes 
with nmake.

You can use a PPM instead.  Read the docs.

Ilya

-Original Message-
From: Sree Bammidipati [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 25, 2002 6:46 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: DBI drivers for Oracle on Windows NT - PLEASE HELP!!


Dear Perl friends,

I have installed Perl 5.6 and it is working like a champ, as expected. 
I am encountering a problem in installing the perl DBI modules.  I have
downloaded DBI-1.30.tar.gz.  I have followed the instructions in the
README file.  However, very less or infact nothing is mentioned about
installing on WINDOWS platform.

Per Readme document, I tried to do the following
perl Makefile.PL
make   #  this fails because I do not have
make in windows
make test # this failed
make install  # this failed

I have downloaded dmake utility from the internet and this did not
work.

Can someone please give me direction???
Thanks a bunch in advance.
-Sree




RE: Installing DBI

2002-11-22 Thread Sterin, Ilya (I.)
Wow, a big no no.  You can't do that with a module that's has XS (C) code.  The DBI.pm 
interfaces with the XS code, therefore, just copying DBI.pm does nothing with the C 
object files, nor the XS interface.  It might still work as it does in your case, but 
you are not taking advantage of any changes, plus unexpected stuff can happen later.

You only choice is to get some sort of a shell access to the machine and install it 
locally, using...


perl Makefile.PL PREFIX=/path/to/local

Ilya

-Original Message-
From: Chris Faust [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 22, 2002 5:22 PM
To: DBI
Subject: Installing DBI


Please forgive what I'm sure is a really stupid question - but the fact is
I've never been in a situation where I didn't have root access to install my
modules.

I need to get DBI on a web server where I have no SSH/Telnet access, if I
take DBI.pm off my local machine and put it on the web server and then use
the old use lib /path to DBI.pm/; it seems to work.

My question is, is there anything bad about doing this? Does it make a
difference if the make process is done on the machine that is doing the
hosting?

Could I be looking at unforeseen problems down the line?

P.S. In case it matters I'm using mySql

Thanks
-Chris




RE: Installing DBI

2002-11-22 Thread Sterin, Ilya
Yes, and no.  If there is no C code involved in most cases, you can move the
..pm file around, be warned though, some modules are abstracted into a
variety of modules and might depend on other .pm files in the package.  So
if you move all of them to the place and non of them rely on XS, then you
should be ok 99% of the time.

Ilya 

-Original Message-
From: Chris Faust
To: Sterin, Ilya (I.); DBI
Sent: 11/22/02 8:46 PM
Subject: RE: Installing DBI

Thanks Ilya, not really the answer I was hoping for but exactly the
answer I
needed.

Off Topic but --
Is it safe to assume if the module has no need of a C compiler then it
would
be safe to simply pass around the pm file and count on it working? Or
is
there no promises there either?

Thanks Again
-Chris

 -Original Message-
 From: Sterin, Ilya (I.) [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 22, 2002 5:39 PM
 To: 'Chris Faust'; DBI
 Subject: RE: Installing DBI


 Wow, a big no no.  You can't do that with a module that's has XS
 (C) code.  The DBI.pm interfaces with the XS code, therefore,
 just copying DBI.pm does nothing with the C object files, nor
 the XS interface.  It might still work as it does in your case,
 but you are not taking advantage of any changes, plus unexpected
 stuff can happen later.

 You only choice is to get some sort of a shell access to the
 machine and install it locally, using...


 perl Makefile.PL PREFIX=/path/to/local

 Ilya

 -Original Message-
 From: Chris Faust [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 22, 2002 5:22 PM
 To: DBI
 Subject: Installing DBI


 Please forgive what I'm sure is a really stupid question - but
 the fact is
 I've never been in a situation where I didn't have root access
 to install my
 modules.

 I need to get DBI on a web server where I have no SSH/Telnet access,
if I
 take DBI.pm off my local machine and put it on the web server
 and then use
 the old use lib /path to DBI.pm/; it seems to work.

 My question is, is there anything bad about doing this? Does it make
a
 difference if the make process is done on the machine that is doing
the
 hosting?

 Could I be looking at unforeseen problems down the line?

 P.S. In case it matters I'm using mySql

 Thanks
 -Chris




RE: ODBC? From Linux to SQL Server

2002-11-22 Thread Sterin, Ilya (I.)
Read the valuable FAQ:-)

www.xmlproj.com/cgi/fom.cgi

Ilya

-Original Message-
From: Roderick A. Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 22, 2002 1:30 PM
To: [EMAIL PROTECTED]
Subject: ODBC? From Linux to SQL Server


I'm just starting to build a script to load some data into SQL Server
running on one system using perl and DBI from another system (Linux).  My
first attempt to install DBD-ODBC on the Linux system and searches on the
web lead me to think this will be a major pain.  The install on the Linux
box gives me an error about having a DSN first and having a Driver Manager
on the Linux box.  Those that have installed this probably know what I'm
talking about.
   I use/deal SQL Server only when I can't avoid it so does anyone have
instructions suitable for the 'very' slow?  Or is there away around this
apparent requirement?  It seems to me odd that the DBD-ODBC driver will
only allow one user to connect to one database per machine.

Additional info.  Redhat Linux 7.3, perl 5.6.1, DBI 1.20 (installed from 
tarball) DBD-ODBC 0.43 (trying from a tarball).


TIA,
Rod
-- 
  Open Source Software - Sometimes you get more than you paid for...




RE: LongReadLen use

2002-11-15 Thread Sterin, Ilya
You'll need to post more code.  Although you do have to use LongReadLen in
this situation, this
is not why you are getting errors.

Post more code:-)

Ilya

-Original Message-
From: Michael Ragsdale
To: [EMAIL PROTECTED]
Sent: 11/15/02 2:32 PM
Subject: LongReadLen use

I have a query that is pulling a LONG field from an Oracle DB.  I
received 
the following error:illegal use of LONG datatype .

I found information on LongReadLen in the cheetah book, but I'm still a
bit 
confused as to the syntax or exactly how to implement the attribute.
After 
searching Google, I found the following examples but none of them are
working:

my $dbh = DBI-connect($data_source,foo,bar,{LongReadLen = 4000})

$dbh-LongReadLen(4000);

$dbh-{LongReadLen} = 4000;

The first two don't change the error message at all.  The third gives me

the following message:Can't locate object method LongReadLen via 
package DBI:db (perhaps you forgot to load DBI::db?)

Just in case it's needed
Oracle 8.1.7
Perl 5.6.1
DBI 1.28
DBD::Oracle 1.6

Any suggestions?

-Mike



RE: Newbie qurstion

2002-11-13 Thread Sterin, Ilya (I.)
Yes, but they have to be on the same LAN.  No other way though, that's really what I 
was thinking.  Access does not have a server which listens on any ports, therefore, it 
must be a shared network drive in order to access the .mdb file, and therefore is 
still not considered full remote access.

Ilya

-Original Message-
From: [EMAIL PROTECTED] [mailto:pvandeursen;epo.org]
Sent: Wednesday, November 13, 2002 9:47 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; 'Nicholas Marsh'
Subject: RE: Newbie qurstion



Yes, you can.
If the remote PC is using a computer name and your local PC is in the same
workgroup with proper access rights to the remote PC.

you can connect with something like this:

use DBI;
use DBD::ODBC qw(:sql_types) ;

my $DBName = 'computer or hostname\\d$\\microsoft
office\\office\\samples\\northwind.mdb' ;

my $DSN = driver=Microsoft Access Driver (*.mdb);dbq=$DBName ;
my $dbh = DBI-connect( dbi:ODBC:$DSN, , ,
   {RaiseError = 1, PrintError = 1, AutoCommit = 0} ) ||
   die Unable to connect:  . $DBI::errstr . \n ;

Regards,
Paul.




   
   
Sterin, Ilya  
   
(I.)To: 'Nicholas Marsh' [EMAIL PROTECTED], 
[EMAIL PROTECTED] 
isterin@ford.   cc: (bcc: Paul Van Deursen/EPO)   
   
com Subject: RE: Newbie qurstion  
   
   
   
13-11-2002 
   
14:52  
   
   
   
   
   




No, you can't.  Access is not a complex server database system.  You can
only access it locally.  The only way you can facilitate a remote access to
it, is using DBD::Proxy.

Ilya

-Original Message-
From: Nicholas Marsh [mailto:nmarsh1;mac.com]
Sent: Tuesday, November 12, 2002 9:04 PM
To: [EMAIL PROTECTED]
Subject: Newbie qurstion


Can I connect to a remote MS Access database with dbi? If so what's the
port number?

dbi:ODBC:dbName:hostname=host:port='

Thanks!


nick marsh
[EMAIL PROTECTED]






RE: Problem inserting into a CLOB

2002-11-13 Thread Sterin, Ilya (I.)
Yup, you are right, you have to bind.  No need for SQL TYPE though, just...

$sth-execute($foo, $bar);

and you are done.

For retrieving *LOB fields, you'll need to set LongReadLen and LongTruncOk

Ilya Sterin

P.S.  All this info is in the FAQ www.xmlproj.com/cgi/fom.cgi



-Original Message-
From: Wysocki, James (J.D.) [mailto:jwysock3;ford.com]
Sent: Wednesday, November 13, 2002 10:15 AM
To: '[EMAIL PROTECTED]'
Subject: Problem inserting into a CLOB


Hi,

I'm having a problem inserting a row into my database with a CLOB column.  My database 
version is Oracle 8.1.7.  I can get it to work as long as my CLOB contains  4948 
bytes.  However, if it is = 4948, I get an Oracle error ORA-03113 end-of-file on 
communication channel.

I'm using the following statement to bind my variable to my insert statement:
 $sth-bind_param(2, $file_text);

I have the feeling that I should be doing something like $sth-bind_param(2, 
$file_text, {TYPE=SQL_ ); but I can't find the correct TYPE.

The DBI module I'm using (version 0.90 I think) only has the following sql_types 
defined:

SQL_CHAR=1
SQL_NUMERIC=2
SQL_DECIMAL=3
SQL_INTEGER=4
SQL_SMALLINT=5
SQL_FLOAT=6
SQL_REAL=7
SQL_DOUBLE=8
SQL_VARCHAR=12

I'm fairly new to Perl...is this a simple case of having an outdated version of the 
DBI module?


Regards,

Jim Wysocki
[EMAIL PROTECTED]





RE: Newbie qurstion

2002-11-13 Thread Sterin, Ilya
Well, I doubt it.  You'll have to use DBD::Proxy as I mentioned before.  If
both are on same network, you can possibly immitate Windows shares with
Samba, but too much messing around might be required and you'll need a Unix
ODBC client as well.

Just use DBD::Proxy:-)

Ilya

-Original Message-
From: Nicholas Marsh
To: [EMAIL PROTECTED]
Sent: 11/13/02 9:24 AM
Subject: RE: Newbie qurstion

So you are saying that will work in a Windows to Windows enviorment?

This is a Linux box talking to a Windows box. I have Samba running. Will
this still work?

Thanks!


On Wednesday, Nov 13, 2002, at 08:46AM, [EMAIL PROTECTED] wrote:


Yes, you can.
If the remote PC is using a computer name and your local PC is in the
same
workgroup with proper access rights to the remote PC.

you can connect with something like this:

use DBI;
use DBD::ODBC qw(:sql_types) ;

my $DBName = 'computer or hostname\\d$\\microsoft
office\\office\\samples\\northwind.mdb' ;

my $DSN = driver=Microsoft Access Driver (*.mdb);dbq=$DBName ;
my $dbh = DBI-connect( dbi:ODBC:$DSN, , ,
   {RaiseError = 1, PrintError = 1, AutoCommit = 0} ) ||
   die Unable to connect:  . $DBI::errstr . \n ;

Regards,
Paul.






Sterin, Ilya

(I.)To: 'Nicholas Marsh'
[EMAIL PROTECTED], [EMAIL PROTECTED]

isterin@ford.   cc: (bcc: Paul Van
Deursen/EPO)

com Subject: RE: Newbie
qurstion



13-11-2002

14:52









No, you can't.  Access is not a complex server database system.  You
can
only access it locally.  The only way you can facilitate a remote
access to
it, is using DBD::Proxy.

Ilya

-Original Message-
From: Nicholas Marsh [mailto:nmarsh1;mac.com]
Sent: Tuesday, November 12, 2002 9:04 PM
To: [EMAIL PROTECTED]
Subject: Newbie qurstion


Can I connect to a remote MS Access database with dbi? If so what's the
port number?

dbi:ODBC:dbName:hostname=host:port='

Thanks!


nick marsh
[EMAIL PROTECTED]






 


nick marsh
[EMAIL PROTECTED]



RE: Unable to compile DBI using mingw

2002-11-11 Thread Sterin, Ilya (I.)
What compiler is your perl compiled with?  All modules must be compiled using the same 
compiler.

Ilya

-Original Message-
From: [EMAIL PROTECTED] [mailto:raphi.net;voila.fr]
Sent: Monday, November 11, 2002 2:40 AM
To: dbi-users
Subject: Unable to compile DBI using mingw


Hi,

I am trying to compile DBI using mingW, and I was wondering if anyone has been able to 
do so. The package does not compile 
out of the box. Is there any documentation on using perl and mingw32 available 
anywhere?

Thanks

Raphael
--

Faites un voeu et puis Voila ! www.voila.fr 



RE: Perl SV* Question

2002-11-08 Thread Sterin, Ilya (I.)
Wow, regardless of whether or not you found the answer, this is a totally off-topic 
question which wouldn't of been answered here anyways.  Please refer to appropriate 
groups next time.

Ilya

-Original Message-
From: Pothen, Abi [mailto:APothen;nb.com]
Sent: Friday, November 08, 2002 1:52 PM
To: '[EMAIL PROTECTED]'
Subject: Perl SV* Question




Hi,

Can somebody please advise me how to extract the string value from an SV *
variable ?

I will really appreciate your help!

I am trying to use the SvPV macro. String returned by the SvPV is getting
trimmed off when a small portion of SV* variable contains some non-ascii
characters ( Cobol COMP-3  ).  The length of the string returned by this
macro is correct full length.  


Thanks,
Abi.


Sample Code:
==


SvToString ( SV *sv_data, char *datstr ) {

   STRLEN len ;
   if ( SvPOK(sv_data) ) {
 datstr = (char *) SvPV(sv_data, len) ;
}

   printf(%s\n, datstr ) ;

}

datstr values is getting chopped off from where the COMP-3 non-ascii starts 
expected value of datstr is, --ASCIINON-ASCIIASCII-- 
  but I am getting --ASCII--


This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. 
E-mail transmission cannot be guaranteed to be secure or error-free. The
sender therefore does not accept liability for any errors or omissions in
the contents of this message that arise as a result of e-mail transmission.
This message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments. 
 All e-mails at Neuberger Berman are, in accordance with Firm policy, to be
used for Neuberger Berman business purposes only. E-mails sent from or to
the Firm are subject to being reviewed by the Firm in accordance with the
Firm's procedure for the review of correspondence



RE: DBD::ODBC SQL Server problem

2002-10-31 Thread Sterin, Ilya (I.)
Definitely:-)

-Original Message-
From: Tim Bunce [mailto:Tim.Bunce;pobox.com]
Sent: Thursday, October 31, 2002 4:26 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: DBD::ODBC SQL Server problem


One for the FAQ I think - if it's not there already.

Tim.

On Thu, Oct 31, 2002 at 08:52:43AM -, [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 You have two active statement handles and SQL Server does not support multiple
 active statements with the standard cursor. i.e. you are attempting to
 issue a query under a connection whilst you still have another active query
 (under the same connection) you have not finished retrieving yet. The easiest
 way around this in DBD::ODBC is to open multiple connections.
 
 Martin
 - -- 
 Martin J. Evans
 Easysoft Ltd, UK
 Development
 
 On 30-Oct-2002 [EMAIL PROTECTED] wrote:
  Anyone can point me in the right direction regarding the below error. 
  Using the latest DBI and DBD::ODBC, when one connection is open and two
  different statement handles are prepared and executed, the second
  statement handle throws this exception...
  
  Connection is busy with results for another hstmt (SQL-S1000)(DBD:
  st_execute/SQLExecute err=-1)
  
  I can't figure out what it can be.  This script works just fine using
  OLEDB, but not with DBD::ODBC.
  
  Thanks.
  
  Ilya
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.1 (GNU/Linux)
 
 iD8DBQE9wO9ajLvsvprkFrMRApKVAJ9cT86eTl7d5lMrtAqUzMVglVu5kwCeJZzI
 Y/NGZBogI3OxVj0POQiQq10=
 =GiS2
 -END PGP SIGNATURE-



In FAQ DBD::ODBC cursor problem

2002-10-31 Thread Sterin, Ilya (I.)
Added.
http://xmlproj.com/cgi/fom.cgi?amp=auth=ck64f56f786ffcfile=126

It's a pretty simple explanation, so anyone willing to append things, please do so:-)

Ilya

-Original Message-
From: Tim Bunce [mailto:Tim.Bunce;pobox.com]
Sent: Thursday, October 31, 2002 4:26 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: DBD::ODBC SQL Server problem


One for the FAQ I think - if it's not there already.

Tim.

On Thu, Oct 31, 2002 at 08:52:43AM -, [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 You have two active statement handles and SQL Server does not support multiple
 active statements with the standard cursor. i.e. you are attempting to
 issue a query under a connection whilst you still have another active query
 (under the same connection) you have not finished retrieving yet. The easiest
 way around this in DBD::ODBC is to open multiple connections.
 
 Martin
 - -- 
 Martin J. Evans
 Easysoft Ltd, UK
 Development
 
 On 30-Oct-2002 [EMAIL PROTECTED] wrote:
  Anyone can point me in the right direction regarding the below error. 
  Using the latest DBI and DBD::ODBC, when one connection is open and two
  different statement handles are prepared and executed, the second
  statement handle throws this exception...
  
  Connection is busy with results for another hstmt (SQL-S1000)(DBD:
  st_execute/SQLExecute err=-1)
  
  I can't figure out what it can be.  This script works just fine using
  OLEDB, but not with DBD::ODBC.
  
  Thanks.
  
  Ilya
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.1 (GNU/Linux)
 
 iD8DBQE9wO9ajLvsvprkFrMRApKVAJ9cT86eTl7d5lMrtAqUzMVglVu5kwCeJZzI
 Y/NGZBogI3OxVj0POQiQq10=
 =GiS2
 -END PGP SIGNATURE-



DBD::ODBC SQL Server problem

2002-10-30 Thread Sterin, Ilya (I.)
Using the latest DBI and DBD::ODBC to connect to SQL Server I'm getting this error...

Connection is busy with results for another hstmt (SQL-S1000)(DBD: 
st_execute/SQLExecute err=-1) 

This happens when I use the same database handle to execute two different statements.  
When I open two different connections, this problem does not exist.  It must be some 
sort of a DBD::ODBC or ODBC config, since using OLEDB, this also is not an issue.

Thanks.

Ilya



RE: Using the database handle

2002-10-30 Thread Sterin, Ilya (I.)

Run trace and see what's happening.

$dbh-trace(2);

Ilya

-Original Message-
From: Mike(mickako)Blezien [mailto:mickalo;bellsouth.net]
Sent: Wednesday, October 30, 2002 4:03 PM
To: DBI List
Subject: Using the database handle


Hello,

I ran into a problem today while re-write some of our Perl scripts, utilizing 
the selectrow_array() and noticed if same database handle is used, it doesn't 
work properly... example

$dbh-connect() no problems connecting to database.

$sql = qq|select foo from table_a where id = 1|;
my($foo) = $dbh-selectrow_array($sql); # no errors

# $foo is returned correctly... no errrors query successful
some more coding..

# executing another query
$sql = qq|select foobar from table_b where id = 2|;
my($foobar) = $dbh-selectrow_array($sql)... no errors
# But the $foobar is not returned even tho it exist and this
# is a legal query... and no errors

is this due to calling it on the same database handle ($dbh)

thanks for any suggestion or help on this,
-- 
MikemickaloBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel:  1(985)902-8484
MSN: [EMAIL PROTECTED]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



RE: problem compiling dbd-oracle 1.12 on win32

2002-10-15 Thread Sterin, Ilya

In your case, you have to first find out what compiler was used to compile
your Perl.

Then you must use the same compile and it's make/nmake equivalent to compile
DBI, DBD::Oracle, and any other perl module.

Ilya

-Original Message-
From: Knut Herzog
To: 'Crown David T. (DNREC)'; dbi-users perl org
Sent: 10/15/02 10:29 AM
Subject: RE: problem compiling dbd-oracle 1.12 on win32

Thanks David,

you're right, ActivePerl and ppm are the easiest installation for perl
on windows. I installed it with ppm on activeperl and had no problems.

But in this case I have to use the perl that is delivered with Oracle
Web server - non active Perl. It comes without the ppm and I didn't
found a downloadable ppm - only bundles with activeperl. I read in the
ppm 2.6 docs, that ppm should only be used with activePerl.

Any other hints ?

Regards

Knut

-Original Message-
From: Crown David T. (DNREC) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 6:18 PM
To: dbi-users perl org
Subject: RE: problem compiling dbd-oracle 1.12 on win32


Its seems to me, but I might be wrong, but the easiest thing to do is
get a modern build of Active State's Perl and use the package manager to
install. 

David Crown, MCSE, MCP+I, CCNA
Information Resources Management
State of Delaware,
Department of Natural Resources and Environmental Control
[EMAIL PROTECTED]
Voice: (302)739-4409 Fax: (302)739-6242 
www.dnrec.state.de.us/


-Original Message-
From: Knut Herzog [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 15, 2002 09:55
To: '[EMAIL PROTECTED]'; dbi-users perl org
Cc: Tim Bunce pobox com
Subject: RE: problem compiling dbd-oracle 1.12 on win32

Thanks, Chuck,

but unfortunately there is no *lib32* library in Windows. I also checked
the includes in the Makefile and they already point to the OracleHome
libs.

Anything else ?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 2:41 PM
To: Knut Herzog
Cc: Tim Bunce pobox com; dbi-users perl org
Subject: RE:problem compiling dbd-oracle 1.1


I had that problem last week with the exception that I am using solaris.
The
sugestion that I was given is to modify the Makefile to point to the
lib32 in
ORACLE_HOME.  I have not tried this yet (its a today project) but it
makes
sense.

chuck
--( Forwarded letter 1 follows )-
Date: Tue, 15 Oct 2002 05:21:18 -0700
To: dbi-users.perl.org[dbi-users]@perl.org.SMTP
Cc: Tim.Bunce.pobox.com[Tim.Bunce]@pobox.com.SMTP
From: Knut.Herzog[knherzog]@portal.com.SMTP
Sender: [EMAIL PROTECTED]
Subject: problem compiling dbd-oracle 1.12 on win32

Dear all,

I tray to install the DBI and DBD modules on Win2000. While I had no
problems creating the dbi module, I could not nmake the dbd module. I am
on Oracle 9.2.0.0.0. I tried all the hints from the various readme files
from '-nob' to 'static'. My oracle
 (home, sid, userid ...) and perl environment is working probably, but I
am still getting a lot of unresolved external symbols.
Please find the log attached, as described in the readme.
What else can I do ?

Regards

Knut

 install.log




**
Mercantile Bankshares Corporation Confidential Electronic Mail:
The information contained in this message is intended only for the 
persons to whom it is addressed and may contain confidential or 
privileged material. Copying, distributing, dissemination, reliance on, 
or other use of the information by persons other than the intended 
recipient(s) is prohibited. If you received this message in error, 
please notify the sender and delete the entire message from any 
computer.
**



RE: FAQ ???- Wrong ELF Class...

2002-10-14 Thread Sterin, Ilya

Is this in the FAQ?  If not, David, can you please add it:-) 

Thanks a bunch.

Ilya

-Original Message-
From: Crown David T. (DNREC)
To: Kwabbi, Seth; [EMAIL PROTECTED]
Sent: 10/14/02 1:15 PM
Subject: RE: Wrong ELF Class when running make for  DBD-Oracle-1.12 module

This is because your attempting to build in a 32 bit Perl against a
64bit oracle install. Here's the solution form Stephen Clouse:

The best solution is to edit the Makefile generated by Makefile.PL and
change all references to ORACLE_HOME/lib to ORACLE_HOME/lib32.  This
will get it to use the 32-bit Oracle libraries instead.

David Crown, MCSE, MCP+I, CCNA
Information Resources Management
State of Delaware,
Department of Natural Resources and Environmental Control
[EMAIL PROTECTED]
Voice: (302)739-4409 Fax: (302)739-6242 
www.dnrec.state.de.us/


-Original Message-
From: Kwabbi, Seth [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 14, 2002 14:23
To: '[EMAIL PROTECTED]'
Subject: Wrong ELF Class when running make for DBD-Oracle-1.12 module

When running make for the DBD-Oracle-1.12 module, I encounter  this
error:

  ld: fatal: file /u01/app/oracle/product/9.0.1/lib//libclntsh.so: wrong
ELF
class: ELFCLASS64

 My environment Solaris 2.8 ( 64 Bit ) and using gcc compiler version
2.95.3
20010315 ( release). Also  know if I set LD_LIBRARY_PATH to point to the
Oracle lib32 libraries it will work, howver I prefer make to use the
64
Bit version.

Does anyone know what causes this problem ?

Cheers.

Seth Kwabbi

ACS - DSS 
Atlanta, Ga 



RE: Private PPM repositories in DBI FAQ

2002-10-13 Thread Sterin, Ilya

Sure, in a few minutes...

Ilya

-Original Message-
From: Thomas A. Lowery
To: 'dbi-users '
Sent: 10/13/02 10:02 AM
Subject: Re: Private PPM repositories in DBI FAQ

Ilya,
Would you make a PPM from the current version DBD-ADO and add it
to the
standard site please?
Tom

On Tue, Oct 08, 2002 at 02:01:59PM -0600, Sterin, Ilya wrote:
 That's fine, we can do that:-)
 



PPM for DBI 1.30 and DBD-ADO 2.5 available

2002-10-13 Thread Sterin, Ilya

ppm set repository http://www.xmlproj.com/PPM
ppm set save
ppm install DBI

and

ppm install DBD-ADO

If you already have these installed, then...


ppm verify --upgrade DBI

and

ppm verify --upgrade DBD-ADO

Ilya



RE: OT - Apache .htaccess auth - available to Perl?

2002-10-08 Thread Sterin, Ilya

No need for a module, just use $ENV{REMOTE_USER} variable, which will give
you the currently logged in user.

Ilya


-Original Message-
From: Hardy Merrill
To: [EMAIL PROTECTED]
Sent: 10/8/02 9:58 AM
Subject: OT - Apache .htaccess auth - available to Perl?

I know this is OT, so please no flames - I'm only asking here
since I'm fairly sure someone will have the answer, and because
asking on Google groups takes hours for an answer.

For an app, I'm using Apache .htaccess authentication under
mod_perl - Apache pops up the basic authentication box asking
for user name and password, which is compared against an entry
in a specified filesystem file on the webserver.  Is there a
way(module?) in Perl, or mod_perl, to know who logged in when
the webserver uses .htaccess authentication?

TIA.

-- 
Hardy Merrill
Senior Software Engineer
Red Hat, Inc.



RE: OT - Apache .htaccess auth - available to Perl?

2002-10-08 Thread Sterin, Ilya (I.)

No need for a module, just use $ENV{REMOTE_USER} variable, which will give you the 
currently logged in user.

Ilya

-Original Message-
From: Hardy Merrill [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 11:59 AM
To: [EMAIL PROTECTED]
Subject: OT - Apache .htaccess auth - available to Perl?


I know this is OT, so please no flames - I'm only asking here
since I'm fairly sure someone will have the answer, and because
asking on Google groups takes hours for an answer.

For an app, I'm using Apache .htaccess authentication under
mod_perl - Apache pops up the basic authentication box asking
for user name and password, which is compared against an entry
in a specified filesystem file on the webserver.  Is there a
way(module?) in Perl, or mod_perl, to know who logged in when
the webserver uses .htaccess authentication?

TIA.

-- 
Hardy Merrill
Senior Software Engineer
Red Hat, Inc.



RE: DBI - build a private copy

2002-10-08 Thread Sterin, Ilya (I.)

Means you can install it into a custom directory...


perl Makefile.PL PREFIX=/your/dir

for those that don't have root priveleges.

Ilya

-Original Message-
From: Burak Gürsoy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 11:18 AM
To: DBI
Subject: DBI - build a private copy


In the readme there is a section like this:

(You can use Configure -Dprefix=... to build a private copy.)

whats this private copy thing? and how can I do it? can someone give me an
example?



RE: Private PPM repositories in DBI FAQ

2002-10-08 Thread Sterin, Ilya

That's fine, we can do that:-)

Also though, remember that PPM is supposed to take care of the dependencies
for you, as far as Perl version, build, etc...

As far as Installation, we can either consolidate all PPM insatlls, or each
PPM builder can write a small script to be run before PPM install to check
prereq's versions...

This script can be to (I can't remember where at this point) to be run when
PPM installs and is included in the PPM packages. 

For more info, look at Randy Kobe's ppm package for XML::Parser, which
copies a needed dll as well and has a script for that.

Ilya

-Original Message-
From: Jeff Urlwin
To: Michael A Chase; dbi-users
Sent: 10/8/02 1:49 PM
Subject: RE: Private PPM repositories in DBI FAQ

Mac,

ftp://ftp.esoftmatic.com/outgoing/DBI

I have a few opinions on this, though:
1) If someone else's DBI and my DBI don't match, we'll have some
problems
with someone trying to take DBI and DBD::ODBC and then DBD::Oracle from
a
different site.  In theory, if we are all running DBI 1.30, it should
not be
a problem.

2) May I suggest that we try to have one location for this (with
a mirror,
is OK, but let's be consistent)?  I don't mind it being hosted by me,
but we
should coordinate our efforts and ensure we have the same DBI versions.
What I'd prefer seeing is: one person be the master DBI builder and
everyone share that version of the DBI, just in case.

I don't mind putting more modules on my ftp site...

Regards,

Jeff

 -Original Message-
 From: Michael A Chase [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 08, 2002 3:00 PM
 To: dbi-users
 Subject: Private PPM repositories in DBI FAQ


 Since the ActiveState PPM repository is often out of date, some of you
 have built PPMs and made them available.  Unfortunately, every time I
want
 to suggest someone get the latest version from one of your private
 repositories, I can't find the URI.

 I have added a DBI FAQ (120) to list private repositories.  Please add
 yours, or email me with the URI so I can add it.

 --
 Mac :})
 Give a hobbit a fish and he eats fish for a day.
 Give a hobbit a ring and he eats fish for an age.







RE: ./file is not working

2002-10-06 Thread Sterin, Ilya

Not working can relate to a gazillion of things.  Please be more specific
of what is not working, what happens, etc...

Ilya


-Original Message-
From: purnima nagar
To: [EMAIL PROTECTED]
Sent: 10/6/02 11:49 PM
Subject: ./file is not working


Hi,

I have perl scripts in a directory. I need to run those scripts almost
from 
anywhere its being called from. For this I gave ./filename.its not 
working. I checked with the file permission..its 711 i.e, rwx--x--x for
all 
the script files.

Purnima.


_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com



FAQ emails now work

2002-10-05 Thread Sterin, Ilya

The list will now receive email about any FAQ changes.

Ilya



***FAQ Emails now disabled***

2002-10-05 Thread Sterin, Ilya

Sorry for the inconvenience, all.

We thought it would be a good idea for the FAQ changes to go to the list,
but guess it was too much...

Tim, what do you think, should we just proceed and keep them off, or do you
want me to write a patch to FAQ-o-matic to only send new additions?

Let me know, also anyone willing to contribute such a patch we'll be
appreciated.

Ilya



RE: Uploaded to CPAN: DBIx::Dump

2002-10-04 Thread Sterin, Ilya (I.)

That would be fine.  I was thinking in terms of supporting data formats that
can't be queried, though why DBD is sort of not an issue here.  Though
AnyData.pm, I haven't looked at the source, I'm not sure if Jeff wants to
add these misceleneous data structures.  Also...

I just added an event driven interface to DBIx::Dump, which allows to define
event handlers and due on the fly transformations/formatting before
outputting.  Not sure about the AnyData interface and if it will allow for
such additions without much reprogramming.

Jeff???

Ilya

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 03, 2002 4:45 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Uploaded to CPAN: DBIx::Dump


 Ilya == Ilya Sterin [EMAIL PROTECTED] writes:

Ilya DBIx::Dump allows to dump DBI result set into a variety of formats
like
Ilya Excel, CSV, XML, etc...

Ilya Right now, it only dumps to Excel, tomorrow's release will dump into
CSV as
Ilya well, then sometime this week it will dump into XML...

How is this different from what DBD::AnyData can do?

Maybe the two of you should get together and merge efforts, or maybe
you can just take over maintenance?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!



RE: DBI module make problem

2002-10-04 Thread Sterin, Ilya

Has nothing to do with flags, see the FAQ link I sent previously.

Ilya

-Original Message-
From: McMullen, David E. (NGIT)
To: [EMAIL PROTECTED]
Sent: 10/4/02 9:12 AM
Subject: RE: DBI module make problem

As an update, I changed the -KPIC flag to just -P, it passed that
section,
but still fails on cc: language depend not recognized.


-Original Message-
From: McMullen, David E. (NGIT) [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 04, 2002 9:50 AM
To: [EMAIL PROTECTED]
Subject: DBI module make problem


I am trying to compile the DBI module on Solaris 8 and there appears to
be a
problem with my cc.  Has anyone seen this before or know if a fix?


cc -c   -xO3 -xdepend -DVERSION=\1.30\  -DXS_VERSION=\1.30\
-KPIC
-I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS Perl.c
cc: unrecognized option `-KPIC'
cc: language depend not recognized



davidmac



RE: Database to Excel script...

2002-10-03 Thread Sterin, Ilya

Where did you get the set_column method, I don't even see one in perldoc?

Ilya

-Original Message-
From: NIPP, SCOTT V (SBCSI)
To: Sterin, Ilya; ''Jeff Zucker' '; 'dbi-users '
Sent: 10/3/02 8:29 AM
Subject: RE: Database to Excel script...

I am trying to do the cell formatting now and I am running into an
error message:
 
Can't locate object method set_column via package
Spreadsheet::WriteExcel at
 ./oncall_report.pl line 23.
 
Here is the line of the script...
 
$xls-set_column(6, 7, 50);
 
I am not sure what is wrong with this...  I pretty much copied this
code from one of the examples, but I am definitely having a problem.
Thanks again.

-Original Message-
From: Sterin, Ilya [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 11:12 PM
To: NIPP, SCOTT V (SBCSI); ''Jeff Zucker' '; 'dbi-users '
Subject: RE: Database to Excel script...



Actually I can set up some event handlers in DBIx::Dump, which will
allow you to assign an even handler to handle transformations.

Give me until tomorrow noon. 

Ilya 

-Original Message- 
From: NIPP, SCOTT V (SBCSI) 
To: 'Jeff Zucker'; Sterin, Ilya; dbi-users 
Sent: 10/2/02 2:45 PM 
Subject: RE: Database to Excel script... 

OK...  I am stuck once again.  I am to pull the data from the 
database and export it directly to an Excel file.  Now, I am trying to 
figure out the formatting...  The first problem I am running into is 
reformatting dates from the output of MySQL to the desired Excel format.

Here is a same of what I am attempting: 

MySQL date:  2002-09-02 13:13:00 

Desired Excel date:  9/2/2002 13:13 

I know that there is a set_num_format function in the WriteExcel

module, but this works with epoch numbers.  I am not sure about 
transforming 
one date format to another date format.  Any help would be greatly 
appreciated. 

-Original Message- 
From: Jeff Zucker [ mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ] 
Sent: Tuesday, October 01, 2002 6:51 PM 
To: Sterin, Ilya; dbi-users 
Subject: Re: Database to Excel script... 


Sterin, Ilya wrote: 

 Jeff, that's helpful:-) 
 
 but that does not pupulat the excel spreadsheet with data from a 
select 
 query, rather you have to select and loop while do()ing it. 
 
 There is lot of overhead for certain things, I just though a simple 
mod 
 would help to just dump data, and nothing else. 


How much simpler can you get than this (requires only AnyData, not 
DBD::AnyData or any of the SQL* modules): 

   use DBI; 
   use AnyData; 
   my $dbh = DBI-connect($mysql_or_other_dsn); 
   my $sth = $dbh-prepare($query); 
   for my $new_format(qw(CSV XML Ini Tab Pipe Fixed HTMLTable)) { 
 adConvert( 'DBI', $sth, $new_format, newfile.$new_format); 
   } 
   __END__ 

-- 
Jeff 




RE: Database to Excel script...

2002-10-03 Thread Sterin, Ilya

This is getting pretty OT as well.  So possibly you can either ask in
person, or on comp.lang.perl.misc

Thanks.

Ilya

-Original Message-
From: NIPP, SCOTT V (SBCSI)
To: Sterin, Ilya; ''Jeff Zucker' '; 'dbi-users '
Sent: 10/3/02 8:29 AM
Subject: RE: Database to Excel script...

I am trying to do the cell formatting now and I am running into an
error message:
 
Can't locate object method set_column via package
Spreadsheet::WriteExcel at
 ./oncall_report.pl line 23.
 
Here is the line of the script...
 
$xls-set_column(6, 7, 50);
 
I am not sure what is wrong with this...  I pretty much copied this
code from one of the examples, but I am definitely having a problem.
Thanks again.

-Original Message-
From: Sterin, Ilya [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 11:12 PM
To: NIPP, SCOTT V (SBCSI); ''Jeff Zucker' '; 'dbi-users '
Subject: RE: Database to Excel script...



Actually I can set up some event handlers in DBIx::Dump, which will
allow you to assign an even handler to handle transformations.

Give me until tomorrow noon. 

Ilya 

-Original Message- 
From: NIPP, SCOTT V (SBCSI) 
To: 'Jeff Zucker'; Sterin, Ilya; dbi-users 
Sent: 10/2/02 2:45 PM 
Subject: RE: Database to Excel script... 

OK...  I am stuck once again.  I am to pull the data from the 
database and export it directly to an Excel file.  Now, I am trying to 
figure out the formatting...  The first problem I am running into is 
reformatting dates from the output of MySQL to the desired Excel format.

Here is a same of what I am attempting: 

MySQL date:  2002-09-02 13:13:00 

Desired Excel date:  9/2/2002 13:13 

I know that there is a set_num_format function in the WriteExcel

module, but this works with epoch numbers.  I am not sure about 
transforming 
one date format to another date format.  Any help would be greatly 
appreciated. 

-Original Message- 
From: Jeff Zucker [ mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ] 
Sent: Tuesday, October 01, 2002 6:51 PM 
To: Sterin, Ilya; dbi-users 
Subject: Re: Database to Excel script... 


Sterin, Ilya wrote: 

 Jeff, that's helpful:-) 
 
 but that does not pupulat the excel spreadsheet with data from a 
select 
 query, rather you have to select and loop while do()ing it. 
 
 There is lot of overhead for certain things, I just though a simple 
mod 
 would help to just dump data, and nothing else. 


How much simpler can you get than this (requires only AnyData, not 
DBD::AnyData or any of the SQL* modules): 

   use DBI; 
   use AnyData; 
   my $dbh = DBI-connect($mysql_or_other_dsn); 
   my $sth = $dbh-prepare($query); 
   for my $new_format(qw(CSV XML Ini Tab Pipe Fixed HTMLTable)) { 
 adConvert( 'DBI', $sth, $new_format, newfile.$new_format); 
   } 
   __END__ 

-- 
Jeff 




RE: Performance problem with DBI, DBD-Oracle8

2002-10-03 Thread Sterin, Ilya

Why can't you access the DBI FAQ?  www.xmlproj.com/cgi/fom.cgi

Ilya

-Original Message-
From: Tim Bunce
To: John-Thomas Beadles
Cc: [EMAIL PROTECTED]
Sent: 10/3/02 3:31 AM
Subject: Re: Performance problem with DBI, DBD-Oracle8

Make sure you're using the latest DBD::Oracle.
Send a trace(8) log - just the part from prepare thru execute.

Tim.

On Wed, Oct 02, 2002 at 05:45:01PM -0500, John-Thomas Beadles wrote:
 Help!  I'm having a severe performance problem with a Perl program
talking
 to a remote Oracle database.  I've read the DBI  DBM perldocs, the
O'Reilly
 book and can't access the DBI faq.
 
 To characterize the problem, I've created a small, transportable
program
 that will run on my PC and on the UNIX workstation where the program
has to
 run. The program completes in about 20 seconds on my PC, and about 20
 minutes on the UNIX workstation.  The program pulls approx. 38k
records from
 a 1.2M record table. On both, the query appears to prepare and execute
 promptly.  The problem appears to be fetching the data to the client.
I did
 a trace that shows the issue.  It seems to just take a long time to do
all
 these fetches to get the results.  Is there anything configurable in
DBI
 that could affect this?  The UNIX server is a multi-processor machine,
low
 CPU utilization, though the disk gets a good workout.
 
 DBI 1.14-nothread dispatch trace level set to 2
 - prepare for DBD::Oracle::db
(DBI::db=HASH(0x400faf14)~0x400faf44
 'SELECT target, to_char(timestamp,'-MM-DD HH:MI:SS') FINISH FROM
 reports_generated WHERE data_date = to_date('20020929','MMDD') ')
 - prepare= DBI::st=HASH(0x400fec5c) at rpts_gen_2.txt line 26.
 
 Wed Oct  2 17:06:15 2002 - SQL Prepared
 
 - execute for DBD::Oracle::st
(DBI::st=HASH(0x400fec5c)~0x400faeb4)
 dbd_st_execute SELECT (out0, lob0)...
 dbd_st_execute SELECT returned (SUCCESS, rpc0, fn4, out0)
 fbh 1: 'TARGET'   NO null , otype   1-  5, dbsize 20/21, p20.s0
 fbh 2: 'FINISH'   NO null , otype   1-  5, dbsize 19/20, p19.s0
 - execute= '0E0' at rpts_gen_2.txt line 30.
 - fetchall_arrayref in DBD::_::st for DBD::Oracle::st
 (DBI::st=HASH(0x400fec5c)~0x400faeb4)
 2   - fetch for DBD::Oracle::st (DBI::st=HASH(0x400faeb4)~INNER)
 2   - fetch= [ 'X1' '2002-09-23 11:30:36' ] at DBI.pm line
1112.
 2   - fetch for DBD::Oracle::st (DBI::st=HASH(0x400faeb4)~INNER)
 
 *snip*
 
 2   - fetch= [ 'Y1' '2002-10-01 06:16:13' ] at DBI.pm line
1112.
 2   - fetch for DBD::Oracle::st (DBI::st=HASH(0x400faeb4)~INNER)
 2   - fetch= undef at DBI.pm line 1112.
 - fetchall_arrayref= [ ARRAY(0x400fed7c) ARRAY(0x400feda0)
 ARRAY(0x400fedd0) ARRAY(0x400fee00) ARRAY(0x400fee30)
ARRAY(0x400fee60)
 ARRAY(0x400fee90) ARRAY(0x400feec0) ARRAY(0x400feef0)
ARRAY(0x400fef20)
 ARRAY(0x400fef50) ARRAY(0x400fef80) ARRAY(0x400fefb0)
ARRAY(0x400fefe0)
 ARRAY(0x40101034) ARRAY(0x40101064) ARRAY(0x40101094)
ARRAY(0x401010c4)
 ARRAY(0x401010f4) ARRAY(0x40101124) ARRAY(0x40101154)
ARRAY(0x40101184)
 ARRAY(0x401011b4) ARRAY(0x401011e4) ARRAY(0x40101214)
ARRAY(0x40101244)
 ARRAY(0x40101274) ARRAY(0x401012a4) ARRAY(0x401012d4)
ARRAY(0x40101304)
 ARRAY(0x40101334) ARRAY(0x40101364) ARRAY(0x40101394)
ARRAY(0x401013c4)
 ARRAY(0x401013f4) 
 
 *snip*
 
 ARRAY(0x407da244) ARRAY(0x407da274) ARRAY(0x407da2a4)
ARRAY(0x407da2d4)
 ARRAY(0x407da304) ARRAY(0x407da334) ARRAY(0x407da364)
ARRAY(0x407da394)
 ARRAY(0x407da3c4) ARRAY(0x407da3f4) ARRAY(0x407db438)
ARRAY(0x407db468)
 ARRAY(0x407db498) ARRAY(0x407db4c8) ARRAY(0x407db4f8)
ARRAY(0x407db528)
 ARRAY(0x407db558) ARRAY(0x407db588) ARRAY(0x407db5b8)
ARRAY(0x407db5e8)
 ARRAY(0x407db618) ARRAY(0x407db648) ARRAY(0x407db678) ] at
rpts_gen_2.txt
 line 32.
 
 Wed Oct  2 17:34:45 2002 - Executed
 
 - err in DBD::_::common for DBD::Oracle::st
 (DBI::st=HASH(0x400fec5c)~0x400faeb4)
 - err= undef at rpts_gen_2.txt line 37.
 - err in DBD::_::common for DBD::Oracle::db
 (DBI::db=HASH(0x400faf14)~0x400faf44)
 - err= undef at rpts_gen_2.txt line 38.
 - errstr in DBD::_::common for DBD::Oracle::db
 (DBI::db=HASH(0x400faf14)~0x400faf44)
 - errstr= undef at rpts_gen_2.txt line 39.
 
 Wed Oct  2 17:34:45 2002 - Returned 38726 records
 
 - finish for DBD::Oracle::st
(DBI::st=HASH(0x400fec5c)~0x400faeb4)
 - finish= 1 at rpts_gen_2.txt line 60.
 
 Wed Oct  2 17:34:45 2002 - sth released
 
 - disconnect for DBD::Oracle::db
(DBI::db=HASH(0x400faf14)~0x400faf44)
 - disconnect= 1 at rpts_gen_2.txt line 65.
 -- DBI::END
 - disconnect_all for DBD::Oracle::dr
 (DBI::dr=HASH(0x400b75b8)~0x400faf5c)
 - disconnect_all= '' at DBI.pm line 450.
 - DESTROY for DBD::Oracle::st (DBI::st=HASH(0x400faeb4)~INNER)
 - DESTROY= undef during global destruction.
 - DESTROY in DBD::_::common for DBD::Oracle::dr
 (DBI::dr=HASH(0x400faf5c)~INNER)
 - DESTROY= undef during global destruction.
 - DESTROY for DBD::Oracle::db (DBI::db=HASH(0x400faf44)~INNER)
 - DESTROY= undef during 

RE: fetchrow_array

2002-10-03 Thread Sterin, Ilya

It's doing what it is supposed to.  Fetches the first row, which only has
one record.  The reason it has an array in it, is because it would fetch an
array if you selected more than one column.

Now, you can either iterate using while through each row and push() into an
array, or...

use selectrow_array() to fetch all at once.

Ilya

-Original Message-
From: chad kellerman
To: [EMAIL PROTECTED]
Sent: 10/3/02 1:59 PM
Subject: fetchrow_array

 SMIME.txt 



FW: CPAN Upload: I/IS/ISTERIN/DBIx-Dump-0.03.tar.gz

2002-10-03 Thread Sterin, Ilya

Version 0.03 now allows an event driven interface to transformations.

You can define an event handler, and transform values as you'd like if
custom formating is needed.

Here is an example...

#

use DBI;
use DBI::Dump;

my $dbh = DBI-connect(...);

my $sth = $dbh-prepare(select * from users);

$sth-execute();

my $exceldb = DBIx::Dump-new();

$exceldb-dump('format' = 'excel', 'output' = 'db2.xls', 'sth' = $sth,
'eventHandler' = \handler);

my $count = 0;
sub handler
{
my ($self, $data, $colName, $row) = @_;

my $format;
if ($count == 0)
{
$format = $self-{Generator}-addformat(); # Add a format
$format-set_bold();
$format-set_color('red');
$format-set_align('center');
$self-{excelFormat} = $format;
}
$count++;

if ($row == 2)
{
$self-{excelFormat} = undef;
$format = $self-{Generator}-addformat(); # Add a format
$format-set_num_format(0x0f);
}

if ($row  1  $colName == 'ACQUISITION DATE')
{
$self-{excelFormat} = $format;
}
elsif ($row  1)
{
$self-{excelFormat} = undef;
}
}

# 

-Original Message-
From: PAUSE
To: Ilya Sterin; [EMAIL PROTECTED]
Sent: 10/3/02 3:40 PM
Subject: CPAN Upload: I/IS/ISTERIN/DBIx-Dump-0.03.tar.gz

The uploaded file

DBIx-Dump-0.03.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IS/ISTERIN/DBIx-Dump-0.03.tar.gz
  size: 3145 bytes
   md5: 2a080fb4a0bddb0ecf95f0c9c0665ca7

No action is required on your part
Request entered by: ISTERIN (Ilya Sterin)
Request entered on: Thu, 03 Oct 2002 21:39:36 GMT
Request completed:  Thu, 03 Oct 2002 21:40:17 GMT

Virtually Yours,
Id: paused,v 1.81 2002/08/02 11:34:24 k Exp k 



RE: Uploaded to CPAN: DBIx::Dump

2002-10-03 Thread Sterin, Ilya

That would be fine.  I was thinking in terms of supporting data formats that
can't be queried, though why DBD is sort of not an issue here.  Though
AnyData.pm, I haven't looked at the source, I'm not sure if Jeff wants to
add these misceleneous data structures.  Also...

I just added an event driven interface to DBIx::Dump, which allows to define
event handlers and due on the fly transformations/formatting before
outputting.  Not sure about the AnyData interface and if it will allow for
such additions without much reprogramming.

Jeff???

Ilya



-Original Message-
From: [EMAIL PROTECTED]
To: Sterin, Ilya
Sent: 10/3/02 2:44 PM
Subject: Re: Uploaded to CPAN: DBIx::Dump

The following message is a courtesy copy of an article
that has been posted to perl.dbi.users as well.

 Ilya == Ilya Sterin [EMAIL PROTECTED] writes:

Ilya DBIx::Dump allows to dump DBI result set into a variety of formats
like
Ilya Excel, CSV, XML, etc...

Ilya Right now, it only dumps to Excel, tomorrow's release will dump
into CSV as
Ilya well, then sometime this week it will dump into XML...

How is this different from what DBD::AnyData can do?

Maybe the two of you should get together and merge efforts, or maybe
you can just take over maintenance?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!



A question about the dbi-users list

2002-10-02 Thread Sterin, Ilya

Ok, see if anyone here is familiar with the perl.org mailing lists...

I'm trying to get the FAQ to email the list.  The problem is that the FAQ is
running on a server for which the default mail address is used for another
purpose and I can't subscribe with it.  So when I use sendmail, the domain
it's sending from is something.org, where I'm subscribed as
[EMAIL PROTECTED] to the list.  SO when doing...

sendmail -t [EMAIL PROTECTED]
From: [EMAIL PROTECTED]

..
..

The email comes with From header correctly undentified as unravelnet.com,
but when doing so to dbi-users it does not go through.  So list daemon is
possibly searching another header?

Any ideas?

Ilya



RE: Database to Excel script...

2002-10-02 Thread Sterin, Ilya

Actually I can set up some event handlers in DBIx::Dump, which will allow
you to assign an even handler to handle transformations.

Give me until tomorrow noon.

Ilya

-Original Message-
From: NIPP, SCOTT V (SBCSI)
To: 'Jeff Zucker'; Sterin, Ilya; dbi-users
Sent: 10/2/02 2:45 PM
Subject: RE: Database to Excel script...

OK...  I am stuck once again.  I am to pull the data from the
database and export it directly to an Excel file.  Now, I am trying to
figure out the formatting...  The first problem I am running into is
reformatting dates from the output of MySQL to the desired Excel format.
Here is a same of what I am attempting:

MySQL date:  2002-09-02 13:13:00

Desired Excel date:  9/2/2002 13:13

I know that there is a set_num_format function in the WriteExcel
module, but this works with epoch numbers.  I am not sure about
transforming
one date format to another date format.  Any help would be greatly
appreciated.

-Original Message-
From: Jeff Zucker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 6:51 PM
To: Sterin, Ilya; dbi-users
Subject: Re: Database to Excel script...


Sterin, Ilya wrote:

 Jeff, that's helpful:-)
 
 but that does not pupulat the excel spreadsheet with data from a
select
 query, rather you have to select and loop while do()ing it.
 
 There is lot of overhead for certain things, I just though a simple
mod
 would help to just dump data, and nothing else.


How much simpler can you get than this (requires only AnyData, not 
DBD::AnyData or any of the SQL* modules):

   use DBI;
   use AnyData;
   my $dbh = DBI-connect($mysql_or_other_dsn);
   my $sth = $dbh-prepare($query);
   for my $new_format(qw(CSV XML Ini Tab Pipe Fixed HTMLTable)) {
 adConvert( 'DBI', $sth, $new_format, newfile.$new_format);
   }
   __END__

-- 
Jeff



RE: DBI-FAQ Volunteer needed to transfer old DBI::FAQ data to new FAQ

2002-10-01 Thread Sterin, Ilya (I.)

Well, actually David Crown is already doing this:-)  Michael if you'd like to help him 
out, please contact him.

What we'll need help with is later properly editing and categorizing this stuff, as 
some of it needs some major updating.

I have not yet forwarded the changes to FAQ email to go to the list, because of so 
many changes at this hour.  I'll do so as soon as David is done with the old FAQ and 
we update and categorize everything.

David's email is...

[EMAIL PROTECTED] 

Ilya Sterin

P.S. Though it would be helpful for the patch to DBI::FAQ, IMO.  Let's see what Tim 
suggests.



-Original Message-
From: Michael A Chase
To: Sterin, Ilya; '[EMAIL PROTECTED]'
Sent: 9/30/02 5:58 PM
Subject: Re: DBI-FAQ Volunteer needed to transfer old DBI::FAQ data to new FAQ

On Mon, 30 Sep 2002 13:34:17 -0600 Sterin, Ilya [EMAIL PROTECTED]
wrote:

 In search for a volunteer to transfer the answers from the old FAQ,
which
 are not already in the new version and update the FAQ-O-Matic.  If
anyone is
 interested, please let the list know.
 
 Any help on this would be **greatly** appreciated.

I can do that this week.

Tim, Should I generate a patch to DBI::FAQ at the same time, or will
future
versions of that be generated from the new FAQ?
-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.



Old FAQ is now transfered to new DBI FAQ

2002-10-01 Thread Sterin, Ilya

Thanks to a wonderful volunteer who came forward (David Crown) the old FAQ
has now been uploaded into the new DBI FAQ www.xmlproj.com/cgi/fom.cgi

You can now update your bookmarks, as the new FAQ contains all of DBI FAQ
currently available.

Ilya Sterin



DBI FAQ mirror (http://trantor.jsbsystems.com/DBI-FAQ/ )

2002-10-01 Thread Sterin, Ilya

Our first mirror, thanks to David Murray.

We really appreciate your help.

Ilya Sterin



RE: Database to Excel script...

2002-10-01 Thread Sterin, Ilya

You can easily accomplish that by dumpin into a CSV (comma separated file)
with .csv extension which will open in excel as you want.

Ilya

-Original Message-
From: NIPP, SCOTT V (SBCSI)
To: '[EMAIL PROTECTED]'
Sent: 10/1/02 9:04 AM
Subject: Database to Excel script...

I have a MySQL database that I have a few Perl scripts working
on.
I am now looking into doing some reporting on these database tables.  I
would really like to find a script that queries the database and the
uses
the Spreadsheet::WriteExcel module to output the data directly to an
Excel
file.  Does anyone out there have something like this that I could
cannibalize?  Thanks in advance.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com




RE: Database to Excel script...

2002-10-01 Thread Sterin, Ilya

DBIx::Dump :-)

https://pause.perl.org/pub/PAUSE/authors/id/I/IS/ISTERIN/DBIx-Dump-0.01.tar

Ilya

-Original Message-
From: NIPP, SCOTT V (SBCSI)
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Sent: 10/1/02 9:39 AM
Subject: RE: Database to Excel script...

Thanks.  This is definitely helpful, but the one thing I find a
bit
funny is the comments in the code...  I think I recognize it as German,
but
being a stupid American, English is the only language I actually speak.
:)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 11:14 AM
To: NIPP, SCOTT V (SBCSI)
Cc: '[EMAIL PROTECTED]'
Subject: Re: Database to Excel script...


Here we go:
 
 I have a MySQL database that I have a few Perl scripts working
on.
 I am now looking into doing some reporting on these database tables.
I
 would really like to find a script that queries the database and the
uses
 the Spreadsheet::WriteExcel module to output the data directly to an
Excel
 file.  

use diagnostics;
use strict;
use DBI;
use Spreadsheet::WriteExcel;

my $filename =abfrage.xls;
my $user = root;
my $passwort = ;
my $dsn = DBI:mysql:database=medialsoft;host=localhost;
unlink 'dbitrace.log' if -e 'dbitrace.log';

print Content-type: application/vnd.ms-excel\n;
print Content-Disposition: attachment; filename=$filename\n;
print \n;
my ($model_id, $vorname, $name);
my @entries = ();
my %font= (
font  = 'Arial',
size  = 12,
color = 'black',
bold  = 1,
  );
my %shading = (
fg_color = 'red',
pattern  = 1,
  );


  my $dbh = DBI-connect($dsn, $user, $passwort,{RaiseError
= 1});
 $dbh-trace( 2, dbitrace.log );
# trace verfolgung
 my $sth1 = $dbh-prepare( SELECT Count(*) FROM
modelle );
 $sth1-execute();
 # alle Daten durchzählen, Gesamtzahl in
Variable $count schreiben
 my $count = $sth1-fetchrow_array();
 my $sth = $dbh-prepare( SELECT model_id, vorname, name
FROM modelle );

 $sth-execute();
 # alle Daten aus der Datenbank holen
 while (my $ref = $sth-fetchrow_hashref ()) {
push @entries, [ $ref-{model_id}, $ref-{vorname},
$ref-{name} ];
 # pack alles in den HASH
}
   my $workbook  = Spreadsheet::WriteExcel-new(-);
   my $worksheet = $workbook-addworksheet(Adressen);
 $worksheet-set_column(0, 0, 10);
 $worksheet-set_column(1, 4, 20);
[..snip..]
 my $format = $workbook-addformat();
my $format1 = $workbook-addformat(%font);
   my $format2 = $workbook-addformat(%font, %shading);
   my $format3 = $workbook-addformat();
$format3-set_text_wrap();
$format3-set_align('justify');
   $format-set_bold();
   # das war die Exceltabellenformatierung
   # jetzt kommt das schleifen der Daten durch Zeilen und
Spalten
for my $col ( 0..7 ) {
  for my $row ( 1..$count ) {
 my $e = shift @entries;
# HASH entpacken
last unless $e;
# bis nichts mehr an Daten da ist
   my ($id, $vor, $nach) = @$e;

  $worksheet-write($id, 0, $id);
  $worksheet-write($id, 1, $vor);
 $worksheet-write($id, 2, $nach);
$worksheet-write(($count+2), 0,
Programmiert als Open Source Software mit Perl5, DBD::MySQL,
Spreadsheet::WriteExcel by Andreas Schmitz 3. September 2002,
$format1);
   # Varaiblen in Worksheets schreiben
 

}
}
 for my $col ( 0..7 ) {
$worksheet-write(0, 0, ID-Nummer, $format);
 $worksheet-write(0, 1, Vorname, $format1);
 $worksheet-write(0, 2, Name, $format1);
 $worksheet-write(0, 34, Gesamtanzahl,$format);
   }
  #Ueberschriften schreiben


-- 
Andreas Schmitz http://www.medialsoft.de
 _ _  _  _ ° _ _ _  _ _
| | ||_ | \|| || _| (_)|- |
| | ||_ |_/||-||__



  1   2   3   4   5   6   7   8   >