Re: [SQL] curly braces to group outer joins in queries from OpenOffice.org?

2003-11-13 Thread Tõnu Põld
Hi AFAK jdbc 3.0 requires driver to support curly braces for escape sequences. For example: {d yyy-mm-dd} {t hh:mm:ss} {ts -mm-dd hh:mm:ss[.f...]} {oj outer-join} {fn scalar-function} Chapter 6.2 states that drivers must support escape syntax. Chapter 13.4 defines escape syntax. http://java

Re: [SQL] How to know column constraints via system catalog tables

2003-11-13 Thread Christoph Haller
> > The only issue I find with your SQL is it relies on "(a.attnum = x.conkey[1] or > a.attnum = x.conkey[2])" which assumes there is two columns forming the primary key of a table. Perhaps, I should explain what I'm trying to achieve with this SQL. > Not exactly. Look at this CREATE TABLE fil

[SQL] Conversion Problem

2003-11-13 Thread Graham
Apologies as this probably isn't really for this list but... In postgresql you can execute a statement such as: SELECT 1 > 2; And it would return 'f' Does anyone know if you can do this in SQL Server as I have to do a conversion of some prewritten SQL code. MTIA, Graham. -

Re: [SQL] Looks are important

2003-11-13 Thread George Weaver
Hi Tom, Switching to a fixed-width font did the trick. Thanks for the help. George - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "George Weaver" <[EMAIL PROTECTED]> Cc: "Josh Berkus" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; "Louise Cofield" <[EMAIL PROTECTED]> Sent: We

Re: [SQL] Conversion Problem

2003-11-13 Thread Christoph Haller
> > Apologies as this probably isn't really for this list but... Right. > > In postgresql you can execute a statement such as: > > SELECT 1 > 2; > > And it would return 'f' > > Does anyone know if you can do this in SQL Server as I have to do a > conversion of some prewritten SQL code. No, I

Re: [SQL] Conversion Problem

2003-11-13 Thread Richard Huxton
On Thursday 13 November 2003 12:25, Graham wrote: > Apologies as this probably isn't really for this list but... > > In postgresql you can execute a statement such as: > > SELECT 1 > 2; > > And it would return 'f' > > Does anyone know if you can do this in SQL Server as I have to do a > conversion

Re: [SQL] Looks are important

2003-11-13 Thread Louise Cofield
Title: Message Using a fixed-width font as Tom suggests, concatenate an additional space between the no field and the kind field:   SELECT RPAD(no,30,' ') || ' ' || TRIM(tableb.kind) FROM tablea  WHERE tablea.kind = tableb.kind   Louise -Original Message-From: [EMAIL PROTECT

[SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
I noted that such a function returns an empty rowset if a NULL value is passed as an argument. Is it a bug or feature? I wish it was a feature, because I probably want to use this behavour. Here's an example: CREATE TYPE ts_bounds AS ( sdate timestamptz, edate timestamptz );

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Richard Huxton
On Thursday 13 November 2003 16:08, Alexander M. Pravking wrote: > I noted that such a function returns an empty rowset if a NULL value is > passed as an argument. Is it a bug or feature? I wish it was a feature, > because I probably want to use this behavour. >From the SQL commands section of the

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
On Thu, Nov 13, 2003 at 05:14:27PM +, Richard Huxton wrote: > RETURNS NULL ON NULL INPUT or STRICT indicates that the function always > returns NULL whenever any of its arguments are NULL. If this parameter is > specified, the function is not executed when there are NULL arguments; > instead

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Tom Lane
"Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > On Thu, Nov 13, 2003 at 05:14:27PM +, Richard Huxton wrote: >> RETURNS NULL ON NULL INPUT or STRICT indicates that the function always >> returns NULL whenever any of its arguments are NULL. > Does "NULL result" mean an empty rowset if the

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
On Thu, Nov 13, 2003 at 12:27:58PM -0500, Tom Lane wrote: > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > Does "NULL result" mean an empty rowset if the function returns a record? > > No, it means a null record. "Empty rowset" would apply to a function > declared to return SETOF somethi

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Tom Lane
"Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > Very well then... Can I return a null record from such function > explicitly? Sorry, I could't find it anywhere in docs or examples. Not sure. Seems like you should be able to, but I've never tried it. regards, tom lan

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
On Thu, Nov 13, 2003 at 12:35:41PM -0500, Tom Lane wrote: > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > Very well then... Can I return a null record from such function > > explicitly? Sorry, I could't find it anywhere in docs or examples. > > Not sure. Seems like you should be able to

[SQL] Need Help

2003-11-13 Thread Abdul Wahab Dahalan
Hi! If I've a table like this kk kj pngk vote 01 02 a 12 01 02 b 10 01 03 c 5 and I want to have a query so that it give me a result as below. The condition is for each record with the same kk and kj but di

Re: [SQL] Need Help

2003-11-13 Thread Bruno Wolff III
On Fri, Nov 14, 2003 at 09:04:47 +0800, Abdul Wahab Dahalan <[EMAIL PROTECTED]> wrote: > Hi! > > If I've a table like this > > kk kj pngk vote > 01 02 a 12 > 01 02 b 10 > 01 03 c 5 > > and I want to have a