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

2001-02-07 Thread Michael A. Chase
See below. -- Mac :}) ** I normally forward private database questions to the DBI mail lists. ** Give a hobbit a fish and he'll eat fish for a day. Give a hobbit a ring and he'll eat fish for an age. - Original Message - From: "Tony Foiani" <[EMAIL PROTECTED]> To: "Jim Lynch" <[EMAIL PROTE

ANNOUNCE: Alzabo 0.32

2001-02-07 Thread Dave Rolsky
Alzabo is a two-fold program. Its first function is as a data modelling tool. Through either a schema creation interface or a custom perl program, you can create a set of schema, table, column, etc. objects that represent your data model. Alzabo is also capable of reverse engineering an existing d

ODBC install problem

2001-02-07 Thread Ted Boyd
Ladies and Gentlemen: Sorry to be using your talent on such a newbie problem. We are trying to install ODBC on an RS6000 running AIX 4.3.0. Perl, DBI and CGI are all working OK. We started to install ODBC and found we needed an iODBC Manager and a ODBC driver. We also found there was an iODBC Ma

Re: bind param problem

2001-02-07 Thread Rajesh Yenumulapally
The original oracle error message was ORA-01400: cannot insert NULL into ("GRCT"."CGNT222_HELP_USER"."ID_RACF") (DBD ERROR: OCIStmtExecute) instead of ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute). (apologize for the miscommunication) --- Rajesh Yenumulapally <[EMAIL PR

Re: bind param problem

2001-02-07 Thread non-HP
> "Michael" == Michael Peppler <[EMAIL PROTECTED]> writes: Michael> There was a fairly long thread in comp.databases.sybase on Michael> this issue. Joe Celko weighed in with this comment: Found it. http://www.deja.com/[ST_rn=ps]/threadmsg_ct.xp?AN=714120405&fmt=text Michael> 4) Attempti

Re: bind param problem

2001-02-07 Thread Rajesh Yenumulapally
Hi again here I am using the same databse for both the web servers.I am getting the error ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute). Based on this shall I am assume there is something fault with the installation and configuration of the DBI or DBD::Oracle on the web server rat

Re: bind param problem

2001-02-07 Thread Michael Peppler
Tony Foiani writes: > > "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: > Michael> Certainly Sybase (and I presume MS-S

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: How do I form an acceptable string for an IN clause?

2001-02-07 Thread Jeff Zucker
> > And since these are placeholders, no quotes of any kind, as in Graham's > orginal, will work even better :-) Sorry, ignore my foolishness, of course the quotes are needed, they're just not needed in the final SQL. I go back to bed now. -- Jeff

Re: bind param problem

2001-02-07 Thread Stephen Clouse
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, Feb 07, 2001 at 09:50:23AM +0100, Hans-J. Krause wrote: > A database *never* should accept an insert of an empty string in a not null > column Actually, it should. According to SQL-92, '' != NULL. Oracle has threatened to fix the behavior f

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

2001-02-07 Thread Jeff Zucker
Ronald J Kimball wrote: > > On Wed, Feb 07, 2001 at 09:48:49AM -0800, William R. Mussatto wrote: > > On Wed, 7 Feb 2001, Graham Barr wrote: > > > > > Date: Wed, 7 Feb 2001 17:07:53 + > > > From: Graham Barr <[EMAIL PROTECTED]> > > > > > > While everyone is posting thier favorite way to create

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

2001-02-07 Thread Ronald J Kimball
On Wed, Feb 07, 2001 at 09:48:49AM -0800, William R. Mussatto wrote: > On Wed, 7 Feb 2001, Graham Barr wrote: > > > Date: Wed, 7 Feb 2001 17:07:53 + > > From: Graham Barr <[EMAIL PROTECTED]> > > > > While everyone is posting thier favorite way to create a placeholder > > list I thought I wou

Re: selectrow_array Bind Param Example?

2001-02-07 Thread Ronald J Kimball
On Wed, Feb 07, 2001 at 10:10:11AM -0700, [EMAIL PROTECTED] wrote: > Is there an example of the selectrow_array method using bind variables? I > have not been able to successfully use the example in the book "Programming > the PERL DBI". > Since I use this $dbh for another statement against the

Re: bind param problem

2001-02-07 Thread Michael Peppler
Tony Foiani writes: > > "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",

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

2001-02-07 Thread William R. Mussatto
On Wed, 7 Feb 2001, Graham Barr wrote: > Date: Wed, 7 Feb 2001 17:07:53 + > From: Graham Barr <[EMAIL PROTECTED]> > To: dbi-users <[EMAIL PROTECTED]> > Subject: Re: How do I form an acceptable string for an IN clause? > > While everyone is posting thier favorite way to create a placeholder >

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: How do I form an acceptable string for an IN clause?

2001-02-07 Thread Graham Barr
While everyone is posting thier favorite way to create a placeholder list I thought I would send my favorite. chop(my $qus = "?," x @values); $sth = $dbh->prepare(qq{ ... ($qus) ... }); Graham.

Re: A puzzle.....

2001-02-07 Thread Thomas A . Lowery
On Wed, Feb 07, 2001 at 09:03:15AM -0800, Warden, Ronald MCF:EX wrote: > You have to use a do statement, you can't use a prepare statement. From the > perl manual Actually, you can use a "prepare", however it appears that you can not use a bound parameters in a DDL statement (at this time). As

selectrow_array Bind Param Example?

