pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brady Mathis <bmathis@r-hsoftware.com>
To: pgsql-jdbc@postgresql.org
Subject: Opening view that uses a function - empty column
Date: Fri, 27 Jul 2012 12:46:20 -0700 (PDT)
Message-ID: <aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com> (raw)

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



view thread (8+ messages)  latest in thread

Message-ID: <aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com>
Permalink:  ../aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com/
Also on:    postgresql.org/message-id/aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: bmathis@r-hsoftware.com
  Subject: Re: Opening view that uses a function - empty column
  In-Reply-To: <aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com>
  References: <aec845f8-15f2-41c6-b1d3-04de5b6889ea@googlegroups.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox