function runs on Windows not on solaris - Mailing list pgsql-general

From suraj mundada
Subject function runs on Windows not on solaris
Date
Msg-id 20040817054714.49039.qmail@web60307.mail.yahoo.com
Whole thread Raw
Responses Re: function runs on Windows not on solaris
List pgsql-general
Hi
 
I am using PostgreSQL 7.3.2 on Solaris 8 machine.
 
I have written following procedure for Windows ( testing purpose ) and solaris ( production ). It works well on windows but gives following error on solaris. Can anyone help me to find out what is the problem ?
 
 
 
CREATE OR REPLACE FUNCTION p_MapLicKeyToAccount(VARCHAR,VARCHAR) RETURNS INT4 AS '
DECLARE
 licKey ALIAS FOR $1;
 accountId ALIAS FOR $2;
 checkLicKey VARCHAR DEFAULT NULL;
 checkAcctId VARCHAR DEFAULT NULL;
BEGIN
 IF accountId ISNULL THEN
  RETURN 1;
 ELSE
  SELECT INTO checkLicKey license_key FROM db_license_tab WHERE license_key=licKey;
  
  IF checkLicKey ISNULL THEN
   RAISE NOTICE ''License Key % does not exists'',licKey;
   RETURN 2;
  END IF;
  
  SELECT INTO checkAcctId account_id FROM db_license_tab WHERE license_key=licKey;
  IF checkAcctId NOTNULL THEN
   RAISE NOTICE ''License Key % already used'',licKey;
   RETURN 3;
  END IF;
  
  checkAcctId = NULL;
  
  SELECT INTO checkAcctId account_id FROM db_acctmaster_tab WHERE account_id=accountId;
  
  IF checkAcctId NOTNULL THEN
   RAISE NOTICE ''Account id % already exists'',accountId;
   RETURN 4;  
  END IF;
  UPDATE db_license_tab SET account_id=accountId,license_anniversarydate=current_date(),license_status=1 WHERE license_key=licKey;
 END IF;
 RETURN 0;
END
' LANGUAGE 'plpgsql';
 
 
 
Error:
 
MYDB# select p_MapLicKeyToAccount('1B5D892169812C6F','testsuraj@max.com');
WARNING:  Error occurred while executing PL/pgSQL function p_maplickeytoaccount
WARNING:  line 36 at SQL statement
ERROR:  parser: parse error at or near "(" at character 80
 
Thanks & Regards,
 
Suraj
 
 
 


Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

pgsql-general by date:

Previous
From: "Igor Kryltsov"
Date:
Subject: Re: Problems using count() with a join - trying to format it better
Next
From: "Maurizio Merli"
Date:
Subject: PostgreSQL 8.0.0 - Win32 C-Language function how to?