Skip site navigation (1) Skip section navigation (2)

Opening view that uses a function - empty column

From: Brady Mathis <bmathis(at)r-hsoftware(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Opening view that uses a function - empty column
Date: 2012-07-27 19:46:20
Message-ID: aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Two step inquiry:


1)  I have created a function that will parse a value out of XML stored in the pg_largeobject table using xpath, like so:


CREATE OR REPLACE FUNCTION extract_from_extended(text, bigint)
  RETURNS text AS
$BODY$
	select translate( xpath(...) );
$BODY$
  LANGUAGE sql VOLATILE
  COST 100;


2)  I then created a view that calls this function as part of the query, like so:


CREATE OR REPLACE VIEW encounter AS 
SELECT md.account_id, extract_from_extended('externalEncounterID'::text, md.id) AS external_id...
	FROM app.menu_data md, app.menu_structure ms
	WHERE...;

When I open this view via JDBC, there is no data in the column that is filled by the function call.

Any thoughts?
TIA, 
BRady

Responses

pgsql-jdbc by date

Next:From: Dave CramerDate: 2012-07-27 20:40:58
Subject: Re: Opening view that uses a function - empty column
Previous:From: Dave CramerDate: 2012-07-26 20:27:48
Subject: Re: upgrade causes psql to not work

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group