Re: Creating functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/5/6 Félix Sánchez Rodríguez <fesanch@xxxxxxxxxxxxx>:
> Hi:
>
> I tried the code you gave me and it didn't work. I got this error:
> unterminated dollar-quoted string at or near "$$ insert into test(a)
> values($1);"

Yeah, I had an extra # in there.  should be:

# create table test (a int);
# create function addone(x int) returns int as $$
insert into test (a) values ($1); select $1;
$$ language sql;

> To be more specfic, I need to create a function to insert a given string
> into a text type field. I don't need to return anything. I'm also wondering
> if you could attach some documentation on this subject. I have troubles with
> the Internet account.

The docs are kind of big to include here.  I'll see what I can find
and send off list.

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux