pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Stored Procedures
14+ messages / 12 participants
[nested] [flat]

* Stored Procedures
@ 2002-01-31 15:40 Satish Reddy <satish@eventmonitor.com>
  0 siblings, 0 replies; 14+ messages in thread

From: Satish Reddy @ 2002-01-31 15:40 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,
    Does anyone here tried Stored Procedures with Postgresql. 

-satish

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: Stored Procedures
@ 2002-01-31 15:51 Kovács Péter <peter.kovacs@sysdata.siemens.hu>
  0 siblings, 0 replies; 14+ messages in thread

From: Kovács Péter @ 2002-01-31 15:51 UTC (permalink / raw)
  To: Satish Reddy <satish@eventmonitor.com>; pgsql-jdbc

PostgreSQL has no Stored Procudure. You can use User Defined Functions
instead.
 
Cheers
 
Peter
 
 -----Original Message-----
From: Satish Reddy [mailto:satish@eventmonitor.com]
Sent: Thursday, January 31, 2002 4:40 PM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Stored Procedures



Hi,
    Does anyone here tried Stored Procedures with Postgresql. 
 
-satish




^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Stored procedures
@ 2002-08-19 12:41 Felipe Schnack <felipes@ritterdosreis.br>
  2002-08-19 13:17 ` Re: Stored procedures Dave Cramer <Dave@micro-automation.net>
  0 siblings, 1 reply; 14+ messages in thread

From: Felipe Schnack @ 2002-08-19 12:41 UTC (permalink / raw)
  To: pgsql-jdbc

  I know that if I want to return resultsets from stored procedures in
PgSQL I should return REFCURSOR return type. But this doesn't return
updatable resultsets. How can I do that?
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328




^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: Stored procedures
  2002-08-19 12:41 Stored procedures Felipe Schnack <felipes@ritterdosreis.br>
@ 2002-08-19 13:17 ` Dave Cramer <Dave@micro-automation.net>
  2002-08-19 13:29   ` Re: Stored procedures Felipe Schnack <felipes@ritterdosreis.br>
  0 siblings, 1 reply; 14+ messages in thread

From: Dave Cramer @ 2002-08-19 13:17 UTC (permalink / raw)
  To: Felipe Schnack <felipes@ritterdosreis.br>; +Cc: pgsql-jdbc

Felipe,

Only the dev driver on http://jdbc.postgresql.org supports updateable
result sets.

Dave
On Mon, 2002-08-19 at 08:41, Felipe Schnack wrote:
>   I know that if I want to return resultsets from stored procedures in
> PgSQL I should return REFCURSOR return type. But this doesn't return
> updatable resultsets. How can I do that?
> -- 
> 
> Felipe Schnack
> Analista de Sistemas
> felipes@ritterdosreis.br
> Cel.: (51)91287530
> Linux Counter #281893
> 
> Faculdade Ritter dos Reis
> www.ritterdosreis.br
> felipes@ritterdosreis.br
> Fone/Fax.: (51)32303328
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 
> 






^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: Stored procedures
  2002-08-19 12:41 Stored procedures Felipe Schnack <felipes@ritterdosreis.br>
  2002-08-19 13:17 ` Re: Stored procedures Dave Cramer <Dave@micro-automation.net>
