X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 797749DC8A3 for ; Mon, 9 Jan 2006 13:48:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43067-03 for ; Mon, 9 Jan 2006 13:48:40 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by postgresql.org (Postfix) with ESMTP id 337619DC896 for ; Mon, 9 Jan 2006 13:48:38 -0400 (AST) Received: by wproxy.gmail.com with SMTP id i28so2681095wra for ; Mon, 09 Jan 2006 09:48:38 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=anbU3MwvxK4F2PQX0fDjO2TfVluEn5bTXl+FnmWHWEciT0LjweFawh4okzpkgldNTJGr8sGDCJ23goUYEUQtXIbdy6VpeBqkpaf0quzpWlFavwAuT2jYIrx+Mbz7XCgZQLRJQC6gIZLdTuSDQTXb5ro6h6WhStaIgnu38sA1C74= Received: by 10.54.86.5 with SMTP id j5mr3401234wrb; Mon, 09 Jan 2006 09:48:38 -0800 (PST) Received: by 10.54.92.14 with HTTP; Mon, 9 Jan 2006 09:48:38 -0800 (PST) Message-ID: Date: Mon, 9 Jan 2006 12:48:38 -0500 From: Jaime Casanova To: pgsql-jdbc@postgresql.org, Jacques Gollion Subject: Fwd: [BUGS] BUG #2139: Problem when calling functions without any argument In-Reply-To: <43C2508B.1F505985@sambatechnologies.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_17306_21483877.1136828918177" References: <20060103112745.BB6CEF0AC6@svr2.postgresql.org> <43C2508B.1F505985@sambatechnologies.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.082 required=5 tests=[AWL=0.082] X-Spam-Score: 0.082 X-Spam-Level: X-Archive-Number: 200601/33 X-Sequence-Number: 14484 ------=_Part_17306_21483877.1136828918177 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ---------- Forwarded message ---------- From: Jacques Gollion Date: Jan 9, 2006 7:01 AM Subject: Re: [BUGS] BUG #2139: Problem when calling functions without any argument To: Jaime Casanova Cc: pgsql-bugs@postgresql.org hello Jaime, Sorry. I forgot to provide you with the information. Please find the function and the trace of jdbc calls in the enclosed file. Thank you in advance for your help. Jacques Jaime Casanova a =E9crit : > On 1/3/06, Jacques Gollion wrote: > > > > The following bug has been logged online: > > > > Bug reference: 2139 > > Logged by: Jacques Gollion > > Email address: jgollion@sambatechnologies.com > > PostgreSQL version: 8.1.1 > > Operating system: Windows 2000 > > Description: Problem when calling functions without any argument > > Details: > > > > have have written some functions without any argument. When my powerbui= lder > > V9 application calls these functions, the behaviour is different : > > > > *Using ODBC driver, it works well > > *Using JDBC driver (I tried several versions), I get the error message > > "ERROR : Syntax error at or near $1. If I add a unused argument to the > > function; it works. > > If I call in JDBC the same function for Oracle or Sybase, it works. > > If I call other PostGreSQL functions with arguments, it works. > > > > Where am I wrong ? > > > > Thanks in advance for your help. > > > > and... where is the function? how is defined? how do you use it? > > code, please wiyhout that you can't expect any help... > well. this looks like an specific jdbc issue so i will redirect you to that list... maybe a little info about the table and the sequence and maybe the actual code where this error is happening can be of hlp... -- regards, Jaime Casanova (DBA: DataBase Aniquilator ;) ------=_Part_17306_21483877.1136828918177 Content-Type: application/x-unknown-content-type-txtfile; name=Information.log Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Information.log" -- Behaviour ============ Using JDBC driver (I tried several versions), I get the error message "ERROR : Syntax error at or near $1. Using ODBC driver, it works well If I add a unused argument to the function : it works. If I call in JDBC the same function for Oracle or Sybase, it works. If I call other PostGreSQL functions with arguments and using JDBC , it works. --This is the function ===================== CREATE OR REPLACE FUNCTION newstudyid() RETURNS int4 AS $BODY$ DECLARE nNewId_l integer; begin nNewId_l = nextval('SEQ_STUDY'); return nNewId_l; end; $BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION newstudyid() OWNER TO postgres; GRANT EXECUTE ON FUNCTION newstudyid() TO public; GRANT EXECUTE ON FUNCTION newstudyid() TO postgres; GRANT EXECUTE ON FUNCTION newstudyid() TO client; GRANT EXECUTE ON FUNCTION newstudyid() TO batch; This is the trace of calls ========================== DriverManager.getConnection("jdbc:postgresql://isabelle/pdb2000") trying driver[className=org.postgresql.Driver,org.postgresql.Driver@82f0db] getConnection returning driver[className=org.postgresql.Driver,org.postgresql.Driver@82f0db] Java PbjdbcCommand::GetRowSet No ResultSet Java PbjdbcCommand::GetRowSet No ResultSet org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:339) at com.sybase.powerbuilder.jdbc.PbjdbcCommand.Execute(PbjdbcCommand.java:1497) SQLException: SQLState(42601) Java PbjdbcCommand::Execute SQLException thrown ------->SQLState = 42601 ------->ErrorCode = 0 ------->Message = ERROR: syntax error at or near "$1" ------=_Part_17306_21483877.1136828918177--