Re: [SQL] pesky plpgsql

2003-04-02 Thread Walter McGinnis
Thanks for your help.  I'm going to use this bit of functionality once 
or twice, so I went ahead and worked around it in an inelegant, but 
effective manner.

Oh well.

Walter

On Tuesday, April 1, 2003, at 10:03  PM, Tom Lane wrote:

Walter McGinnis <[EMAIL PROTECTED]> writes:
When I call the function I get the following error:
devpps=# select update_cat_keys();
NOTICE:  plpgsql: ERROR during compile of update_cat_keys near line 2
ERROR:  parse error at or near ";"
The select in the loop runs fine in psql.  So I'm stumped...
Hmm, it looks fine to me too.  What PG version is this?  Could you
provide the context (table creation commands, etc) so someone else
could try to run the function?
			regards, tom lane

---(end of 
broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [SQL] simple trigger question ...

2003-04-02 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes:
>> Er ... you just want to bump the sequence and throw away the actual
>> value?  You don't want to store the value somewhere?

> Correct

Then you need something like (untested)

CREATE FUNCTION mytrig() RETURNS TRIGGER AS '
begin
  perform nextval(''seq'');
  return new;
end' LANGUAGE plpgsql;

regards, tom lane


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[SQL] Syntax problem!

2003-04-02 Thread mohamed imdadullah
Hi all,

I am moving the database from sybase to postgresql.Iam having problem 
replacing the following similar syntax from sybase to postgres sql could 
anybody help me out? It doesnt seem to recognize the '?' operator though it 
works fine in Sybase.

select * from version where version_nr =?;
ERROR:  Unable to identify a postfix operator '=?' for type 'integer'
   You may need to add parentheses or an explicit cast
I am sure there must be some replacement in postgres, i havent been able to 
find it though. I would appreciate if anybody could help me out.

regards
pgsqlnovoice
_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]