@ 2002-08-19 13:29   ` Felipe Schnack <felipes@ritterdosreis.br>
  0 siblings, 0 replies; 14+ messages in thread

From: Felipe Schnack @ 2002-08-19 13:29 UTC (permalink / raw)
  To: Dave Cramer <Dave@micro-automation.net>; +Cc: pgsql-jdbc

  I'm using it, but the result from a stored procedure isn't updatable
On Mon, 2002-08-19 at 10:17, Dave Cramer wrote:
> Felipe,
> 
> Only the dev driver on http://jdbc.postgresql.org supports updateable
> result sets.
> 
> Dave
> On Mon, 2002-08-19 at 08:41, Felipe Schnack wrote:
> >   I know that if I want to return resultsets from stored procedures in
> > PgSQL I should return REFCURSOR return type. But this doesn't return
> > updatable resultsets. How can I do that?
> > -- 
> > 
> > Felipe Schnack
> > Analista de Sistemas
> > felipes@ritterdosreis.br
> > Cel.: (51)91287530
> > Linux Counter #281893
> > 
> > Faculdade Ritter dos Reis
> > www.ritterdosreis.br
> > felipes@ritterdosreis.br
> > Fone/Fax.: (51)32303328
> > 
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> > 
> > http://www.postgresql.org/users-lounge/docs/faq.html
> > 
> > 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328




^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Stored procedures
@ 2003-10-03 05:47 Yolanda Phillips <yphillips@dlkconsulting.co.za>
  2003-10-03 12:11 ` Re: Stored procedures Robert Treat <xzilla@users.sourceforge.net>
  2003-10-03 14:46 ` Re: Stored procedures scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 2 replies; 14+ messages in thread

From: Yolanda Phillips @ 2003-10-03 05:47 UTC (permalink / raw)
  To: pgsql-jdbc

Good day,

I need help URGENTLY!!

I'm trying to compile a Stored Function that performs either an insert or an
update on a table. The function has 44 input parameters and returns an
integer. When compiling the function a get an error: 

ERROR: functions cannot have more than 32 arguments

I would just like someone to confirm this. Can a function only have 32 input
parameters? If so, I'd have to use Prepared Statements then.

Thank you in advance.



Sincerely,


Yolanda Phillips
Web Applications Developer

Attachments:

  winmail.dat (application/ms-tnef, 1.8K) download

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: Stored procedures
  2003-10-03 05:47 Stored procedures Yolanda Phillips <yphillips@dlkconsulting.co.za>
@ 2003-10-03 12:11 ` Robert Treat <xzilla@users.sourceforge.net>
  1 sibling, 0 replies; 14+ messages in thread

From: Robert Treat @ 2003-10-03 12:11 UTC (permalink / raw)
  To: Yolanda Phillips <yphillips@dlkconsulting.co.za>; +Cc: pgsql-jdbc

Yes, this is correct. You can increase the limit by recompiling, though
there a believed to be some performance issues associated with choosing
a limit higher than 32. search the mail archives for the specifics of
where you need to do this in the code.

Robert Treat 

On Fri, 2003-10-03 at 01:47, Yolanda Phillips wrote:
> Good day,
> 
> I need help URGENTLY!!
> 
> I'm trying to compile a Stored Function that performs either an insert
> or an
> update on a table. The function has 44 input parameters and returns an
> integer. When compiling the function a get an error: 
> 
> ERROR: functions cannot have more than 32 arguments
> 
> I would just like someone to confirm this. Can a function only have 32
> input
> parameters? If so, I'd have to use Prepared Statements then.
> 
> Thank you in advance.
> 
> 
> 
> Sincerely,
> 
> 
> Yolanda Phillips
> Web Applications Developer
> 
> 
> 
> ----
> 

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL




^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: Stored procedures
  2003-10-03 05:47 Stored procedures Yolanda Phillips <yphillips@dlkconsulting.co.za>
