473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

function runs on Windows not on solaris

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=curre nt_date(),license_status=1 WHERE license_key=licKey;
END IF;
RETURN 0;
END
' LANGUAGE 'plpgsql';

Error:

MYDB# select p_MapLicKeyToAccount('1B5D892169812C6F','t******** @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!
Nov 23 '05 #1
1 1066
suraj mundada <su**********@yahoo.com> writes:
UPDATE db_license_tab SET account_id=accountId,license_anniversarydate=curre nt_date(),license_status=1 WHERE license_key=licKey; ERROR: parser: parse error at or near "(" at character 80


I believe CURRENT_DATE is supposed to be called without parentheses.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
4
by: Hal Halloway | last post by:
can mysql work in Windows but not Solaris? Is there any reason you can see why the fulltext php/mysql code below works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when put on a...
1
by: Putz Ronald | last post by:
Hy! We got the same datamodell on Solaris and on WindowsXP. But there is a mojor difference in the Performance. The database on Windows is much faster than the one on Solaris although the...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
9
by: daniel | last post by:
Hi everyone, I'm trying to get this program compiled under Solaris. Unfortunately I have little experience with C. Solaris doesn't use the function strsep() anymore: char *strsep(char...
21
by: Joakim Hove | last post by:
Hello, I have implemented a small library with a function a datatype to manage temporary storage, and handle out correctly casted storage. The function to get a double pointer is for instance: ...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
31
by: rkk | last post by:
Hi, I've written a small trim function to trim away the whitespaces in a given string. It works well with solaris forte cc compiler, but on mingw/cygwin gcc it isn't. Here is the code: char...
23
by: nsa.usa | last post by:
Hi, I used to use a function in other languages (TP or asm don't remember) where I could get number of clockticks since 1980. Is there a similar function in C? I don't seem to find it. I need...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.