Re: Double quotes in select statement throw an error

2005-01-18 Thread JupiterHost.Net
Moosmann, James wrote: Lee, Hello, The select statement is very valid and so is: SELECT 'Hello World!' as 'My first SQL Statement' -or- SELECT answer = 2+3 Really, try it. ok, but if you $dbh->quote() it, it becomes something like: 'SELECT \'Hello World!\' as \'My first SQL Statement\'' literal

RE: Double quotes in select statement throw an error

2005-01-18 Thread Moosmann, James
Lee, The select statement is very valid and so is: SELECT 'Hello World!' as 'My first SQL Statement' -or- SELECT answer = 2+3 Really, try it. Anyway... I was sent the correct answer and was very surprised in that the syntax is indeed valid on some servers, however the ANSI standard is single qu

RE: installing DBI

2005-01-18 Thread Reidy, Ron
Why didn't you use ppm? - Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Manickam, Sing [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 18, 2005 5:34 PM To: dbi-users@perl.org Subject: installing DBI Hi, my installation of DBI has been futile all

installing DBI

2005-01-18 Thread Manickam, Sing
Hi, my installation of DBI has been futile all day along. I tried CPAN and it says that it cannot spawn cmd.exe even though i have the cmd.exe and if i tried to manually do with dmake it says that install does not exist. Can somebody pls help me know the exact steps that need to be followed. I t

question: DBD-Oracle-1.16

2005-01-18 Thread Vip_Nagalingam
Hi!, the download of this package seems to be comeup with checksum error when untar the file. When click to d/load it creates DBD-Oracle-1.16.tar.tar Is this is the problem. (Embedded image moved to file: pic12572.jpg) Regards, Vip Nagalingam Senior Technical Specialist, Enterprise Sys

Problem with connecting to an Oracle database using Perl

2005-01-18 Thread Charles Lawrence
Gentlemen: I have struggled with this problem for a while now with no success at finding the answer, so I am asking for help from anyone who might know the solution. I am using Windows XP, ActiveState Perl 5.8.4, Oracle 9.2.0.1.0 client and server, DBI (1.45) and DBD-Oracle (1.16) installed

RE: Oracle SQL Comparison

2005-01-18 Thread Graeme St. Clair
Thanks, Ronald and Andy. You were exactly right. TRUNC(BLAH.REQUEST_DATE) <= '25-MAY-01' and so on works exactly as I want. It was actually described in O'Reilly "Mastering Oracle SQL" circa p 161, but I didn't find it till your hints made me look up 'TRUNC on dates' in the index. The book warn

RE: Oracle SQL Comparison

2005-01-18 Thread Ronald J Kimball
Graeme St. Clair [mailto:[EMAIL PROTECTED] wrote: > Oracle 8.1. > > I'm finding that for a REQUEST_DATE value of 25-May-01:- > > WHERE BLAH.REQUEST_DATE <= TO_DATE('25-MAY-01', 'DD-MON-YY') > > yields nothing, while > > WHERE BLAH.REQUEST_DATE >= TO_DATE('25-MAY-01', 'DD-MON-YY') > > spits o

RE: Oracle SQL Comparison

2005-01-18 Thread Andy Hassall
Most common cause for such conditions is the value in the column has a time component, which perhaps you're not seeing due to your NLS_DATE_FORMAT. -- Andy Hassall <[EMAIL PROTECTED]> / Space: disk usage analysis tool / > -Orig

Oracle SQL Comparison

2005-01-18 Thread Graeme St. Clair
Oracle 8.1. I'm finding that for a REQUEST_DATE value of 25-May-01:- WHERE BLAH.REQUEST_DATE <= TO_DATE('25-MAY-01', 'DD-MON-YY') yields nothing, while WHERE BLAH.REQUEST_DATE >= TO_DATE('25-MAY-01', 'DD-MON-YY') spits out the rows I want. WHERE BLAH.REQUEST_DATE BETWEEN TO_DATE('25

Re: Double quotes in select statement throw an error

2005-01-18 Thread JupiterHost.Net
Moosmann, James wrote: Nope, same results, Here is a simple example: Is the syntax invalid? use DBI; my $dbh = DBI->connect('dbi:ODBC:somedb','',''); my $qs = $dbh->quote( "SELECT \"Rows returned: \" "); Why are you quoting the entire query as a string? $dbh->do($qs); Use a valid query: $dbh->do

RE: Double quotes in select statement throw an error

2005-01-18 Thread Rutherdale, Will
quote() is normally used like this (for instance): my $stmt = "UPDATE mytable SET name=" . $dbh->quote("fred") . "WHERE age=3"; That is, the quote() function *puts* the quotes in. Try $ man DBI for more information. The other part: I'm rusty on Oracle, but the query SELECT 'Rows returned:' doesn

RE: Double quotes in select statement throw an error

2005-01-18 Thread Ronald J Kimball
David Goodman [mailto:[EMAIL PROTECTED] wrote: > > Use DBI's quote: > > my $statement = dbh->quote("SELECT \"Rows inserted\" + > @rows"); This is not at all how quote() is meant to be used. quote() is for quoting a single value for interpolation, not an entire SQL statement. For example: m

RE: Double quotes in select statement throw an error

2005-01-18 Thread Moosmann, James
Nope, same results, Here is a simple example: Is the syntax invalid? use DBI; my $dbh = DBI->connect('dbi:ODBC:somedb','',''); my $qs = $dbh->quote( "SELECT \"Rows returned: \" "); $dbh->do($qs); print $dbh->errstr; ---RESULT--- DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]

Re: Double quotes in select statement throw an error

2005-01-18 Thread David Goodman
Use DBI's quote: my $statement = dbh->quote("SELECT \"Rows inserted\" + @rows"); regards, David --- "Moosmann, James" <[EMAIL PROTECTED]> wrote: > The following line produces and error in DBI > excuting with either a do or a > prepare, execute > > my $statement = "SELECT \"Rows inserted\" + @

Double quotes in select statement throw an error

2005-01-18 Thread Moosmann, James
The following line produces and error in DBI excuting with either a do or a prepare, execute my $statement = "SELECT \"Rows inserted\" + @rows "); # ODBC error my $statement2 = "SELECT 'Rows inserted' + @rows "); # works $dbh->do( $statement ); or $sth->prepare( $statement ); $sth->execute();

