Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Posts
    1

    Unanswered: Hello everyone, urgently need help related to UDF

    I have a function written in postgresql that I want to create in sql server (UDF). After effort of full day I am seding this request to please help me, here is the function:

    CREATE OR REPLACE FUNCTION fn_comma_env(int4)
    RETURNS text AS
    $BODY$
    DECLARE
    rec record;
    str text;
    comstr text;
    BEGIN
    str := '';
    comstr := '';
    FOR rec IN SELECT class.classname FROM hostenv, class WHERE hostenv.classid = class.classid AND (hostenv.hostid = $1) LOOP
    str := str || comstr || rec.classname;
    comstr := ',';
    END LOOP;
    RETURN str;
    END;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE;

    Thanks in advance,
    Syed

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •