Re: [SQL] batch file

2001-05-29 Thread Grant
> I want to execute several SQL statements one after another. > Does anyone know if it is possible to create something like a "batch file" > which contains all SQL commands I want. That or just separate commands by a semi colon: select * from table1; select * from table2; -

[SQL] Shortcut?

2001-05-29 Thread Phuong Ma
I'm running Postgres 7.1. I read in the documentation that the from clause can be omitted from a select statement. The example given in the documentation is: SELECT distributors.* WHERE name = 'Westwood'; I tried it on tables in our database, but it doesn't work. Is that part of earlier versio

[SQL] Re: START for SERIAL type?

2001-05-29 Thread Vivek Khera
> "j" == jferry <[EMAIL PROTECTED]> writes: j> When you create a SEQUENCE, you are allowed to specify a START. Is j> there a way to specify a START if you use a serial type in a CREATE j> TABLE statement? No. You do it after you create the table. The SERIAL type creates a sequence, so ju

Re: [SQL] Case Insensitive Queries

2001-05-29 Thread Jim Ballard
This is a good point - and it means that Postgres is not following the SQL Standard in this regard. According to the standard, a scalar string function of a single string argument should return the same "type" of string as its input. So upper() should return a fixed-char-field. But it doesn'

Re: [SQL] Case Insensitive Queries

2001-05-29 Thread Mark
We tried these but it didn't work. However, that's because username is a bpchar and not a varchar, so its padded with blanks. so we tried where lower(trim(username)) = 'test' and it works. We'll change that column to varchar. The real problem was in the datatype for username. Thanks, On 29 M

[SQL] Case Insensitive Queries

2001-05-29 Thread Dan Lyke
Mark writes: > Is it possible to execute a query using a where clause that allows case > insensitive comparison between a field and text. select * from account where upper(username) = upper('test') (Upper used because, as has been remarked on this list and in other places, folding from richer ch

AW: [SQL] Case Insensitive Queries

2001-05-29 Thread Manessinger Andreas
> Is it possible to execute a query using a where clause that > allows case > insensitive comparison between a field and text. > > For example: > > select * from account where username = 'test' > > where username could be 'Test', which would be a match. As is, this > compare is case sensitive

Re: [SQL] Case Insensitive Queries

2001-05-29 Thread [EMAIL PROTECTED]
select * from account where lower(username) = lower('test'); Troy > > Is it possible to execute a query using a where clause that allows case > insensitive comparison between a field and text. > > For example: > > select * from account where username = 'test' > > where username could be

[SQL] binary data

2001-05-29 Thread David Lizano
Is there any method to insert binary data in a PostgreSQL row? What data type must I use to insert an image? Thanks in advance. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

[SQL] Case Insensitive Queries

2001-05-29 Thread Mark
Is it possible to execute a query using a where clause that allows case insensitive comparison between a field and text. For example: select * from account where username = 'test' where username could be 'Test', which would be a match. As is, this compare is case sensitive. grep'd the source,