cancel
Showing results for 
Search instead for 
Did you mean: 

Strange errors when using user defined function in where clause

silke_arnswald
Discoverer
0 Kudos

Hello,

I am having trouble with a function that, when used in the where clause of a select will cause an error if the first column selected is of type INTEGER. Not sure whether I am doing something wrong or whether this is a bug.

Here is a very simple test case:

create table test(

col1 integer not null,

col2 varchar(20) ascii default ''

)

insert into test values(1,'2011-03-15 05:00:00')

insert into test values(2,'2011-03-15 07:00:00')

CREATE FUNCTION BTR_TAG RETURNS VARCHAR AS

VAR ret VARCHAR(20);

SET ret='2011-03-15 06:00:00';

RETURN ret;

Select * from test where col2 >= BTR_TAG()

Select col1,col2 from test where col2 >= BTR_TAG()

=> Error in assignment;-3016 POS(1) Invalid numeric constant

Select '',* from test where col2 >= BTR_TAG()

Select col2,col1 from test where col2 >= BTR_TAG()

=> works as it should

MaxDB V 7.7.07.16 running on Windows Server 2003

I can replicated the test case above with Sql Studio and other ODBC based tools.

Thanks in advance,

Silke Arnswald

Accepted Solutions (1)

Accepted Solutions (1)

steffen_schildberg
Active Participant
0 Kudos

Hi Silke,

the error is found and will be corrected with the next version. You can track the error correction progress using this link: [http://maxdb.sap.com/webpts?wptsdetail=yes&ErrorType=0&ErrorID=1238472] (but be aware that you'll find the link working correctly only tomorrow because the error database is only once per day replicated at 11:30 pm).

Best regards,

Steffen

silke_arnswald
Discoverer
0 Kudos

Hi Steffen,

thanks for the quick answer.

Silke Arnswald

Answers (2)

Answers (2)

steffen_schildberg
Active Participant
0 Kudos

Hi Silke,

we were able to reproduce the error but do not have a solution yet. As soon as we have one I will get back to you. Sorry for any inconvenience.

Best regards,

Steffen

sivakumar_kilari3
Active Contributor
0 Kudos

This is not right forum to posting this question.

You are from which module or working any 3rd party application.

thanks

Siva

-> note from Moderator:

This is the right forum for posting this question, in fact the question is perfectly legitimate.

Siva please do not keep people from posting here.

Thank you for your understanding,

Thorsten Zielke

Edited by: Thorsten Zielke on Mar 16, 2011 1:29 PM

silke_arnswald
Discoverer
0 Kudos

Hello Siva,

sorry, but I don't understand your reply:

This is not right forum to posting this question.

You are from which module or working any 3rd party application.

MaxDB 7.7.07.16 is the community version of MaxDb,

we are not using it for SAP

and no 3rd party software is required to reproduce my problem,

Sql Studio or Database Studio will do.

Regards,

Silke Arnswald