Functions in Stored procedures aere sometimes read displayed

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Functions in Stored procedures aere sometimes read displayed

Post by jkuiper » Mon 31 Aug 2009 09:37

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.

Alexz
Devart Team
Posts: 165
Joined: Wed 10 Aug 2005 08:30

Post by Alexz » Tue 01 Sep 2009 11:49

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 .

jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Post by jkuiper » Wed 02 Sep 2009 11:58

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

olegf
Devart Team
Posts: 2
Joined: Fri 12 May 2006 15:17

Post by olegf » Wed 02 Sep 2009 12:54

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.

jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Post by jkuiper » Thu 03 Sep 2009 11:11

Okay, thanks.

Post Reply