@ 2003-10-03 14:46 ` scott.marlowe <scott.marlowe@ihs.com>
  1 sibling, 0 replies; 14+ messages in thread

From: scott.marlowe @ 2003-10-03 14:46 UTC (permalink / raw)
  To: Yolanda Phillips <yphillips@dlkconsulting.co.za>; +Cc: pgsql-jdbc

On Fri, 3 Oct 2003, Yolanda Phillips wrote:

> Good day,
> 
> I need help URGENTLY!!
> 
> I'm trying to compile a Stored Function that performs either an insert or an
> update on a table. The function has 44 input parameters and returns an
> integer. When compiling the function a get an error: 
> 
> ERROR: functions cannot have more than 32 arguments
> 
> I would just like someone to confirm this. Can a function only have 32 input
> parameters? If so, I'd have to use Prepared Statements then.

The 32 arg limit is a compile time / reinitdb parameter.  I.e. you can 
change it, but you'll have to first pg_dumpall your database, recompile 
postgresql with a different limit, and then restore your database to get 
more than 32 args.

But there are other ways around it, like passing a record type or array to 
the function.




^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Stored Procedures
@ 2006-01-16 08:33 Minal A. Aryamane <minalac@yes2etl.com>
  2006-01-16 08:54 ` Re: [ODBC] Stored Procedures Ludek Finstrle <luf@pzkagis.cz>
  2006-01-16 17:46 ` Re: [ODBC] Stored Procedures Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 14+ messages in thread

From: Minal A. Aryamane @ 2006-01-16 08:33 UTC (permalink / raw)
  To: pgsql-jdbc; +Cc: pgsql-odbc@postgresql.org

I am trying to pass values through  a jsp page wherein I am accessing this stored procedures by the following select ststemet

SELECT sp_build_course('ETLCRC0001:ETLCRC0010:', 'CRCSUB0001:CRCSUB0001:', 'ABC', 'minal' )

the function is as below:

CREATE OR REPLACE FUNCTION sp_build_course("varchar", "varchar", "varchar", "varchar")
  RETURNS text AS
'
Declare 
COURSEIDS VARCHAR(1000) ;
TOPICIDS VARCHAR(1000);
COURSENAME VARCHAR(150);
USERNAME VARCHAR(20);

COURSEIDS1 VARCHAR(1000); 
TOPICIDS1 VARCHAR(1000); 
COURSEID1 VARCHAR(20);
TOPICID1 VARCHAR(20);
NEWCOURSEID VARCHAR(20);
NEWTOPICID VARCHAR(20);
COLUMN1 VARCHAR(50);
COLUMN2 VARCHAR(50);
COLUMN3 VARCHAR(50);
COLUMN4 VARCHAR(50);
QCODE1 VARCHAR(10);
QDATE1 VARCHAR(10);
QSNO INTEGER;
WEIGHTAGE INTEGER;
QSTYPE VARCHAR(50);
QUESTION VARCHAR(1000);
MARKS VARCHAR(50);
QFLAG BOOL;
PFLAG BIT;
PAPER_TYPE VARCHAR(20);
CINDEX INTEGER;
TINDEX INTEGER;
INDEX INTEGER;
QINDEX INTEGER;
QUESTIONID INTEGER;
NEWQUESTIONID INTEGER;
LESSON_FLOW_TITLE VARCHAR(50);
TREE_NODE_TYPE VARCHAR(50);
VIDEO_SIZE INTEGER;
ROOT_NODE_ID INTEGER;
SLIDE_ORDER INTEGER;
row1 record;
row2 record;
row3 record;
COURSENAME1 varchar(150);
USERNAME1 varchar(50);

BEGIN
SET COURSEIDS1:=COURSEIDS;
SET TOPICIDS1:=TOPICIDS;
SET COURSENAME1:=COURSENAME;
SET USERNAME1:=USERNAME;

--PRINT \'INSIDE THE STORED PROCEDURE\'

COLUMN1 := DATE_PART(\'Day\',current_date);
COLUMN2 := DATE_PART(\'Month\',current_date);
COLUMN3 := DATE_PART(\'Year\',current_date);

IF LENGTH(COLUMN1) = 1 THEN
 COLUMN1 := \'0\' || COLUMN1;
END IF;
IF LENGTH(COLUMN2) = 1 THEN
 COLUMN2 := \'0\' || COLUMN2;
END IF;

QDATE1 := COLUMN1 || COLUMN2 || COLUMN3;

SELECT trim(to_char(max(to_number(QCODE,\'999999\'))+1,\'000009\')) INTO QCODE1 FROM QUESTION WHERE QDATE = QDATE1;

 WHILE  (LENGTH(QCODE1) < 6) LOOP
  QCODE1 := \'0\' || QCODE1;
 END LOOP;

SELECT MAX(SUBSTR(COURSEID,7,LENGTH(COURSEID))) INTO  NEWCOURSEID FROM COURSEMASTER;

 WHILE  (LENGTH(NEWCOURSEID) < 4) LOOP
  NEWCOURSEID := \'0\' || NEWCOURSEID;
 END LOOP;
  NEWCOURSEID := \'ETLCRC\' || NEWCOURSEID;
  INSERT INTO COURSEMASTER(COURSEID, COURSENAME) VALUES ( NEWCOURSEID,COURSENAME1);
  CINDEX := POSITION(\':\' IN COURSEIDS1);
  TINDEX := POSITION(\':\' IN TOPICIDS1);
  INDEX := 1;
 WHILE (CINDEX >  0) LOOP
  COURSEID1 := SUBSTR(COURSEIDS1,1,(CINDEX-1));
  TOPICID := SUBSTR(TOPICIDS1,1,(TINDEX-1));

 -- TRANSACTION STARTS HERE
  NEWTOPICID := INDEX;
   WHILE  (LENGTH(NEWTOPICID) < 4) LOOP
    NEWTOPICID := \'0\' || NEWTOPICID;
   END LOOP;
   NEWTOPICID := \'CRCSUB\' || NEWTOPICID;
   INSERT INTO MYTABLE6 VALUES(COURSEID1, TOPICID, NEWCOURSEID, NEWTOPICID);
   INSERT INTO TOPICS SELECT NEWCOURSEID, NEWTOPICID, TOPICNAME  FROM TOPICS WHERE COURSEID=COURSEID AND TOPICID=TOPICID;
   SELECT NULLIF(0,COUNT(*)) INTO COLUMN3 FROM LESSON_FLOW WHERE COURSEID=COURSEID AND TOPICID=TOPICID;
   COLUMN1 := COURSEID1 || \'_\' || TOPICID || \'_\';
   COLUMN2 := NEWCOURSEID || \'_\' || NEWTOPICID || \'_\';
   IF (COLUMN3 >0) THEN
    SELECT MAX(ATTACHMENT_ID) + 1 INTO COLUMN3 FROM COURSE_LESSON;
    INSERT INTO COURSE_LESSON(COURSEID1, TOPICID, RECORD_STATUS, ATTACHMENT_ID) VALUES (NEWCOURSEID, NEWTOPICID,0, CONVERT(INT, COLUMN3));
    INSERT INTO ATTACHMENT SELECT COLUMN3, COLUMN2 + SUBSTR(URL,23,LENGTH(URL)), SEQUENCE FROM ATTACHMENT WHERE SUBSTR(URL,0,23) = COLUMN1;
    SELECT MAX(LF_ID) + 1 INTO COLUMN4 FROM LESSON_FLOW;

    FOR row1 IN SELECT  LESSON_FLOW_TITLE, TREE_NODE_TYPE, VIDEO_SIZE, ROOT_NODE_ID, SLIDE_ORDER FROM LESSON_FLOW WHERE COURSEID=COURSEID AND TOPICID = TOPICID
    LOOP
     LESSON_FLOW_TITLE:=row1.LESSON_FLOW_TITLE;
     TREE_NODE_TYPE:=row1.TREE_NODE_TYPE;
     VIDEO_SIZE:=row1.VIDEO_SIZE;
     ROOT_NODE_ID:=row1.ROOT_NODE_ID;
     SLIDE_ORDER:=row1.SLIDE_ORDER;

     INSERT INTO LESSON_FLOW  VALUES (COLUMN4, NEWCOURSEID, NEWTOPICID, LESSON_FLOW_TITLE, TREE_NODE_TYPE, VIDEO_SIZE, COLUMN3, ROOT_NODE_ID, SLIDE_ORDER);
     COLUMN4 := COLUMN4 + 1;
     
    END LOOP;
    INSERT INTO SELECTEDSESSION SELECT NEWCOURSEID, NEWTOPICID, COLUMN2 + SUBSTR(URL,23,LENGTH(URL)) FROM SELECTEDSESSION WHERE COURSEID= COURSEID1 AND TOPICID= TOPICID;
   END IF;
   QINDEX := 1;
   
  FOR row2 IN SELECT QUESTION_ID, QSNO, WEIGHTAGE, QSTYPE, QUESTION, MARKS, FLAG,  PAPER_TYPE FROM QUESTION WHERE COURSEID=COURSEID AND TOPICID = TOPICID
  LOOP
   QUESTIONID:=row2.QUESTION_ID;
   QSNO:=row2.QSNO;
   WEIGHTAGE:=row2.WEIGHTAGE;
   QSTYPE:=row2.QSTYPE;
   QUESTION:=row2.QUESTION;
   MARKS:=row2.MARKS;
   QFLAG:=row2.FLAG;
   PAPER_TYPE:=row2.PAPER_TYPE;
   
   INSERT INTO QUESTION (COURSEID1, TOPICID, QSNO, WEIGHTAGE, QSTYPE, QUESTION, MARKS, QDATE, QCODE,FLAG, USERNAME, PAPER_TYPE) VALUES (NEWCOURSEID, NEWTOPICID, QINDEX, WEIGHTAGE, QSTYPE, QUESTION, MARKS, QDATE1, QCODE,QFLAG, USERNAME1, PAPER_TYPE);
   NEWQUESTIONID := IDENTITY;
   INSERT INTO OPTIONS SELECT NEWQUESTIONID, OPTIONS, CORRECTOPTION FROM OPTIONS WHERE QUESTION_ID=QUESTIONID;
   QCODE1 :=QCODE1 + 1;
   WHILE (LENGTH(QCODE1) < 6) LOOP
    QCODE1 := \'0\' || QCODE1;
   END LOOP;
   QINDEX := QINDEX + 1;   
  END LOOP;  
  QINDEX := 1;

  FOR row3 IN SELECT QUESTION_ID, QSNO,  QSTYPE, QUESTION, FLAG FROM POLL_QUESTION WHERE COURSEID=COURSEID AND TOPICID = TOPICID
  LOOP
   QUESTIONID:=row3.QUESTIONID;
   QSNO:=row3.QSNO;
   QSTYPE:=row3.QSTYPE;
   QUESTION:=row3.QUESTION;
   PFLAG:=row3.FLAG;   
    INSERT INTO POLL_QUESTION (COURSEID1, TOPICID, QSNO, QSTYPE, QUESTION, QDATE, QCODE,FLAG, USERNAME) VALUES (NEWCOURSEID, NEWTOPICID, QINDEX, QSTYPE, QUESTION, QDATE1, QCODE1,PFLAG, USERNAME1);
    NEWQUESTIONID := IDENTITY;
    INSERT INTO POLL_OPTIONS SELECT NEWQUESTIONID, OPTIONS, SUB_OPTIONS, TYPE,DISPLAY FROM POLL_OPTIONS WHERE QUESTION_ID=QUESTIONID;
    QCODE1 := QCODE1 + 1;
    WHILE  (LENGTH(QCODE1) < 6) loop
     QCODE1 := \'0\' || QCODE1;
    END LOOP;
    QINDEX := QINDEX + 1;
  END LOOP;

COURSEIDS1 := SUBSTR(COURSEIDS1,(CINDEX+1),LENGTH(COURSEIDS1));
TOPICIDS1 := SUBSTR(TOPICIDS1,(TINDEX+1),LENGTH(TOPICIDS1));
CINDEX := POSITION(\':\' IN COURSEIDS1);
TINDEX := POSITION(\':\' IN TOPICIDS1);
INDEX := INDEX + 1;

END LOOP;

RETURN \'1\';
END;

'
  LANGUAGE 'plpgsql' VOLATILE;

when I run it I get the following error:
ERROR:  syntax error at or near "$1" at character 6
CONTEXT:  PL/pgSQL function "sp_build_course" line 45 at SQL statement.

Can someone please look into the procedure and tell me where I have gone wrong.

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: [ODBC] Stored Procedures
  2006-01-16 08:33 Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
@ 2006-01-16 08:54 ` Ludek Finstrle <luf@pzkagis.cz>
  2006-01-16 09:48   ` Re: [ODBC] Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
  1 sibling, 1 reply; 14+ messages in thread

From: Ludek Finstrle @ 2006-01-16 08:54 UTC (permalink / raw)
  To: Minal A. Aryamane <minalac@yes2etl.com>; +Cc: pgsql-jdbc; pgsql-odbc@postgresql.org

Mon, Jan 16, 2006 at 02:03:48PM +0530, Minal A. Aryamane napsal(a):
> I am trying to pass values through  a jsp page wherein I am accessing
> this stored procedures by the following select ststemet

...

> when I run it I get the following error:
> ERROR:  syntax error at or near "$1" at character 6
> CONTEXT:  PL/pgSQL function "sp_build_course" line 45 at SQL statement.
> 
> Can someone please look into the procedure and tell me where I have
> gone wrong.

Are you sure you choose the right pgsql lists?
Does it work from psql command line client? If not it isn't odbc or jdbc
related.

Regards,

Luf



^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: [ODBC] Stored Procedures
  2006-01-16 08:33 Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
  2006-01-16 08:54 ` Re: [ODBC] Stored Procedures Ludek Finstrle <luf@pzkagis.cz>
