Search code examples
sqlstored-proceduresstored-functionssap-iqsysobjects

Object type of function mistakenly displayed as 'P'-procedure in Sybase IQ


I'm trying to debug some custom code over Sybase IQ DB objects depending on object type. When I reached 'Function' type something strange happened.

Code below creates DB object of type 'P'-procedure instead of 'F'-function:

create function DBA.SomeFunc( @userId integer ) 
returns integer
as
begin
  return(10)
end

To check this assumption just look to type of object in 'sysobject' table. What am I doing wrong? Why does Sybase display function as procedure? How can i fix this?


Solution

  • The SQL Anywhere server (on which Sybase IQ is based) stores both procedures and functions with the same type in the ISYSOBJECT table. You are not doing anything wrong, and there is nothing to fix.

    Disclaimer: I work for SAP in SQL Anywhere engineering.