[SQL] getting PSQLException Can't infer the SQL type to use with Native Query call

2011-05-02 Thread Steven Dahlin
In trying to call a postgresql 8.4 stored function I am passing a class as well as a List (I have to save a master record as well as the detail records). This is being done with a native query using EclipseLink 2.1. However, I am getting back a message for the first item: PSQLException: Can't infe

[SQL] update with recursive query

2011-04-14 Thread Steven Dahlin
Is it possible to execute an update using recursion? I need to update a set of records and also update their children with the same value. I tried the following query but it gave an error at the "update schema.table tbl": with recursive childTbl( pid, ppid,

[SQL] update using recursion

2011-04-14 Thread Steven Dahlin
Is it possible to execute an update using recursion?  I need to update a set of records and also update their children with the same value. I tried the following query but it gave an error at the "update schema.table tbl":     with recursive childTbl( pid, ppid,   

[SQL] running scripts like oracle sqlplus

2010-06-21 Thread Steven Dahlin
I have been trying to figure out how I can run a pgsql script like I can run a plsql script with oracle's sqlplus. Here is a sample script file for what I want to run: declare sysuserid integer := 0; hwcustid integer := 0; begin select nextval( 'user_seq' ) into sysuserid; select nextval(

[SQL] error on line 1 trying to execute a script using psql

2010-06-21 Thread Steven Dahlin
I am attempting to generate a temporary function to execute some dml with the following script: create or replace function setuplicense() returns integer as $$ declare hwcustid integer := 0; retvalinteger := 0; begin insert into license.customer ( customer_id ) values ( hwcustid );

[SQL] nvl() function

2001-10-17 Thread Steven Dahlin
I am trying to find the equivalent in Postgresql to the Oracle sql function nvl(). With nvl() you give two parameters. The first may be a field/column or variable. If the value is not null then it is returned by the function. For example the with query below if the :ClientParameter is passed th