Search Postgresql Archives

Re: Function error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sachin Srivastava wrote:
> I am getting the below error for function, please see the bold line in "Function code", please suggest
> what I will do to correct this code.
> 
>  -----------------------
> 
> ERROR:  syntax error at or near "*"
> LINE 35: SELECT * from logError(msg text) is
>                 ^
> CONTEXT:  invalid type name "* from logError(msg text) is

That error message does not look like it could come from the
function definition below, but the function definition is clearly
syntactically incorrect:

> CREATE OR REPLACE FUNCTION cp_property_room_count_trans(
>     subscriberid bigint,
>     incompanyid bigint,
>     loginname text)
>   RETURNS void AS
> $BODY$
> DECLARE

[...]

>   SELECT logError(v_errorMesg text, procedureName text, subscriberID bigint, companyID bigint,
> supplierSku text, loginName text) is
> 
> BEGIN
>      insert into SMERROR_LOG
>      (error_message, method_name, system_message, error_log_id, subscriber_id, company_id,
> creation_date, creation_user, update_date, update_user)
>      values(v_errorMesg, procedureName, supplierSku, nextval('smerror_log_sequence'), subscriberID,
> companyID, LOCALTIMESTAMP, loginName, LOCALTIMESTAMP, 'V7Admin');
>   end;

You cannot declare a function inside the DECLARE section of
another function.  Besides, what is "SELECT logError" supposed to mean?

You will have to declare each of the helper functions with ist own
CREATE FUNCTION statement.

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux