Page 1 of 1

Functions in Stored procedures aere sometimes read displayed

Posted: Mon 31 Aug 2009 09:37
by jkuiper
Some functions in my stored procedures are highlited red. Does it means the function does not exists. It's still compiling, but I don't see the result of the function.

Posted: Tue 01 Sep 2009 11:49
by Alexz
Could you, please, send us some information:
* screenshots that describe this problem or DDL text of your procedure
* full MySQL server version
* full version of dbForge Studio for MySQL.

If this information is confidential or is very large, you can send it to our support center at http://www.devart.com/dbforge/mysql/studio/support.html .

Posted: Wed 02 Sep 2009 11:58
by jkuiper
I did some tests and I was wrong about some functions. All it's works except CONVERT() and CAST(), but typecasting does MySQL by itself. The only thing I find strange is some function are displayed red.
example:

Code: Select all

PROCEDURE casten()
BEGIN

  DECLARE kostnr CHAR(2);
  DECLARE datum CHAR (10) DEFAULT '2009-08-30';
  DECLARE intkostnr INT;
  DECLARE dtDatum DATE;
  DECLARE jaar, difdays INT;
  DECLARE strjaar CHAR(4);
  DECLARE l_april8_char CHAR(10);
  DECLARE l_april8 DATE;

  SET kostnr = '2';
  SET intkostnr = kostnr;
  SET dtDatum = STR_TO_DATE(datum,'%Y-%m-%d'); /*function STR_TO_DATE is red */
  SET jaar = YEAR(now()) - 1; /*function NOW is red and function YEAR is blue */
  SET strjaar = jaar;
  SET l_april8_char = CONCAT(strjaar,'-04-07'); /*function CONCAT is red */
  SET l_april8 = STR_TO_DATE(l_april8_char,'%Y-%m-%d'); /*function STR_TO_DATE is red */
  SET difdays = DATEDIFF(NOW(),l_april8);  /*function DATEDIFF and NOW is red */
  SELECT kostnr, intkostnr,dtDatum, strjaar, l_april8, difdays;
I'm using version 3.6x

Posted: Wed 02 Sep 2009 12:54
by olegf
STR_TO_DATE is highlighted by the red color because this color was chosen for highlighting built-in functions (Tools -> Options -> Text Editor -> Fonts & Colors). YEAR is highlighted by the blue color because this word is used not only as a built-in function, but also as a keyword in certain SQL statements.

Errors in SQL documents are underlined by a wavy line only.

Posted: Thu 03 Sep 2009 11:11
by jkuiper
Okay, thanks.