RE: ANSI SQL

2005-01-18 Thread Michael . Coll-Barth
Daniel, Speaking solely in terms of your example; "select field1 as field1_alias from table1" It would be exactly the same in Oracle. Michael -Original Message- From: Maldonado, Daniel CW2 CTARNG [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 18, 2005 3:38 PM To: dbi-users@perl.

RE: ANSI SQL

2005-01-18 Thread Reidy, Ron
select col as x from tab Is valid syntax since early Oracle 8 (maybe earlier). - Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Maldonado, Daniel CW2 CTARNG [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 18, 2005 1:38 PM To: dbi-users@perl.org Subj

ANSI SQL

2005-01-18 Thread Maldonado, Daniel CW2 CTARNG
OK, I am facing a bit of a dilema here. I am trying to help a group of developers convert a blog system to Oracle. This system was originally written for Mysql but would be great if we could get it working with other DBMS. I am not sure how to make Oracle understand aliases such as: "select

Re: how to connect postgresql database with perl

2005-01-18 Thread Michael A Chase tech
On 01/17/2005 11:43 PM, sudheer raghav said: Please look at http://www.catb.org/~esr/faqs/smart-questions.html . For DBI, http://search.cpan.org/~timb/DBI/DBI.pm http://search.cpan.org/~timb/DBI/ http://search.cpan.org/~timb/DBI/lib/DBI/FAQ.pm For DBD::Pg, http://search.cpan.org/author/RUDY

Re: DBD::Pg - send arrays to a stored procedure

2005-01-18 Thread Rudy Lippan
On 18 Jan 2005, Dmitry Karasik wrote: > >> Then I've modified the script so it looks like this: > >> > >> my $sth = $dbh->prepare( "SELECT dummy(?)"); $sth-> bind_param_array( > >> 1, [1,2,3]); > > Rudy> You caould hack it by passing in a searlized copy of the array and > Rudy> let bind_pa

how to connect postgresql database with perl

2005-01-18 Thread sudheer raghav
hi, am new to Perl. How to connect postgresql database with perl ? here is the Perl code follows: #!/usr/bin/perl use CGI qw(:standard); use DBI; use strict; print "Content-type: text/html\n\n"; use CGI::Carp qw/fatalsToBrowser/; $query = new CGI; print $query->header; $dbh =

Re: DBD::Pg - send arrays to a stored procedure

2005-01-18 Thread Dmitry Karasik
Hi Rudy! >> Then I've modified the script so it looks like this: >> >> my $sth = $dbh->prepare( "SELECT dummy(?)"); $sth-> bind_param_array( >> 1, [1,2,3]); Rudy> You caould hack it by passing in a searlized copy of the array and Rudy> let bind_param do the final quote pass. I'm n