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 > IDS 11.7 - CREATE FUNCTION not working

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-17-11, 16:20
skisalomon77 skisalomon77 is offline
Registered User
 
Join Date: May 2008
Posts: 21
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.
Reply With Quote
  #2 (permalink)  
Old 11-18-11, 03:13
kelevra kelevra is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 11-18-11, 09:58
skisalomon77 skisalomon77 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 01-12-12, 08:23
begooden-it begooden-it is offline
Registered User
 
Join Date: Sep 2011
Location: Pont l'Abbé, Brittany, France
Posts: 183
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
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