2001-02-07 Thread Andrew . Clifford
Is there an example of the selectrow_array method using bind variables? I have not been able to successfully use the example in the book "Programming the PERL DBI". In my code, I have a previously prepared $dbh handle as follows: $instance = "crsprod"; $username = "**"; $password = "***

Re: A puzzle....

2001-02-07 Thread Tim Bunce
On Wed, Feb 07, 2001 at 11:50:01AM -0500, Thomas A. Lowery wrote: > > Is placeholders not allowed in DDL statements or what? > > Looking at this, I'd say no. Note the describe is skipped, so I'd say > the statement isn't really parsed by Oracle until the execute is > called. > > dbd_prepars

RE: A puzzle.....

2001-02-07 Thread Warden, Ronald MCF:EX
Lars, You have to use a do statement, you can't use a prepare statement. From the perl manual Prepare and execute a single statement. Returns the number of rows affected (-1 if not known or not available) or undef on error. This method is typically most useful for non-select statements w

Re: A puzzle....

2001-02-07 Thread Thomas A . Lowery
> Is placeholders not allowed in DDL statements or what? Looking at this, I'd say no. Note the describe is skipped, so I'd say the statement isn't really parsed by Oracle until the execute is called. dbd_preparse scanned 1 distinct placeholders OCIHandleAlloc(0x81c2d18,0x81e94d4,4,0,(nil))=

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

2001-02-07 Thread Peter J . Holzer
On 2001-02-07 09:58:17 -0500, Jim Lynch wrote: > my $in_clause1="'abcdef','xzyrst'"; > my $in_clause2="'abcdef'"; > > sth=$db->prepare("select * from table_x where txt in (?)"); > > and gotten the same results. Can someone please tell me if it's > possible to generate an IN clause on the fly an

RE: How do I form an acceptable string for an IN clause? (slick)

2001-02-07 Thread Baxter, Lincoln
In perl, there are (naturally) many ways to do things... I recall doing this other somewhat more brute force ways, but I particularly, like this fragment for IN clauses... slick. Perhaps we should add this example could be added to the DBI pod? -Original Message- From: Ronald J Kimbal

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

2001-02-07 Thread Ronald J Kimball
On Wed, Feb 07, 2001 at 09:58:17AM -0500, Jim Lynch wrote: > I've tried everything except standing on my head to get it to work. > This example should show what I'm attempting to do. As long as the > clause has only one element, it works. > > my $in_clause1="('abcdef','xzyrst')"; > my $in_claus

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

2001-02-07 Thread Maria Quinn
Jim, > my $in_clause1="('abcdef','xzyrst')"; > my $in_clause2="('abcdef')"; > > sth=$db->prepare("select * from table_x where txt in ?"); > $sth->execute($in_clause1); > # that works > $sth->execute($in_clause); > # this doesn't I'm guessing you might have just included a typo in your example,

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

2001-02-07 Thread Jim Lynch
Yes, sorry. I didn't take it from a running example. I guess I should have.. Jim. Maria Quinn wrote: > > Jim, > > > my $in_clause1="('abcdef','xzyrst')"; > > my $in_clause2="('abcdef')"; > > > > sth=$db->prepare("select * from table_x where txt in ?"); > > $sth->execute($in_clause1); > > # t

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

2001-02-07 Thread Jim Lynch
I've tried everything except standing on my head to get it to work. This example should show what I'm attempting to do. As long as the clause has only one element, it works. my $in_clause1="('abcdef','xzyrst')"; my $in_clause2="('abcdef')"; sth=$db->prepare("select * from table_x where txt in

RE: :Oracle problem

2001-02-07 Thread Metzler, Larry
try removing the carriage return from the user name and password and see if that helps -Original Message- From: Seger, Jeffrey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 8:54 AM To: 'David Sherrington - Enterprise Services- Data Management Systems Engineer'; [EMAIL PROT

A puzzle....

2001-02-07 Thread Lars Eskildsen
Hi' I am trying to construct an DBI SQL statement like: $my_stmt = $my_dbcon->prepare("CREATE TABLE BLABLABLA AS (SELECT * FROM ANOTHER_TABLE WHERE ID = ?)"); : : $my_stmt->execute($ID); When i do this i get the following DBD error: DBD::Oracle::st execute failed: ORA-01036: illegal

RE: :Oracle problem

2001-02-07 Thread Seger, Jeffrey
Does the password file contain only one password? If so, does it contain a newline character at the end of it? -Original Message- From: David Sherrington - Enterprise Services- Data Management Systems Engineer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 6:53 AM To: [EM

Re: DBI::Oracle problem

2001-02-07 Thread Bodo Eing
Date sent: Wed, 7 Feb 2001 11:53:06 + (GMT) From: David Sherrington - Enterprise Services- Data Management Systems Engineer <[EMAIL PROTECTED]> Send reply to: David Sherrington - Enterprise Services- Data Management Systems Engineer <[EMAIL PROTECTED]>

DBI::Oracle problem

2001-02-07 Thread David Sherrington - Enterprise Services- Data Management Systems Engineer
Hello, I've have a problem with connecting to an Oracle database using DBI under Unix. Basically, I have the Database user passwords in a unix flat file, which I read into the perl script setting a local variable. The Oracle database name and the User name a passed to the perl script as arguem

Re: bind param problem

2001-02-07 Thread Hans-J. Krause
A database *never* should accept an insert of an empty string in a not null column - otherwise what for should a not-null-check to be set? On the otherhand your string is not empty (1 blank: ' '), but in standard oracle is making an ltrim() on strings before inserting to remove leading blanks -