cancel
Showing results for 
Search instead for 
Did you mean: 

enable clr integration for stored proc and functions

g_g_99
Participant
4,188

when I execute from sa 11 build 2960 interactive sql: START EXTERNAL ENVIRONMENT CLR; I get

-------------------------------
         SQL ERROR
-------------------------------
Could not exec statement
External environment 'CLR' not found
SQLCODE=-, ODBC 3 State="HY000"
Line 1, column 28
----------------------------------
START EXTERNAL ENVIRONMENT CLR
----------------------------------

I do have C:\\Program Files\\SQL Anywhere 11\\Bin64 and C:\\Program Files\\SQL Anywhere 11\\Bin32 the required assembly files: dbextclr11.exe,dbextenv11.dll, dbexternc11.exe, dbextf.dll

what should I do to enable clr integration so I can use clr dll functions and methods in my stored proc?

btw - I saw the article in doc exchange for sa 12 for testing if eternal env but not for sa 11 - when I tried to execute by doublicking in windows 8 explorer the dbextclr11.exe - I get a DOS windows then

[Window Title]
iAnywhere.SAClrClassLoader

[Main Instruction]
Do you want to automatically send more information about unsolved problems?

[Content]
Sending information can help Microsoft create solutions.  To see what types of information Windows can send, read our privacy statement online.

[Yes, send more information automatically (recommended)] [No, ask me each time]

If I go debug, I get

System.IndexOutOfRangeException was unhandled
  Message="Index was outside the bounds of the array."
  Source="dbextclr11"
  StackTrace:
       at iAnywhere.SAClrMain.Main(String[] args)
  InnerException: 

I also tried the windows 8 compatibility wizard,Still get the same error

the file version of dbextclr11.exe is 11.0.1.29602, date modified 2013-13-25 2:03Pm Size 49.8KB

Accepted Solutions (0)

Answers (1)

Answers (1)

g_g_99
Participant

answer my own question a few hours after searching, the hint for the External environments are not supported for this database SQLCODE=-1206 found in http://infocenter.sybase.com/help/topic/com.sybase.help.sqlanywhere.11.0.1/PDF/saerrors_en11.pdf

I backup the database and upgrade, voila I got no error from START EXTERNAL ENVIRONMENT CLR

So in summary, the following steps can be applied to trouble shoot problem:

  1. if one have trouble creating clr external proc or function, try START EXTERNAL ENVIRONMENT CLR
  2. if that fails, try alter external environment CLR location 'bin32dbextclr11';
  3. if the error message is "the database does not support external environment", close off all windows and process for sql anywhere except for the Sybase central. use the upgrade tool to upgrade the database
  4. if other error make sure the dbextclr11.exe is in a directory in the path
  5. Note for Sql anywhere 12, use dbextclr12 instead