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

JDBC: pl/pgsql function runs but does not do anything

From: Rob W <digital_illuminati(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: JDBC: pl/pgsql function runs but does not do anything
Date: 2009-07-13 14:23:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I have a PL/pgsql function called "move_records" that does not take any parameters and does not return any results. It performs inserts on a few tables (as the name suggests, it copies records from one table to another).

When I run this function using pgAdminIII's query window, using the command "select move_records()", it executes correctly and as expected.

However, when I call the function via JDBC, it runs, but appears to do nothing. It's as if nothing it does is getting committed. The relevant Java code is:

CallableStatement statement = connection.prepareCall("{call move_records()}");

At first I thought it was not running at all, so I put in "RAISE INFO" statements to see if it was actually working -- and those did indeed print statements. So I know for sure it is actually running. I tried commenting out different things in case it was failing silently, but that made no difference. Running the stored procedure does not return any errors or warnings.

There must be something really obvious I'm overlooking?

Any help would be greatly appreciated!


pgsql-novice by date

Next:From: John DeSoiDate: 2009-07-13 14:37:32
Subject: Re: JDBC: pl/pgsql function runs but does not do anything
Previous:From: Bryan NuseDate: 2009-07-13 00:33:07
Subject: presence/absence

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