How to insert a web link?
Error message with a SQL function
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > PostgreSQL database development > Error message with a SQL function 13 August 2003 16:25:34

  Top users: 
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

Error message with a SQL function

Krystoffff 8 August 2003 17:13:28
 Hi

I try to create the following SQL function:

CREATE FUNCTION update_affiliate(in­t,double precision,double
precision) RETURNS void AS ' UPDATE affiliate SET balance=balance +
$2, balance_in_points=b­alance_in_points + ( $2 / $3 ) WHERE id = $1; '
LANGUAGE 'sql';

but when I submit this query directly with PostgreSQL, I have the
following error message:

PostgreSQL said: ERROR: Unable to locate type oid 325664 in catalog


I think the problem comes from the first parameter ($1) but I don't
understand because affiliate.id is indeed the primary key of the table
affiliate.

Has anybody an idea ?
Thanks
Krystoffff

-------------------­--------(end of broadcast)---------­------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresq­l.org

Add comment
Tom Lane 9 August 2003 18:16:20 permanent link ]
 proghome@silesky.com­ (krystoffff) writes:> CREATE FUNCTION update_affiliate(in­t,double precision,double> precision) RETURNS void AS ' UPDATE affiliate SET balance=balance +> $2, balance_in_points=b­alance_in_points + ( $2 / $3 ) WHERE id = $1; '> LANGUAGE 'sql';

I don't believe there was a type "void" in PG 7.1. IIRC, back then the
custom was to say "RETURNS opaque" in this situation.

It's probably time for you to update to something newer ...

regards, tom lane

-------------------­--------(end of broadcast)---------­------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresq­l.org

Add comment
Krystoffff 13 August 2003 16:25:34 permanent link ]
 Thanks

You were right, it was because of the return void
But I think in the documentation, I read somewhere that this kind of
return was allowed ... I must have mistaken ...

-------------------­--------(end of broadcast)---------­------------------
TIP 6: Have you searched our list archives?

http://archives.pos­tgresql.org

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > PostgreSQL database development > Error message with a SQL function 13 August 2003 16:25:34

see also:
Slidelayout PowerPoint 2003
Does the MSI K8T NEO2-FIR.. support ECC…
how do you make scrolling marques
pass tests:
see also:
How to convert DVD or Video files on…
How to convert .Mod and .Tod video to…
How to convert MTS, TS, M2TS Video to…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .