Re: Mass Update

2001-06-22 Thread Tony Foiani
> "Mike" == MikeBlezien <[EMAIL PROTECTED]> writes: Mike> Yes, where using MySQL version 3.23.37 w/DBI 1.14 This is a case where using Perl and DBI is massive overkill. You can do this with one line of MySQL SQL: UPDATE TABLE Users SET Password = ENCRYPT(Password) WHERE Id > 1; (Assu

Re: works in sqlplus but not through script

2001-06-18 Thread Tony Foiani
> "Laurie" == Laurie Gennari <[EMAIL PROTECTED]> writes: Laurie> I'm sure I must be missing something obvious (it's been one of Laurie> those weeks), but I can't for the life of me figure out why Laurie> this doesn't work. It just hangs and never finishes. Any help Laurie> would be much appre

Re: Loading data from flat file into Oracle--Please Help

2001-06-13 Thread Tony Foiani
> "Anurag" == Anurag Minocha <[EMAIL PROTECTED]> writes: Anurag> Is it possible to load from a flat file into an oracle table Anurag> using perl. The data fields is in fixed form length and the Anurag> load is a conditional load. [...] Anurag> The script should load only thows rows where th

Re: perl data structure for Oracle "index-by table"

2001-06-12 Thread Tony Foiani
> "Marty" == Marty Keane <[EMAIL PROTECTED]> writes: Marty> The end result in oracle is that I have the entire result set Marty> in memory and can skip around, back and forth (so-to-speak) Marty> through the data. I've used fetchall_arrayref with a foreach Marty> loop in the past with perl/db

Re: [Fwd: [Fwd: how to check to a database to see if i need update or insert]]

2001-03-15 Thread Tony Foiani
> "XD" == Xiaoxia Dong <[EMAIL PROTECTED]> writes: XD>$sql = "UPDATE uptime SET up_time=$uphours XD> WHERE hostname = $host and XD> startdate between XD> (TO_DATE('$yy:$month:$sday:$shour:$sminute:00', XD>

Re: Limiting the number of records selected.

2001-03-13 Thread Tony Foiani
Continuing the ongoing saga... I wrote that the "top-n" queries in Oracle can be handled by using a nested SELECT with an ORDER BY, then using ROWNUM in the external WHERE clause. But... > I just tried it on our instance and it doesn't work. We are on > Oracle7 Server Release 7.3.4.5.0. Is t

Re: Return value

2001-03-13 Thread Tony Foiani
> "Dawa" == Dawa Lama <[EMAIL PROTECTED]> writes: Dawa> What would PostgreSQL return for empty table or when the SELECT Dawa> doesn't find any item specified in the condition. I'm unfamiliar with the "fetchrow" method. My preferred method is to use "fetch", which will return an array refere

Re: Limiting the number of records selected.

2001-03-13 Thread Tony Foiani
>>>>> "Bill" == Bill OConnor <[EMAIL PROTECTED]> writes: Bill> I want to use a subset of the selected rows on a webpage. For Bill> instance if the query returns 100 rows I want show just 10 of Bill> them on the page, 11-20 on the next etc. >>>&g

Re: Limiting the number of records selected.

2001-03-09 Thread Tony Foiani
> "Bill" == Bill OConnor <[EMAIL PROTECTED]> writes: Bill> I want to use a subset of the selected rows on a webpage. For Bill> instance if the query returns 100 rows I want show just 10 of Bill> them on the page, 11-20 on the next etc. Look at the discussion of the ROWNUM pseudo-column, in

Re: Can't pass IN value to

2001-03-09 Thread Tony Foiani
> "Duncan" == Duncan Hudson <[EMAIL PROTECTED]> writes: Duncan> Hi, I'm having problem's trying to dynamically create an IN Duncan> statement for MySQL. This is a bit of an FAQ. Please see the threads at: http://www.mail-archive.com/dbi-users%40perl.org/msg00202.html http://www.mail-

Re: Design a place to open/modify/close a ticket

