Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

UDF error - IQ 15.4

3 posts in General Discussion Last posting was on 2012-05-10 04:33:22.0Z
PS Posted on 2012-04-26 13:36:14.0Z
Sender: 71e.4f994c2f.1804289383@sybase.com
From: PS
Newsgroups: sybase.public.iq
Subject: UDF error - IQ 15.4
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4f994f4e.780.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 26 Apr 2012 06:36:14 -0700
X-Trace: forums-1-dub 1335447374 172.20.134.41 (26 Apr 2012 06:36:14 -0700)
X-Original-Trace: 26 Apr 2012 06:36:14 -0700, 172.20.134.41
Lines: 100
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4495
Article PK: 246634

I'm new to UDFs, but i believe this should work. I'm trying
to run a V4 scalar UDF in IQ 15.4 replicating the my_plus
example in the UDF guide (code below) but get the following
error:

Could not execute statement. Version 'V4' interface used by
external function call 'addsq' is not supported for
execution in the current context. SQLCODE=-818, ODBC 3
State="HY000"

I'm running IQ express edition on Windows 7


Note that I had to make some adjustments, for example in the
guide the program included extfnapiv3.h instead of
extfnapiv4.h.


// Test64.cpp

#include "extfnapiv4.h"

extern "C" __declspec(dllexport) a_sql_uint32
extfn_use_new_api(void)
{
return EXTFN_V4_API;
}



static void my_plus_evaluate(a_v3_extfn_scalar_context
*cntxt, void *arg_handle) {

// declare variables
an_extfn_value arg;
an_extfn_value outval;
a_sql_int32 arg1, arg2, result;

// Get first argument
(void) cntxt->get_value( arg_handle, 1, &arg );
if (arg.data == NULL)
{
return;
}
arg1 = *((a_sql_int32 *)arg.data);


// Get second argument
(void) cntxt->get_value( arg_handle, 2, &arg );
if (arg.data == NULL)
{
return;
}
arg2 = *((a_sql_int32 *)arg.data);

// Set the result value
outval.type = DT_INT;
outval.piece_len = sizeof(a_sql_int32);
result = ( arg1 + arg2 ) * 2;
outval.data = &result;
cntxt->set_value( arg_handle, &outval, 0 );

}



static a_v3_extfn_scalar my_plus_descriptor = {
0,
0,
&my_plus_evaluate,
0, // Reserved - initialize to NULL
0, // Reserved - initialize to NULL
0, // Reserved - initialize to NULL
0, // Reserved - initialize to NULL
0, // Reserved - initialize to NULL
NULL // _for_server_internal_use
};




extern "C" __declspec(dllexport) a_v3_extfn_scalar
*my_plus(void)
{
return &my_plus_descriptor;
}


And the function:

CREATE OR REPLACE FUNCTION addsq ( IN arg1 INT, IN arg2 INT
)
RETURNS INT
DETERMINISTIC
IGNORE NULL VALUES
EXTERNAL NAME 'my_plus@Test64.dll';

Any thoughts will be greatly appretiated

Thanks


PS Posted on 2012-04-29 10:53:05.0Z
Sender: 247d.4f9d1c0c.1804289383@sybase.com
From: PS
Newsgroups: sybase.public.iq
Subject: Issue with license allowed/not allowed in IQ express edition
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4f9d1d91.24a8.1681692777@sybase.com>
References: <4f994f4e.780.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 29 Apr 2012 03:53:05 -0700
X-Trace: forums-1-dub 1335696785 172.20.134.41 (29 Apr 2012 03:53:05 -0700)
X-Original-Trace: 29 Apr 2012 03:53:05 -0700, 172.20.134.41
Lines: 28
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4496
Article PK: 246636

I think I may have found the issue, is developing UDFs in IQ
express edition allowed/not allowed? only V3 vs. V4? only
internal vs external? I found the text below in the IQ
license.pdf document, optional features section.


InDatabase Analytics Option
The InDatabase Analytics Option is a newlicense type that
enables customers to build, deploy
and run their own C/C++ User-Defined Functions (UDF). Unlike
previous releases, this
option is available to all Sybase IQ customers and no longer
requires Sybase certification.
The InDatabase Analytics Option includes a newIQ_IDAlicense
that will function as both the
InDatabase Analytics Option and Partner Solutions license.
Although customers can purchase
the InDatabase Analytics Options to enable V4 UDF support,
this license restricts runtime
execution on MultiPlex reader nodes.
Sybase will continue to support the current Partner
Solutions IQ_UDF license, which is
required for existing V3 C/C++ libraries. There will be no
change in server runtime behavior
for this license. Partners can obtain a copy of the new
InDatabase Analytics Option and the
library authentication method from Sybase without cost.


Mark Posted on 2012-05-10 04:33:22.0Z
Sender: 2c2c.4fab4440.1804289383@sybase.com
From: Mark
Newsgroups: sybase.public.iq
Subject: I have the same issue can anyone explain this license option?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fab4512.2c58.1681692777@sybase.com>
References: <4f9d1d91.24a8.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 9 May 2012 21:33:22 -0700
X-Trace: forums-1-dub 1336624402 172.20.134.41 (9 May 2012 21:33:22 -0700)
X-Original-Trace: 9 May 2012 21:33:22 -0700, 172.20.134.41
Lines: 27
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4503
Article PK: 246641


> I think I may have found the issue, is developing UDFs in
> IQ express edition allowed/not allowed? only V3 vs. V4?
> only internal vs external? I found the text below in the
> IQ license.pdf document, optional features section.
>
>
> InDatabase Analytics Option
> The InDatabase Analytics Option is a newlicense type that
> enables customers to build, deploy
> and run their own C/C++ User-Defined Functions (UDF).
> Unlike previous releases, this
> option is available to all Sybase IQ customers and no
> longer requires Sybase certification.
> The InDatabase Analytics Option includes a
> newIQ_IDAlicense that will function as both the
> InDatabase Analytics Option and Partner Solutions license.
> Although customers can purchase
> the InDatabase Analytics Options to enable V4 UDF support,
> this license restricts runtime
> execution on MultiPlex reader nodes.
> Sybase will continue to support the current Partner
> Solutions IQ_UDF license, which is
> required for existing V3 C/C++ libraries. There will be no
> change in server runtime behavior
> for this license. Partners can obtain a copy of the new
> InDatabase Analytics Option and the
> library authentication method from Sybase without cost.