Help to realise function

From: "Harvey, Allan AC" <HarveyA(at)OneSteel(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Help to realise function
Date: 2006-04-03 04:57:14
Message-ID: 3C2CED55DF019847AB7BD7317837BDA909645131@ntlmsg02.onesteel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

Can anyone offer suggestions on how to realise this function....

It is the $1 as the table name that is the problem.

I'm using Version 7.4.5

create or replace function last_scan( varchar, varchar ) returns float as '
declare
result float;

begin
result := value from $1 where parameter = $2 order by dt desc limit 1;

return result;
end;
' LANGUAGE plpgsql;

Thanks

Allan

The material contained in this email may be confidential, privileged or copyrighted. If you are not the intended recipient, use, disclosure or copying of this information is prohibited. If you have received this document in error, please advise the sender and delete the document. Neither OneSteel nor the sender accept responsibility for any viruses contained in this email or any attachments.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Klint Gore 2006-04-03 05:14:24 Re: Help to realise function
Previous Message HIRA SIROJUDIN ABBAS 2006-04-03 02:33:03 help me...