Please Help: Unable to compile Stored Procedure

Database
Enthusiast

Please Help: Unable to compile Stored Procedure

Hello All,

I have the simple SP below, and I'm unable to compile
from sql assistant or bteq. I keep getting an error:
'5863: Problem encountered during compilation phase of C code.'

CREATE PROCEDURE subset_and_search(IN prequery VARCHAR(250), IN postquery VARCHAR(250), IN subquery VARCHAR(250), IN doclist VARCHAR(250) )

BEGIN
DECLARE subqueryLeng INTEGER DEFAULT 0;

SET subqueryLeng = character_length(subquery);

IF subqueryLeng > 1 THEN
insert into pete_log values (:subquery, date, :subqueryLeng);
END IF;
END;

Notes:
1)I can compile Simple SPs with a Single Insert or Update statement and
0-n number of parameters. It's not a permissions thing.
2)If I replace the SET above, with ' select character_length(subquery) into subqueryLeng; '
AND ALSO remove the IF and END IF lines, the SP will compile.

Is there some environment issue?

pete_log is defined as 'Create table pete_log(pNote VARCHAR(50), pDate date, pNum INTEGER)'

Thanks in advance. I'm really stuck until I can do more with an SP than
just a single statement.
3 REPLIES

Re: Please Help: Unable to compile Stored Procedure

Hello Wpaven,
I really do not know what could be the issue with 'ur environment. I just cut && paste your code in SQL assistant and I was able to compile it. So, there's nothing wrong with your code. As you suspected, it could be something with your environment......

Cheers,
Godfrey Nang'oma
Enthusiast

Re: Please Help: Unable to compile Stored Procedure

Hey, Thanks for the reply.
Yes, I found the error 5683 in the installation manual .pdf.
It's related to a missing library. Unfortunately the manual
doesn't say which library is missing, but we have some help with this now
from TD. Once we get the env. issues resolved I'll post the solution.
Enthusiast

Re: Please Help: Unable to compile Stored Procedure

Ok, turns out it's the version of the compiler
we had visual studio 6.0 installed with V2R6.1.1.0.
Turns out that TD version requires visual studio 7.0.
I'm up and running now.