pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Difference
3+ messages / 3 participants
[nested] [flat]

* Difference
@ 2006-01-09 06:18 Minal A. Aryamane <minalac@yes2etl.com>
  2006-01-09 07:17 ` Re: Difference Tom Lane <tgl@sss.pgh.pa.us>
  2006-01-09 14:33 ` Re: Difference Campbell, Greg <greg.campbell@us.michelin.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Minal A. Aryamane @ 2006-01-09 06:18 UTC (permalink / raw)
  To: pgsql-odbc

Can anyone tell me why the same function tried on POSTGRESQL 7.4 works but does nor work on POSTGRESQL 8.0. Is there any difference in the way POSTGRES handles functions in version 8.0

CREATE OR REPLACE FUNCTION sp_delete_course()
  RETURNS text AS
'
Declare
COURSEID VARCHAR(20); 
NEWCOURSEID VARCHAR(20);
SET NEWCOURSEID = ''ARC'' + COURSEID;

INSERT INTO ARCHIVE_ETL..COURSEMASTER SELECT * FROM COURSEMASTER WHERE COURSEID = COURSEID;
INSERT INTO ARCHIVE_ETL..TOPICS SELECT * FROM TOPICS WHERE COURSEID = COURSEID;
INSERT INTO ARCHIVE_ETL..COURSESENROLLED SELECT *  FROM COURSESENROLLED WHERE COURSEID = COURSEID;
INSERT INTO ARCHIVE_ETL..SKILLS SELECT * FROM SKILLS WHERE COURSEID = COURSEID;
INSERT INTO ARCHIVE_ETL..REGISTER SELECT R.ID,R.STUDENTID,R.FNAME,R.MNAME,R.LNAME,R.ADDRESS,R.CITY,R.STATE,R.PINCODE,R.TEL,R.EMAIL,R.DOB,R.SEX,R.RELIGION,R.NATIONALITY,R.LANGUAGEK,R.PROFESSION,R.QUALIFICATION,R.EXPERIENCE,R.COMPANYNAME,R.SPECIALITY,R.PASSWORD,R.ENROLLDATE,R.CARDID FROM REGISTER R INNER JOIN COURSESENROLLED C ON R.STUDENTID=C.STUDENTID AND R.FNAME=C.STUDENTNAME WHERE C.COURSEID=COURSEID
             INSERT INTO ARCHIVE_ETL..TRAINERMASTER SELECT T.INSTRUCTORID,T.TITE,T.FIRSTNAME,T.LASTNAME,T.DESIGNATION,T.QUALIFICATION,T.ADDRESS,T.TEL,T.EMAILID,T.PASSWORD FROM TRAINERMASTER T INNER JOIN SKILLS S ON T.INSTRUCTORID=S.INSTRUCTORID WHERE S.COURSEID = COURSEID
UPDATE ARCHIVE_ETL..COURSEMASTER SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
UPDATE ARCHIVE_ETL..TOPICS SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
UPDATE ARCHIVE_ETL..COURSESENROLLED SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
UPDATE ARCHIVE_ETL..SKILLS SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
DELETE COURSEMASTER WHERE COURSEID = COURSEID
DELETE TOPICS WHERE COURSEID = COURSEID
DELETE COURSESENROLLED WHERE COURSEID = COURSEID
DELETE SKILLS WHERE COURSEID = COURSEID
'
  LANGUAGE 'plpgsql' VOLATILE;

I get the following error...
ERROR:  type "newcourseid" does not exist
CONTEXT:  compile of PL/pgSQL function "sp_delete_course" near line 4

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

* Re: Difference
  2006-01-09 06:18 Difference Minal A. Aryamane <minalac@yes2etl.com>
@ 2006-01-09 07:17 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

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

"Minal A. Aryamane" <minalac@yes2etl.com> writes:
> Can anyone tell me why the same function tried on POSTGRESQL 7.4 works =
> but does nor work on POSTGRESQL 8.0. Is there any difference in the way =
> POSTGRES handles functions in version 8.0

There are some ... but the code you show would not have worked in *any*
release of PG.  It's certainly missing a BEGIN, and "SET" is not the
syntax for assigning to a local plpgsql variable, and quite a few
semicolons are obviously missing, and you didn't bother to return any
result value.

