JDBC: pl/pgsql function runs but does not do anything - Mailing list pgsql-novice

From Rob W
Subject JDBC: pl/pgsql function runs but does not do anything
Date
Msg-id 806276.32534.qm@web34607.mail.mud.yahoo.com
Whole thread Raw
Responses Re: JDBC: pl/pgsql function runs but does not do anything
List pgsql-novice
I have a PL/pgsql function called "move_records" that does not take any parameters and does not return any results. It
performsinserts 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
correctlyand 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()}");
statement.execute();

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

There must be something really obvious I'm overlooking?

Any help would be greatly appreciated!


pgsql-novice by date:

Previous
From: Michael Wood
Date:
Subject: Re: Selecting time periods
Next
From: John DeSoi
Date:
Subject: Re: JDBC: pl/pgsql function runs but does not do anything