[SQL] Querying for name/value pairs in reverse

2006-07-15 Thread Stefan Arentz
I'm no SQL expert by any means so I'm wondering if something like this is possible. I have two tables like this: create table Errors ( Id serial not null, CreateDate timestamp not null, primary key (Id) ); create table ErrorValues ( Id serial not null, ErrorId int not null, Name

[SQL] Doubt about User-defined function.

2006-07-15 Thread sathiya moorthy
I have doubt about user-defined function returns value : * why function returns( accepts ) One attribute in the arguments of function/table, Otherwise it returns the whole record of the table. Function accept more than arguments . * Why it doesn`t return more than one arguments in the

Re: [SQL] Querying for name/value pairs in reverse

2006-07-15 Thread Paul S
This is definitely doable. one Set way that I could think of doing this would be to first compile a temp table with all of the Value/Pairs that your looking to search for and then just JOIN the ID's (in this case it would be the Value and Pair) to the ErrorValues table. This should give you all

[SQL] Regular Expression in SQL

2006-07-15 Thread Aaron Bono
I recall not long ago a discussion about regular expressions in a query that hit on this exact topic but don't think it was ever resolved so I am giving it a go again...Here is my query (keep in mind that I am just experimenting now so don't worry about the fact that I am using nested substring

Re: [SQL] Doubt about User-defined function.

2006-07-15 Thread Aaron Bono
I am really confused about what your question is. Functions can take zero to many arguments and return one value. The argument types are different from (or at least are independent of) the return value. Arguments are not returned, they are passed into the function. Your use of the terminology

Re: [SQL] Querying for name/value pairs in reverse

2006-07-15 Thread Aaron Bono
On 7/15/06, Stefan Arentz [EMAIL PROTECTED] wrote: I'm no SQL expert by any means so I'm wondering if something like thisis possible.I have two tables like this:create table Errors (Id serial not null,CreateDate timestamp not null,primary key (Id) );create table ErrorValues (Id serial not

Re: [SQL] Querying for name/value pairs in reverse

2006-07-15 Thread Aaron Bono
On 7/15/06, Paul S [EMAIL PROTECTED] wrote: This is definitely doable. one Set way that I could think of doing this would be to first compile a temp table with all of the Value/Pairs that your looking to search for and then just JOIN the ID's (in this case it would be the Value and Pair) to the

Re: [SQL] Regular Expression in SQL

2006-07-15 Thread Tom Lane
Aaron Bono [EMAIL PROTECTED] writes: I thought by using the FOR '#' I could specify exactly what part of the expression I would get but it still grabs the first (...) of the pattern. Hmm ... I think that this is a bug in similar_escape(): it ought to transform parentheses in a SIMILAR pattern