helpinghand
search
needassistance
 

What Do You Get?

Example Statements and Validation Output

Here we would like to give you some examples of how you can use Mimer SQL-99 Validator, not only to check how your SQL conforms to the current SQL standard, but also how you can use Mimer SQL-99 Validator to check whether your statements are syntactically correct.

So, what happens if you just click 'Test SQL'?

Of course, if you don't enter anything, it's a syntax error. Mimer SQL-99 Validator says so and then lists possible input.

 

What happens if you make a spelling mistake (let's face it, it happens sometimes)?

For example, you type SELEC instead of SELECT, Validator will tell you it's wrong, and give you the correct spelling.


SELEC	* 
FROM	t
WHER	c = 0

 

What if you know something is Core SQL, but you want to know what level it was in SQL-92?

Just enter your statement in Mimer SQL-92 Validator, click the button and hey presto, you know exactly which level it conforms to.


SELECT	* 
FROM	t	
WHERE	c + d IS NOT NULL

 

But can Validator distinguish between features outside Core SQL?

Yes indeed it can. Validator identifies the following as: X001 a Mimer SQL extension and F491 a Constraint management feature.
(BTW, this Mimer SQL extension will become a feature in the next SQL standard, known at the moment as SQL-200x.)


CREATE TABLE t (c BIGINT CONSTRAINT c_gt_0 CHECK(c > 0))

 

What about complex SQL statements? Can Validator handle them?

Of course, Validator can handle complex and long statements.


SELECT t1.col1,
       t1.col2,
       UPPER(t1.col2) AS s_order,
       COUNT(t2.col1) + COUNT(t3.col1) AS col_count
FROM   firsttable t1
       LEFT OUTER JOIN secondtable t2
       ON t1.col1 = t2.col2
       LEFT OUTER JOIN thirdtable t3
       ON t1.col1 = t3.col3
GROUP  BY t1.col1,t1.col2
ORDER  BY s_order

 

Want to see if your stored procedures (SQL/PSM) pass the conformity test, or see if you've made a mistake when coding?

Just enter your stored procedure, click the button and you've got answer.


CREATE PROCEDURE lend_book(IN  plibcard CHAR(10),
                           IN  pbooktag CHAR(10),
                           OUT rstatus  VARCHAR(12))
MODIFIES SQL DATA
BEGIN
    IF EXISTS(SELECT *
              FROM   loan
              WHERE  booktag = pbooktag) THEN
        CALL return_book(pbooktag);
    END IF;
    IF NOT EXISTS(SELECT *
                  FROM   borrower
                  WHERE  libcard = plibcard) THEN
        SET rstatus = 'Invalid card';
    ELSEIF NOT EXISTS(SELECT *
                      FROM   book
                      WHERE  booktag = pbooktag) THEN
        SET rstatus = 'Invalid book';
    ELSE
        INSERT INTO loan(libcard,
                         booktag,
                         date_of_loan,
                         end_date)
                  VALUES(plibcard,
                         pbooktag,
                         CURRENT_DATE,
                         CURRENT_DATE + INTERVAL '21' DAY);
        SET rstatus = 'OK';
    END IF;
END

 

 

 

Powered by Mimer SQL

Powered by Mimer SQL