query has no destination for result data
query has no destination for result data
Dear Devart,
Is linq support for function that returns void? Or should i download the latest version? Because whenever i run, it always return error "query has no destination for result data".
my current built is 4.55.39
Thanks & Regards,
Ariwibawa
Is linq support for function that returns void? Or should i download the latest version? Because whenever i run, it always return error "query has no destination for result data".
my current built is 4.55.39
Thanks & Regards,
Ariwibawa
Hello Andrey,
Sorry for late reply, here's the script
Thanks & Regards,
Ariwibawa
Sorry for late reply, here's the script
Code: Select all
CREATE TABLE cachesession
(
cachename character varying(30) NOT NULL,
createdtime timestamp without time zone NOT NULL,
createdfor character varying(20) NOT NULL,
cachedata text,
cachetype character varying(200) NOT NULL,
CONSTRAINT "pk_CacheName" PRIMARY KEY (cachename, createdfor)
)
WITHOUT OIDS;
ALTER TABLE cachesession OWNER TO postgres;
-- Function: cachemanagerset(cname character varying, cfor character varying, ctyped character varying, cdata text)
-- DROP FUNCTION cachemanagerset(cname character varying, cfor character varying, ctyped character varying, cdata text);
CREATE OR REPLACE FUNCTION cachemanagerset(cname character varying, cfor character varying, ctyped character varying, cdata text)
RETURNS void AS
$BODY$declare counted bigint;
begin
select counted = count(*) from cachesession where cachename = cname and createdfor = cfor;
if counted = 0 then
insert into cachesession (cachename, createdtime, createdfor, cachetype, cachedata)
values (cname, now(), cfor, ctyped, cdata);
else
update cachesession set cachedata = cdata, createdtime = now(), cachetype = ctyped
where cachename = cname and createdfor = cfor;
end if;
end;$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION cachemanagerset(cname character varying, cfor character varying, ctyped character varying, cdata text) OWNER TO postgres;
Ariwibawa
Dear Shalex,Shalex wrote:Could you please try executing this function with another tool (PgAdmin III, etc)? Does it work correctly?
Please post here pure SQL you are using to call this function.
Please enlight me how to execute this function, because i'm not programmer postgresql. I thought that devart can execute this function corretly.
Thanks & Regards,
Ariwibawa
Function can be executed with the following SQL:
The problem is in the body of your function. Please replace this part of your function body:
with the following select statement:
It should work.
Code: Select all
select cachemanagerset('aa','bb','cc','dd');
Code: Select all
select counted = count(*) from cachesession where cachename = cname and createdfor = cfor;
Code: Select all
select count(*) into counted from cachesession where cachename = cname and createdfor = cfor;