Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Unhappy Unanswered: I cant create a function

    Hi.

    I'm a newby with Informix. I'm trying to create a funcion, but always recieve the same error from dbaccess; "201: A syntax error has occurred". The problem is that I have cut-and-paste a simple function from the official "Informix Guide to SQL.pdf" and recieve the same message. I also tryed putting the text in a file.sql and use the CREATE FUNCTION FROM statement in DBACCESS with the same discouraging result. Apparently I am doing something wrong, but I can't guess what it is

    Thank you in advance.

  2. #2
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    183
    Please post the function the forum.

    Greetings,

    Rob Prop

  3. #3
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    183
    You could also try the following function that should work:

    CREATE FUNCTION testfunc(mynumber int) RETURNING int;
    RETURN mynamber * 2;
    END FUNCTION;

    If this fails try the following:

    CREATE PROCEDURE testfunc(mynumber int) RETURNING int;
    RETURN mynamber * 2;
    END PROCEDURE;

    If only the second one succeeds then you are using a version 7 of IDS where the FUNCTIONS are not implemented, but as you can see a lot of functionality can be used by specifying PROCEDURE.

    Hope this helps,

    Rob Prop

  4. #4
    Join Date
    Apr 2004
    Posts
    2
    OK, that's the answer; I'm using Informix 7.2


    Thank you very much

Posting Permissions

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