[SQL] Problem in Stored Procedures

2004-07-09 Thread Pradeepkumar, Pyatalo (IE10)
Hi all, I m using Postgresql version 7.1.3-2. I have written a function which accepts 2 arguments and returns matching tuples from a table based on the arguments passed...but i am having problems in getting it work. This is my function - CREATE TYPE PointType AS(ParamId INTEGER,ParamName VAR

Re: [SQL] append columns that are null

2004-07-09 Thread Hans de Bruin
nobody wrote: "Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have function that appends 2 columns, like "new.field1 = new.field2||new.field3", but when field 3 is null, then the entire outcome is null, while I expected just field2, since when I append nothing to fie

[SQL] Secure DB Systems - How to

2004-07-09 Thread Sarah Tanembaum
I was wondering if it is possible to create a secure database system usingPostgreSQL/PHP combination? I have the following in mind: I wanted to store all my( and my brothers and sisters) important document information such as birth certificate, SSN, passport number, travel documents, insurance(ca

Re: [SQL] append columns that are null

2004-07-09 Thread nobody
"Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have function that appends 2 columns, like > "new.field1 = new.field2||new.field3", > but when field 3 is null, then the entire outcome is null, while I > expected just field2, since when I append nothing to field2,

Re: [SQL] append columns that are null

2004-07-09 Thread nobody
You are welcome. Only if all problems were that simple ;-)... "Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > THX! didn't know that one yet :) > > nobody wrote: > > "Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>I have funct

Re: [SQL] append columns that are null

2004-07-09 Thread Gerwin Philippo
I'd be out of work very soon :( nobody wrote: You are welcome. Only if all problems were that simple ;-)... "Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] THX! didn't know that one yet :) nobody wrote: "Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL

[SQL] append columns that are null

2004-07-09 Thread Gerwin Philippo
I have function that appends 2 columns, like "new.field1 = new.field2||new.field3", but when field 3 is null, then the entire outcome is null, while I expected just field2, since when I append nothing to field2, I get field2, right? Is this standard behaviour, and if so, is there another append f

[SQL] Help with sql statement grouping and distinct

2004-07-09 Thread David Inglis
I want to be able to select a distinct group of rows from 2 tables and then once selected to group and total the results from the previous sql statement I have been trying the following select a.id_fk_accommodation, a.id_fk_selection,a.type,sum(1) from acommodationlog a, log l where (id_fk_a

Re: [SQL] append columns that are null

2004-07-09 Thread Gerwin Philippo
THX! didn't know that one yet :) nobody wrote: "Gerwin Philippo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have function that appends 2 columns, like "new.field1 = new.field2||new.field3", but when field 3 is null, then the entire outcome is null, while I expected just field2, s

Re: [SQL] Triggers - need help !!!

2004-07-09 Thread Mischa Sandberg
"Richard Huxton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Pradeepkumar, Pyatalo (IE10) wrote: > > IF UPDATE(CreateTime) THEN > > > > > > END IF; > > > > Is this syntax correct. > > No, and I don't recall seeing anything like it in the manuals. ... and it's always an

Re: [SQL] How to filter on timestamps?

2004-07-09 Thread Mike Rylander
B.W.H. van Beest wrote: > > > I have a table where one of the columns is of type 'TIMESTAMP' > > How can I do a query to filter on the TIMESTAMP value, e.g. to obtain > all rows earlier than a certain time stamp? Think of the math opperators '<' and '>' as 'before' and 'after', respectively.

[SQL] How to filter on timestamps?

2004-07-09 Thread B.W.H. van Beest
I have a table where one of the columns is of type 'TIMESTAMP' How can I do a query to filter on the TIMESTAMP value, e.g. to obtain all rows earlier than a certain time stamp? Regards, ---(end of broadcast)--- TIP 3: if posting/reading through Use

[SQL] What is PG best practice for storing temporary data in functions?

2004-07-09 Thread Ben
Title: Message There is a very common technique used in other RDBMS (e.g. Sybase) stored procedure programming which I am not sure how best to replicate in Postgres functions.   A Sybase stored procedure can do   select into #temp1   create table #temp2 (…)   call some proc which also u

Re: [SQL] [BUGS] [JDBC] Error in DatabaseMetaData.getColumns() with Views

2004-07-09 Thread Dario V. Fassi
Stephan, look at the samples I send in previous posts , from PgSql and Db2. I know it's a no ease task to change all that behavior , but you must agree that a Numeric column with the fractional part varing from row to row are different data types and break relational rules. If this is the case

Re: [SQL] [JDBC] Error in DatabaseMetaData.getColumns() with Views

2004-07-09 Thread Dario V. Fassi
kris, Next you can see how the same test-case is handled by DB2. -- IBM DB2 V6.1 for Linux CREATE TABLE userid.t (  f1 numeric(6,3),  f2 numeric(6,4),  f3 numeric(8,2) ); create view userid.v as select (f1+f2+f3) as fsum, coalesce(f1,f2,f3) as fcoal, (f1*f2*f3) as fprod, (f1/f2) as fdiv

Re: [SQL] [BUGS] [JDBC] Error in DatabaseMetaData.getColumns() with Views

2004-07-09 Thread Dario V. Fassi
Stephan Szabo wrote: On Sun, 4 Jul 2004, Kris Jurka wrote: On Sat, 3 Jul 2004, Dario V. Fassi wrote: In the sample adjunct, you can see that error arise at the time when the view's sql text is parsed and saved in database catalog. Then generic NUMERIC type is fo

Re: [SQL] [JDBC] Error in DatabaseMetaData.getColumns() with Views

2004-07-09 Thread Kris Jurka
On Sat, 3 Jul 2004, Dario V. Fassi wrote: > In the sample adjunct, you can see that error arise at the time when the > view's sql text is parsed and saved in database catalog. > Then generic NUMERIC type is forced for every calculated column without > regard or precision. > And at execute time

Re: [SQL] Constraint->function dependency and dump in 7.3

2004-07-09 Thread Verebes Gabor
Hi! Why don't you use pg_restore. You can set the order of restoring with parameters. (I haven't tried) By, Gabor -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Együd Csaba Sent: Friday, July 09, 2004 7:15 AM To: 'SZŰCS Gábor'; [EMAIL PROTECTED] Subject:

Re: [SQL] [PHP] Secure DB Systems - How to

2004-07-09 Thread Bruno Wolff III
On Thu, Jul 08, 2004 at 11:49:36 -0400, Sarah Tanembaum <[EMAIL PROTECTED]> wrote: > I was wondering if it is possible to create a secure database system > usingPostgreSQL/PHP combination? > > I have the following in mind: > > I wanted to store all my( and my brothers and sisters) important doc