@ 2006-01-16 09:48   ` Minal A. Aryamane <minalac@yes2etl.com>
  2006-01-16 15:19     ` Re: Stored Procedures Campbell, Greg <greg.campbell@us.michelin.com>
  2006-01-16 16:57     ` Re: [ODBC] Stored Procedures Markus Schaber <schabi@logix-tt.com>
  0 siblings, 2 replies; 14+ messages in thread

From: Minal A. Aryamane @ 2006-01-16 09:48 UTC (permalink / raw)
  To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-jdbc; pgsql-odbc@postgresql.org

I dont knoiw if I have got the right mailing list, I thought some one will
be able to help me in this regard..

----- Original Message -----
From: "Ludek Finstrle" <luf@pzkagis.cz>
To: "Minal A. Aryamane" <minalac@yes2etl.com>
Cc: <pgsql-jdbc@postgresql.org>; <pgsql-odbc@postgresql.org>
Sent: Monday, January 16, 2006 2:24 PM
Subject: Re: [ODBC] Stored Procedures


> Mon, Jan 16, 2006 at 02:03:48PM +0530, Minal A. Aryamane napsal(a):
> > I am trying to pass values through  a jsp page wherein I am accessing
> > this stored procedures by the following select ststemet
>
> ...
>
> > when I run it I get the following error:
> > ERROR:  syntax error at or near "$1" at character 6
> > CONTEXT:  PL/pgSQL function "sp_build_course" line 45 at SQL statement.
> >
> > Can someone please look into the procedure and tell me where I have
> > gone wrong.
>
> Are you sure you choose the right pgsql lists?
> Does it work from psql command line client? If not it isn't odbc or jdbc
> related.
>
> Regards,
>
> Luf




^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: Stored Procedures
  2006-01-16 08:33 Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
  2006-01-16 08:54 ` Re: [ODBC] Stored Procedures Ludek Finstrle <luf@pzkagis.cz>
  2006-01-16 09:48   ` Re: [ODBC] Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
@ 2006-01-16 15:19     ` Campbell, Greg <greg.campbell@us.michelin.com>
  1 sibling, 0 replies; 14+ messages in thread

