Hello,
DB: PostgreSQL v9.3.1
Driver: NPGSQL dll version 2.2.0.0
Remobjects.NET v8.1.85.1143
Visual Studio 2012 Update 4
I’ve had an issue with Schema Modeler when trying to import stored procedure into “Tables”. Here are the steps how to reproduce:
1 - Stored procedure:
CREATE OR REPLACE FUNCTION test(
IN in_datumugovora timestamp without time zone,
IN in_datumugovoraod timestamp without time zone,
IN in_datumugovorado timestamp without time zone
)
RETURNS TABLE(id integer, id_status integer, id_korisnik integer) AS
$BODY$
begin
return query
select
1,2,3;
end
$BODY$
LANGUAGE plpgsql VOLATILE;
2 - Drag “public”.“test” into Tables in schema modeler. Message pops:
Warning - Unable to obtain metadata for MyDataBase. Please, specify custom SQL.
Generated SQL statement is:
SELECT * FROM "public"."test"
3 - Adjust SQL as:
SELECT * FROM "public"."test" (:in_datumugovora, :in_datumugovoraod, :in_datumugovorado)
and click Validate button.
Message pops:
Validate SQL - Validation failed: ERROR: 42703: column "nullod" does not exist
and I can’t figure out what is the problem.
When I change only first procedure parameter name from in_datumugovora to something else, for example in_ugovordatum everything is working fine and Schema Modeler says that Validation has succeeded.
Important notice is that i have to change parameter name in procedure on database itself:
CREATE OR REPLACE FUNCTION test(
IN in_ugovordatum timestamp without time zone,
IN in_datumugovoraod timestamp without time zone,
IN in_datumugovorado timestamp without time zone
)
RETURNS TABLE(id integer, id_status integer, id_korisnik integer) AS
$BODY$
begin
return query
select
1,2,3;
end
$BODY$
LANGUAGE plpgsql VOLATILE;
I’ve noticed that, in error situation, second and third parameter contains first parameter name (in_datumugovora) - based on error message (…“nullod”…), but I don’t know is this bug NPGSQL or RemObjects related.