Я создал функцию в PostgreSQL, которая должна принимать данные и вводить их в таблицу.Первая строка данных находится в таблице, но затем я получаю эту ошибку:
org.postgresql.util.PSQLException: результат был возвращен, когда ничего не ожидалось.
Мой Java и функцияСинтаксис в порядке, за исключением этого, в результате чего моя Java-программа остановилась.Вот мой код postgreSQL:
CREATE OR REPLACE FUNCTION public.populategdelt(globaleventid bigint,day bigint,actor1code character varying,actor1name character varying,actor1countrycode character varying,
actor1knowngroupcode character varying,actor1ethniccode character varying,actor1religion1code character varying,actor1religion2code character varying,actor1type1code character varying,
actor2code character varying,actor2name character varying,actor2countrycode character varying,actor2knowngroupcode character varying,actor2ethniccode character varying,
actor2religion1code character varying,actor2religion2code character varying,actor2type1code character varying,eventcode character varying,eventbasecode character varying,
quadclass bigint,goldsteinscale double precision,nummentions bigint,numsources bigint,avgtone double precision,actor1geo_type bigint,actor1geo_fullname character varying,actor1geo_countrycode character varying,actor1geo_adm1code character varying,actor1geo_adm2code character varying,actor1geo_lat double precision,actor1geo_long double precision,actor2geo_type bigint,actor2geo_fullname character varying,actor2geo_countrycode character varying,actor2geo_adm1code character varying,actor2geo_adm2code character varying,actor2geo_lat double precision,actor2geo_long double precision,actiongeo_type bigint,actiongeo_fullname character varying,actiongeo_countrycode character varying,actiongeo_adm1code character varying,actiongeo_adm2code character varying,actiongeo_lat double precision,actiongeo_long double precision,sourceurl character varying)
RETURNS void
LANGUAGE 'sql'
VOLATILE
PARALLEL UNSAFE
COST 100
AS $BODY$insert into data values ( globaleventid, day, actor1code, actor1name, actor1countrycode, actor1knowngroupcode,
actor1ethniccode, actor1religion1code, actor1religion2code, actor1type1code, actor2code, actor2name, actor2countrycode,
actor2knowngroupcode, actor2ethniccode, actor2religion1code, actor2religion2code, actor2type1code, eventcode, eventbasecode,
quadclass, goldsteinscale, nummentions, numsources, avgtone, actor1geo_type, actor1geo_fullname, actor1geo_countrycode,
actor1geo_adm1code, actor1geo_adm2code, actor1geo_lat, actor1geo_long, actor2geo_type, actor2geo_fullname, actor2geo_countrycode,
actor2geo_adm1code, actor2geo_adm2code, actor2geo_lat, actor2geo_long, actiongeo_type, actiongeo_fullname, actiongeo_countrycode,
actiongeo_adm1Code, actiongeo_adm2code, actiongeo_lat, actiongeo_long, sourceurl);
$BODY$;
Нужно ли другое выражение возврата?Потому что я хочу перейти к следующей строке данных, но не могу, если она остановится с этой ошибкой.Что я должен вернуть, если void не будет работать для этой функции?