On Thursday 30 December 2010 17:47:09 Adrian Klaver wrote:
> To follow up I think the OP was looking for ELSEIF not ELSE IF. Changing
> the ELSE IF to ELSEIF should fix it.
>
Thanks guys. That'll teach me to read tutorials more carefully.
--
Gary Stainburn
I.T. Manager
Ringways Garages
http://www
On 12/30/2010 09:35 AM, Pavel Stehule wrote:
Hello
you badly use a IF statement. It's not C. Every IF must to finish with END IF
this is
IF .. THEN
ELSEIF .. THEN ..
ELSE
END IF
Regards
Pavel Stehule
To follow up I think the OP was looking for ELSEIF not ELSE IF. Changing
the ELSE IF to E
Hello
you badly use a IF statement. It's not C. Every IF must to finish with END IF
this is
IF .. THEN
ELSEIF .. THEN ..
ELSE
END IF
Regards
Pavel Stehule
2010/12/30 Gary Stainburn :
> Hi folks,
>
> I'm writing my first plpsql function in ages and I'm going blind trying to see
> why it won't
Hi folks,
I'm writing my first plpsql function in ages and I'm going blind trying to see
why it won't create. The error message and the code are below. I'm guessing
it's something blindingly obvious, but can someone please point it out to me.
ta
Gary
The actual line number is the LANGUAGE lin
You can return a record:
create function thing(text) returns record as 'select * from whatever
where id=$1' language sql;
Hope this helps.
--Imad
www.EnterpriseDB.com
On 11/5/06, Mark Simon <[EMAIL PROTECTED]> wrote:
I am trying to create a simple function using SQL rather than PGSQL. At
I am trying to create a simple function using SQL rather than
PGSQL. At this point, it's just for the exercise.
Is it possible to create a function similar to the following:
create function thing(text) as select * from whatever where id=$1;
Do I need to specify all of the columns from th
> Is it possible to create a database function that mimics the C function atof?
> I'm guessing it should look something like this:
You can do this to convert a string to a float:
select '3.14'::float + 1;
?column?
--
4.14
(1 row)
Is that what you want?
Yasir
--
Hello,
Is it possible to create a database function that mimics the C function atof?
I'm guessing it should look something like this:
create function atof(varchar) returns float
as '??'
language
returns null on null input;
Thanks,
Mark
-
mark <[EMAIL PROTECTED]> writes:
> Is it possible to create a database function that mimics the C function atof?
Just cast.
There doesn't seem to be a pg_cast entry for varchar to float8, but you
could cast to text and then float8, or you could use functional notation
for the cast (which is a tad
O kyrios mark egrapse stis Feb 20, 2004 :
> Hello,
>
> Is it possible to create a database function that mimics the C function atof?
> I'm guessing it should look something like this:
>
> create function atof(varchar) returns float
> as '??'
> language
>
Hello,
Is it possible to create a database function that mimics the C function atof?
I'm guessing it should look something like this:
create function atof(varchar) returns float
as '??'
language
returns null on null input;
Thanks,
Mark
-
s. Thanks
for all your assistance.
Regards
- Original Message -
From: "Christoph Haller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 17, 2003 7:25 PM
Subject: Re: [SQL] Create function statement with insert statemen
I think the language needs to be in quotes ...
...
' language 'sql';
>>> "Jon Griffin" <[EMAIL PROTECTED]> 03/12/03 11:59AM >>>
You need to put your aliases in:
value1 alias for $1;
etc.
Hello,
>
> I am trying to create a database trigger which inserts into a second
> table. I have created the
Hello Susan,
>
> The relevant code for creating the hexorders table (and associated
> constraints) is:
>
>
> DROP TABLE HEXORDERS ;
>
> DROP SEQUENCE HEXORDERS_SEQ ;
>
> CREATE SEQUENCE HEXORDERS_SEQ START 1 ;
>
> CREATE TABL
Gary Stainburn <[EMAIL PROTECTED]> writes:
> ... However, I cannot find the
> syntax to create a function in SQL. Specifically, how you return the result.
See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xfunc.html#XFUNC-SQL
regards, tom lane
---
Hi all,
As I was reading up on create function etc. while learning plpgsql, I seam to
remember it stated that as well as plpgsql, that other languages are/will be
available including using SQL as the language. However, I cannot find the
syntax to create a function in SQL. Specifically, how y
How Can I Create function delete from... with
returns opague and without plpgsql language.
Sample:
create function fdel returns opaque
as 'delete from tab;' language 'sql';
Thanks.
Tomas N.
',' || arg2 || ',' || arg3 || ',' || arg4 || ',' ||
> arg5)
>
> i.e.:
>
> create function minimum(text) returns integer
>
> and then do the parsing internally ('specially if you're using perl).
> Pretty bad, but it's an opti
Greetings.
I find myself in need of a minimum() function. This is different from the
min() function, which operates across records; what I need is to be able
to say:
UPDATE foo SET newcol = minimum(field1, field2, field3, field4);
>From what I can tell there is no such beast built in, but I wou
Markus Wagner wrote:
> Hi,
>
> one of my users wants to create functions using the C language, but pgs
> says "no permission".
>
> How can I permit the user to do this, while avoiding to give him root
> access rights?
Assuming with "root" access you mean "DB-superuser" rights.
No way!
Markus Wagner <[EMAIL PROTECTED]> writes:
> one of my users wants to create functions using the C language, but pgs
> says "no permission".
> How can I permit the user to do this, while avoiding to give him root
> access rights?
Just a wakeup call here: if you let a user write C functions then
y
Hi,
one of my users wants to create functions using the C language, but pgs
says "no permission".
How can I permit the user to do this, while avoiding to give him root
access rights?
Thanks,
Markus
I am running PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66.
I have currently a table like the following:
TABA:
a|start|finish
-+-+--
R|4| 8
S|6|10
I want the output a table with start incremented by 1, and fininsh as the maximum of
fininish in all r
23 matches
Mail list logo