Re: [SQL] how to call a function with row-type arg

2003-09-12 Thread Richard Hall
DECLARE     I INTEGER; BEGIN     SELECT *   INTO I   FROM foo( ) That part is easy, but I don't understand what you are using as a function parameter. Rick sad wrote: hi  how to call a function with a row_type arg ??  that is the question CREATE FUNCTION foo(tablename) returns

Re: [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Richard Hall
Define the language! If it breaks code, so be it. 2. Throw an error if the _expression_ doesn't return boolean. Yes, yes, absolutely. By definition "an IF, WHILE, or EXIT statement is a boolean _expression_" SO     if "some stupid piece of text" THEN should not compile, there is no BOOLEAN _expre

Re: [SQL] [Newbie] migrating a stored procedure from MSSQL to postgresql

2003-08-20 Thread Richard Hall
As declared, your function returns TEXT, i.e. unlimited characters. >>  CREATE FUNCTION UpdateOrder(INTEGER) RETURNS TEXT AS Since your variable >>  r_SKUPrice RECORD; contains a number of columns >>  SELECT SKU, Price INTO r_SKUPrice you could create a composite TYPE that matches those columns a

Re: [SQL] Our FLOAT(p) precision does not conform to spec

2003-06-16 Thread Richard Hall
Fix the problem and inform the users about code that may break. Rick ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org