Could we have an unedited transcription of both the function source code
and the error message, please?

			regards, tom lane



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

* Re: Difference
  2006-01-09 06:18 Difference Minal A. Aryamane <minalac@yes2etl.com>
@ 2006-01-09 14:33 ` Campbell, Greg <greg.campbell@us.michelin.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Campbell, Greg @ 2006-01-09 14:33 UTC (permalink / raw)
  To: pgsql-odbc

Is this an ODBC question? This might be a better question for the pgsql-general mailing list.

That said, perhaps you should use pgAdmin to cut the definition out of 7.4 database, and apply it to the 
8.0 database.


Minal A. Aryamane wrote:

> Can anyone tell me why the same function tried on POSTGRESQL 7.4 works but does nor work on POSTGRESQL 8.0. Is there any difference in the way POSTGRES handles functions in version 8.0
> 
> CREATE OR REPLACE FUNCTION sp_delete_course()
>   RETURNS text AS
> '
> Declare
> COURSEID VARCHAR(20); 
> NEWCOURSEID VARCHAR(20);
> SET NEWCOURSEID = ''ARC'' + COURSEID;
> 
> INSERT INTO ARCHIVE_ETL..COURSEMASTER SELECT * FROM COURSEMASTER WHERE COURSEID = COURSEID;
> INSERT INTO ARCHIVE_ETL..TOPICS SELECT * FROM TOPICS WHERE COURSEID = COURSEID;
> INSERT INTO ARCHIVE_ETL..COURSESENROLLED SELECT *  FROM COURSESENROLLED WHERE COURSEID = COURSEID;
> INSERT INTO ARCHIVE_ETL..SKILLS SELECT * FROM SKILLS WHERE COURSEID = COURSEID;
> INSERT INTO ARCHIVE_ETL..REGISTER SELECT R.ID,R.STUDENTID,R.FNAME,R.MNAME,R.LNAME,R.ADDRESS,R.CITY,R.STATE,R.PINCODE,R.TEL,R.EMAIL,R.DOB,R.SEX,R.RELIGION,R.NATIONALITY,R.LANGUAGEK,R.PROFESSION,R.QUALIFICATION,R.EXPERIENCE,R.COMPANYNAME,R.SPECIALITY,R.PASSWORD,R.ENROLLDATE,R.CARDID FROM REGISTER R INNER JOIN COURSESENROLLED C ON R.STUDENTID=C.STUDENTID AND R.FNAME=C.STUDENTNAME WHERE C.COURSEID=COURSEID
>              INSERT INTO ARCHIVE_ETL..TRAINERMASTER SELECT T.INSTRUCTORID,T.TITE,T.FIRSTNAME,T.LASTNAME,T.DESIGNATION,T.QUALIFICATION,T.ADDRESS,T.TEL,T.EMAILID,T.PASSWORD FROM TRAINERMASTER T INNER JOIN SKILLS S ON T.INSTRUCTORID=S.INSTRUCTORID WHERE S.COURSEID = COURSEID
> UPDATE ARCHIVE_ETL..COURSEMASTER SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
> UPDATE ARCHIVE_ETL..TOPICS SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
> UPDATE ARCHIVE_ETL..COURSESENROLLED SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
> UPDATE ARCHIVE_ETL..SKILLS SET COURSEID = NEWCOURSEID WHERE COURSEID = COURSEID
> DELETE COURSEMASTER WHERE COURSEID = COURSEID
> DELETE TOPICS WHERE COURSEID = COURSEID
> DELETE COURSESENROLLED WHERE COURSEID = COURSEID
> DELETE SKILLS WHERE COURSEID = COURSEID
> '
>   LANGUAGE 'plpgsql' VOLATILE;
> 
> I get the following error...
> ERROR:  type "newcourseid" does not exist
> CONTEXT:  compile of PL/pgSQL function "sp_delete_course" near line 4
> 
> 
> 
> 

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] 3+ messages in thread


end of thread, other threads:[~2006-01-09 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-09 06:18 Difference Minal A. Aryamane <minalac@yes2etl.com>
2006-01-09 07:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-01-09 14:33 ` Campbell, Greg <greg.campbell@us.michelin.com>

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