Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Problems with f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3424 of 3559
Post > Topic >>

Problems with function while migrating from Windows to Linux

by petersjan@[EMAIL PROTECTED] ("Jan Peters") Apr 22, 2008 at 11:47 AM

Hello list,
after developping my application in a Windows environment I am now
migrating to the production Linux webserver. I backed up my database,
functions and schemas and im****ted them again via pgAdmin III, because the
first application which I used to do the transfer did not move the variable
aliases within the function. So what I have (what is running under Windows)
is:

function: 

getgv_neu(id int4, tablename text, runde1 int4, runde2 int4) returns int4:

--------------------8<----------------------------

DECLARE
tablename1 varchar := quote_ident(tablename);
result_aktiva integer;
result_passiva integer;
sum integer;
BEGIN
EXECUTE 'SELECT getaktiva(' || id|| ',' || runde1 || ',' || runde2 || ')
;' INTO result_aktiva;
if result_aktiva < -100000 THEN
RETURN result_aktiva;
END IF;
EXECUTE 'SELECT getpassiva(\'' || tablename1 || '\',' || id || ');' INTO
result_passiva;
sum = result_aktiva - result_passiva;
RETURN sum;
END;


--------------------8<----------------------------

when I do e.g. a "select getgv_neu(5,'company_5',1,0)" I get the error
message:

ERROR:  syntax error at or near "$4" at character 81
QUERY:  SELECT  'SELECT getaktiva(' ||  $1 || ',' ||  $2  || ',' ||  $3 
|| ') ;' INTO  $4
CONTEXT:  PL/pgSQL function "getgv_neu" line 7 at execute statement

What might be the problem here? Any ideas? I am stuck...

Thanks again in advance

Jan Peters-Anders



-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@[EMAIL
PROTECTED]
 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 2 Posts in Topic:
Problems with function while migrating from Windows to Linux
petersjan@[EMAIL PROTECTE  2008-04-22 11:47:27 
Re: Problems with function while migrating from Windows to
craig@[EMAIL PROTECTED]   2008-04-22 20:30:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 20:15:12 CDT 2008.