2001-03-05 Thread Tony Foiani
> "David" == Nguyen, David M <[EMAIL PROTECTED]> writes: David> I am tasked to design a database so people can open a ticket, David> modify/close as need. Does someone ever do this with DBI and David> Oracle database? Is there any good resource I can go for demo? It's almost certain that s

Re: Search query on the fly

2001-03-05 Thread Tony Foiani
I wrote: >> Then you can grab the matching businesses by joining against this >> >> table: >> | SELECT bi.* >> | FROM bus_info bi, bus_search_words bsw >> | WHERE bsw.bus_id = bi.bus_id >> | AND bsw.search_word = 'target' >> >> Variations on this (probably adding DISTINCT or GROUP BY w

Re: Search query on the fly

2001-03-02 Thread Tony Foiani
> "Mike" == MikeBlezien <[EMAIL PROTECTED]> writes: Mike> I am trying to put together a SELECT query to perform a search Mike> on a column with various keywords. The column(searchwords) has Mike> keywords something like this: (keyword1 keyword2 keyword3..etc) Mike> separated by a space. Thi

Re: SQL newbie question ....

2001-03-01 Thread Tony Foiani
> "Sean" == Sean Cooper <[EMAIL PROTECTED]> writes: Sean> I have a group of records as keys of a hash. because I can't Sean> sort the values in the hash I'd like to use ORDER BY to sort the Sean> values after I've retrieved them: Depending on how many records you have in your hash, you can a

Re: Problem with fetching rows and date columns

2001-02-28 Thread Tony Foiani
Since I've already gotten two replies off the list about this issue, I thought I'd just forward on the response I sent to Marcelo in private. I realize that this is really an Oracle question, not a Perl or Perl DBI question; apologies in advance if this offends anyone. Thanks, t. > "Marcelo"

Re: Problem with fetching rows and date columns

2001-02-28 Thread Tony Foiani
> "Marcelo" == Marcelo Guelfi <[EMAIL PROTECTED]> writes: Marcelo> I resolved it setting the NLS_DATE_FORMAT in my program. Yes, this is a useful setting. (Although, almost anything would be better than the default Oracle date format, IMNSHO...) Marcelo> About the performance in your queri

Re: Problem with CHAR Data Type in ORACLE

2001-02-27 Thread Tony Foiani
> "Guru" == Guru Prasad <[EMAIL PROTECTED]> writes: Guru> the field 'id' is of type CHAR(5). I didn't get any records ( Guru> when i am sure that the data is available for '1001' ). If i Guru> changed the data type to VARCHAR(5), it is working fine. Why is Guru> it so ? This is indeed becomi

Re: Passing array in SELECT statement giving err.

2001-02-26 Thread Tony Foiani
> "David" == David Jacobowitz <[EMAIL PROTECTED]> writes: David> I have constructed an array using my table field names and David> trying to pass that array in the select statement. David> @inc_re = ( Hotels, Asian_Real_Estate, Smart_Buildings, Real_Estate, David> Senior_Living_Homes ); Th

Re: Problem with fetching rows and date columns

2001-02-26 Thread Tony Foiani
> "Marcelo" == Marcelo Guelfi <[EMAIL PROTECTED]> writes: Marcelo> I'm having problems to fetch rows when the 'select' clause Marcelo> has a where condition with 'date' types columns. I've taken to either using TO_DATE('$date_string', '$date_format'), or setting NLS_DATE_FORMAT to a reasona

Re: DBI insert

2001-02-26 Thread Tony Foiani
> "Randy" == Randy Peterman <[EMAIL PROTECTED]> writes: Randy> Is my problem with MS Access, or is there formatting to be done to the Randy> fields. I am using CGI.pm as well to process all the returned values, Randy> does this cause any undesired changes to the values? Could the comma R

Re: best way to select 1 row

2001-02-26 Thread Tony Foiani
> "Rolf" == Rolf Kamp <[EMAIL PROTECTED]> writes: Rolf> I have a method in a type that I invoke to return one and only Rolf> one row with just one value. As with Perl, there's more thatn Rolf> one way to do it and I want to make sure I use the best Rolf> (fastest/most efficient) way to get th

Re: script retrieval of column names

2001-02-23 Thread Tony Foiani
> "Robb" == Robb Garrioch <[EMAIL PROTECTED]> writes: Robb> Does anyone know of a DBI method ~or~ MySQL specific way that Robb> would retrieve the column names of a MySQL database.table Robb> dynamically within a Perl script using DBI? or Oracle if known. Probably the most portable way to do

Re: Magical Headers and Unsubscribing

2001-02-23 Thread Tony Foiani
> "David" == Furber, David <[EMAIL PROTECTED]> writes: David> (If anyone has a reliable rule I'd love to see it). I'm not sure how comprehensive the Outlook rule capabilities are, but here are my procmail rules for dbi-users: | :0:$IC_LOCK_PREFIX/dbi.users.spool | * ^X-List-ID: | dbi.users

Re: Handeling undef data.

2001-02-22 Thread Tony Foiani
> "Michelle" == Michelle Gerfort <[EMAIL PROTECTED]> writes: Michelle> I'm having a problem when using fetchrow_array(). When I worry about NULLs in column, I find that using plain old "fetch" lets me construct a much simpler outer loop. If I need to grab individual elements later, or build

Re: How to "use" a database with Oracle?

2001-02-21 Thread Tony Foiani
> "Tim" == Tim Bunce <[EMAIL PROTECTED]> writes: Tim> I think in very recent Oracle's there's an SQL command (probably Tim> 'SET ...') that lets you switch default schema. Is this what you are thinking of? ALTER SESSION SET CURRENT_SCHEMA = We use "ALTER SESSION" extensively in ou

Re: placeholders Q

2001-02-08 Thread Tony Foiani
> "Scott" == Purcell, Scott <[EMAIL PROTECTED]> writes: Scott> Can one use placeholders in a update on the Microsoft SQL 7.0 Scott> server? Presumably, the same way you do it against any other SQL back end. Scott> The example from earlier shows the following: Scott>UPDATE ANTIQUES SET

Re: strange error from dbi-oracle

2001-02-08 Thread Tony Foiani
> "Mickey" == Mickey Mestel <[EMAIL PROTECTED]> writes: Mickey> also, how can you find out the dbi and dbd version in an Mickey> installed system? There are probably better ways (investigate CPAN::shell, for instance), but this does the trick: | $ perl -le 'for (@ARGV) { eval "require $_";

Re: bind param problem

2001-02-07 Thread Tony Foiani
> "Michael" == Michael Peppler <[EMAIL PROTECTED]> writes: Michael> I believe that SQL-92 mandates that a non-null string be at Michael> least one character in length. Interesting. The Oracle docs say: Oracle currently treats a character value with a length of zero as null. However,

Re: bind param problem

2001-02-07 Thread Tony Foiani
> "Hans-J" == Hans-J Krause <[EMAIL PROTECTED]> writes: Hans-J> A database *never* should accept an insert of an empty string Hans-J> in a not null column - otherwise what for should a Hans-J> not-null-check to be set? If you said "Oracle database", I'd agree. (And, given the rest of your

Re: How do I form an acceptable string for an IN clause?

2001-02-07 Thread Tony Foiani
Another way to construct a reasonable "IN" clause is to use the DBI::quote method: | my @vals = ('foo', "bar", "baz's"); | my $set = join ', ', map $dbh->quote($_), @vals; | my $sql = "SELECT whatever FROM wherever WHERE somecolumn IN ($set)"; Note that this will properly handle the single qu

Re: Again & Still DATETIME insertion in DBI:Mysql Problem!!!!!!!!

2001-02-01 Thread Tony Foiani
> "Paulo" == Paulo Castro <[EMAIL PROTECTED]> writes: Paulo> I am in a great trouble inserting a DATETIME value in a mySQL Paulo> table from a perl script. As described in the info page "(mysql)Column types": | `DATETIME' | A date and time combination. The supported range is `'1000-01