cancel
Showing results for 
Search instead for 
Did you mean: 

Bug when using temporary tables and external name calls (CLR)

Former Member
0 Kudos
2,508

When a stored procedure using temporary table and external name calls to fill data inside the table is run there seems to be a bug which causes temporary tables to not be found at random times. Using SQL Anywhere 16. I've come up with a simple scenario, the bug seems to happen once every ten times for me.

Stored Procedure:

CREATE PROCEDURE "TestQuery"( ) 
on exception resume
begin
  create table #tempResults(
    "Text1" "text" null,
    "Text2" "text" null,
    "Text3" "text" null,
    "Text4" "text" null,
    );
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;
  insert into #tempResults values(ExternalFunction(), ExternalFunction(), ExternalFunction(), ExternalFunction()) ;

Select * from #tempResults end

External Name:

CREATE FUNCTION "ExternalFunction"() 
returns "text"
external name
'C:\\\\ExternalFunction.dll::ExternalFunction.ExternalFunctionClass.ExternalFunction() string' language "CLR"

External Function (C#):

namespace ExternalFunction
{
    public class ExternalFunctionClass
    {
        public static string ExternalFunction()
        {
            return "Hello World!";
        }
    }
}

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

Seems to be fixed in v16.0.0.2344