You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Wolf <co...@irresponsiblecybernetics.com> on 2005/05/05 19:30:00 UTC

PL/pgSQL function not working in (more info)

Posted by Michael Zurke <mi...@zurke.info>.
put




hi eric,

probably out of date. just in case:
try this in your config

  <transactionManager type="JDBC" commitRequired="true">

mischa


Peng Wang wrote:
> try this
> <select id="getSilly" resultClass="int" parameterClass="string">
>             select silly(#value#) from dual
>  </select>
> 
> I think it can work.
> 
> On 5/8/05, Wolf <co...@irresponsiblecybernetics.com> wrote:
> 


>>Hi Clinton,
>>
>>  Thanks for the response.  I have tried this through raw JDBC :
>>          con = DriverManager.getConnection("jdbc:postgresql:wiki");
>>          stat = con.createStatement();
>>          stat.executeQuery("select silly('foo')");
>>  and that works as expected.
>>
>>  I am using the same jdbc driver on both occasions.
>>
>>  I did try select('foo') from dual but I got  ERROR: relation "dual"
>>does not exist. I think DUAL is an oracle only psuedo-table.
>>
>>-Wolf
>>
>>On May 7, 2005, at 7:39 PM, Clinton Begin wrote:
>>
>>
>>> Try select silly(text) from dual.
>>>
>>> Cheers,
>>> Clinton
>>>
>>
>>
> 


Re: PL/pgSQL function not working in (more info)

Posted by Wolf <co...@irresponsiblecybernetics.com>.
Hi Clinton,
    I tried it with a Prepared statement :

	Connection con = DriverManager.getConnection("jdbc:postgresql:wiki");
	PreparedStatement stat = con.prepareStatement("select silly('foo')");
	stat.execute();

    and it did work. I'm confused now.  I'm going through the SqlMaps 
code to take a peek at what might be happening, but can you point me at 
a good spot to look?

Thanks,
    Wolf

ps - I know the function 'silly' doesn't look very useful, but it is a 
stripped down version of a more complicated a function.  If I could get 
the simple code to work, I figure the more complicated should work.

On May 7, 2005, at 8:49 PM, Clinton Begin wrote:

>
>  OH!  I missed the "pg" part of your subject line.  :-)   I thought it 
> said PL/SQL.

    Not a problem. I didn't even know about PL/pgsql until a few days 
ago.  I'm definitely not a database guy (thus my interest in SqlMaps).

>
>  The reason your JDBC test worked is that you used a normal 
> statement.  Try that with a PreparedStatement.
>
>  iBATIS uses PreparedStatements exclusively.
>
>  Clinton


Re: PL/pgSQL function not working in (more info)

Posted by Wolf <co...@irresponsiblecybernetics.com>.
Hi Clinton,

   Thanks for the response.  I have tried this through raw JDBC :
           con = DriverManager.getConnection("jdbc:postgresql:wiki");
           stat = con.createStatement();
           stat.executeQuery("select silly('foo')");
   and that works as expected.

   I am using the same jdbc driver on both occasions.

   I did try select('foo') from dual but I got  ERROR: relation "dual" 
does not exist. I think DUAL is an oracle only psuedo-table.

-Wolf


On May 7, 2005, at 7:39 PM, Clinton Begin wrote:

>
>  Try select silly(text) from dual.
>
>  Cheers,
>  Clinton
>

Re: PL/pgSQL function not working in