If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > I cant create a function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-04, 14:47
cereixo cereixo is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
Unhappy 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.
Reply With Quote
  #2 (permalink)  
Old 04-05-04, 16:08
RobP RobP is offline
Registered User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 183
Please post the function the forum.

Greetings,

Rob Prop
Reply With Quote
  #3 (permalink)  
Old 04-05-04, 16:13
RobP RobP is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 04-09-04, 14:13
cereixo cereixo is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
OK, that's the answer; I'm using Informix 7.2


Thank you very much
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On