Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    21

    Unanswered: IDS 11.7 - CREATE FUNCTION not working

    I'm trying to create a function, but keep receiving the below...

    -201 A syntax error has occurred

    I should at least be able to run the below, but can't.

    CREATE FUNCTION sales_check() RETURNING INT;
    END FUNCTION;


    I have two users that are granted dba privileges and below is what dbschema shows. I've tried both dba accounts and neither work.
    DBSCHEMA Schema Utility INFORMIX-SQL Version 11.70.UC1
    grant dba to "informix";

    revoke usage on language SPL from public ;
    grant usage on language SPL to public ;

    No permissions for user informix.


    I will gladly offer more info if I missed anything. Any help would be greatly appreciated.

  2. #2
    Join Date
    Nov 2011
    Posts
    4
    Quote Originally Posted by skisalomon77 View Post
    I'm trying to create a function, but keep receiving the below...

    -201 A syntax error has occurred

    I should at least be able to run the below, but can't.

    CREATE FUNCTION sales_check() RETURNING INT;
    END FUNCTION;


    I have two users that are granted dba privileges and below is what dbschema shows. I've tried both dba accounts and neither work.
    DBSCHEMA Schema Utility INFORMIX-SQL Version 11.70.UC1
    grant dba to "informix";

    revoke usage on language SPL from public ;
    grant usage on language SPL to public ;

    No permissions for user informix.


    I will gladly offer more info if I missed anything. Any help would be greatly appreciated.
    It works on my db - one thing I noticed it that you are specifying that your function returns something but you don't return (although I noticed this does not stop my db from accepting the function) maybe just an idea.

  3. #3
    Join Date
    May 2008
    Posts
    21
    Thanks for the reply!

    I just figured it out. I had to apply the below to my two DBA accounts and it worked.

    grant usage on language SPL to root as root;
    grant usage on language SPL to informix as informix;

    My vendor contact who did our implementation didn't get back to me yet, so I started playing around until it worked.

  4. #4
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Hi Skisalomon,

    just for your info, this is not a normal situation. Grant usage on language SPL to public is the default setting.

    Someone must have revoked those permissions even for informix, which is not good and dangerous ( some functionality should stop working).

    the root user is a normal user for informix, and is not considered as any super user like role.

    Hope this helps

    Eric

Posting Permissions

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