From: Campbell, Greg @ 2006-01-16 15:19 UTC (permalink / raw)
  To: pgsql-odbc@postgresql.org

So, do you have access to the server command line to run psql and send commands? or pgAdmin? Does 
executing your stored procedure fail from there?

Ths directory of mailing lists is available at http://www.postgresql.org/community/lists/

You are probably needed to address pgsql-general.

That said, as a developer, I would tend to make a copy of the original, then comment out or rip out code 
until I find the problem.

BTW
your procedure definition looks strange
CREATE OR REPLACE FUNCTION sp_build_course("varchar", "varchar", "varchar", "varchar")
instead of
CREATE OR REPLACE FUNCTION sp_build_course(VARCHAR, VARCHAR, VARCHAR, VARCHAR)
Did pgAdmin build this?

You call a procedure with 4 varchar parameters, yet I do not see the points in the procedure where they 
are substituted in $1, $2, $3, $4. Why send parameters is they are not used?

You can read up on CREATE FUNCTION in the Postgresql docs. RTM, always a last resort.
Kindly advice. Start with something ridiculously simple, then build it from there.





Minal A. Aryamane wrote:
> I dont knoiw if I have got the right mailing list, I thought some one will
> be able to help me in this regard..
> 
> ----- Original Message -----
> From: "Ludek Finstrle" <luf@pzkagis.cz>
> To: "Minal A. Aryamane" <minalac@yes2etl.com>
> Cc: <pgsql-jdbc@postgresql.org>; <pgsql-odbc@postgresql.org>
> Sent: Monday, January 16, 2006 2:24 PM
> Subject: Re: [ODBC] Stored Procedures
> 
> 
> 
>>Mon, Jan 16, 2006 at 02:03:48PM +0530, Minal A. Aryamane napsal(a):
>>
>>>I am trying to pass values through  a jsp page wherein I am accessing
>>>this stored procedures by the following select ststemet
>>
>>...
>>
>>
>>>when I run it I get the following error:
>>>ERROR:  syntax error at or near "$1" at character 6
>>>CONTEXT:  PL/pgSQL function "sp_build_course" line 45 at SQL statement.
>>>
>>>Can someone please look into the procedure and tell me where I have
>>>gone wrong.
>>
>>Are you sure you choose the right pgsql lists?
>>Does it work from psql command line client? If not it isn't odbc or jdbc
>>related.
>>
>>Regards,
>>
>>Luf
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq

Attachments:

greg.campbell.vcf (text/x-vcard, 239B) download begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America - US5 Lexington;ENG-ASE email;internet:greg.campbell@us.michelin.com title:ASE Systems Engineer tel;work:803-951-5561/x75561 x-mozilla-html:FALSE version:2.1 end:vcard
^ permalink raw reply [nested|flat] 14+ messages in thread

* Re: [ODBC] Stored Procedures
  2006-01-16 08:33 Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
  2006-01-16 08:54 ` Re: [ODBC] Stored Procedures Ludek Finstrle <luf@pzkagis.cz>
  2006-01-16 09:48   ` Re: [ODBC] Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
@ 2006-01-16 16:57     ` Markus Schaber <schabi@logix-tt.com>
  1 sibling, 0 replies; 14+ messages in thread

From: Markus Schaber @ 2006-01-16 16:57 UTC (permalink / raw)
  To: Minal A. Aryamane <minalac@yes2etl.com>; +Cc: pgsql-jdbc; pgsql-odbc@postgresql.org

Hi, Minal,

Minal A. Aryamane wrote:
> I dont knoiw if I have got the right mailing list, I thought some one will
> be able to help me in this regard..

This is easy to decide:

If your SQL statements work via psql or other command line tools, but
fail when submittend via ODBC, use the pgsql-odbc@postgresql.org list.

If it works via psql, but fails via JDBC, use the
pgsql-jdbc@postgresql.org list.

If you use neither JDBC nor ODBC, or the query equally fails via psql,
try a list like pgsql-sql@postgresql.org.

When submitting your problem to an inappropriate list, there are less
people _capable_ to help, and less people _willing_ to help.

HTH,
Schabi

-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: [ODBC] Stored Procedures
  2006-01-16 08:33 Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
@ 2006-01-16 17:46 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 14+ messages in thread

From: Tom Lane @ 2006-01-16 17:46 UTC (permalink / raw)
  To: Minal A. Aryamane <minalac@yes2etl.com>; +Cc: pgsql-jdbc; pgsql-odbc@postgresql.org

"Minal A. Aryamane" <minalac@yes2etl.com> writes:
> the function is as below:
> ...
> SET COURSEIDS1:=COURSEIDS;
> ...

This is completely off-topic for both the lists you have chosen, but
I'd say the problem is that you must not use the SET keyword when
assigning to a plpgsql local variable.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 14+ messages in thread


end of thread, other threads:[~2006-01-16 17:46 UTC | newest]

Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-01-31 15:40 Stored Procedures Satish Reddy <satish@eventmonitor.com>
2002-01-31 15:51 Re: Stored Procedures Kovács Péter <peter.kovacs@sysdata.siemens.hu>
2002-08-19 12:41 Stored procedures Felipe Schnack <felipes@ritterdosreis.br>
2002-08-19 13:17 ` Re: Stored procedures Dave Cramer <Dave@micro-automation.net>
2002-08-19 13:29   ` Re: Stored procedures Felipe Schnack <felipes@ritterdosreis.br>
2003-10-03 05:47 Stored procedures Yolanda Phillips <yphillips@dlkconsulting.co.za>
2003-10-03 12:11 ` Re: Stored procedures Robert Treat <xzilla@users.sourceforge.net>
2003-10-03 14:46 ` Re: Stored procedures scott.marlowe <scott.marlowe@ihs.com>
2006-01-16 08:33 Stored Procedures Minal A. Aryamane <minalac@yes2etl.com>
2006-01-16 08:54 ` Ludek Finstrle <luf@pzkagis.cz>
2006-01-16 09:48   ` Minal A. Aryamane <minalac@yes2etl.com>
2006-01-16 15:19     ` Campbell, Greg <greg.campbell@us.michelin.com>
2006-01-16 16:57     ` Markus Schaber <schabi@logix-tt.com>
2006-01-16 17:46 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox