When we show Analyse error in 99% of cases it means we couldn't tell to what table your column belongs to.

Here is an example:

SELECT STATUS
FROM
  ACCOUNTS A,
  CUSTOMER C,
WHERE
  A.CUST_ID = C.CUST_ID;

Such SQL statement cannot be successfully resolved without knowing table definitions. Nobody can tell whether column STATUS  belongs to table ACCOUNTS or CUSTOMERS .

Wait, it is a valid query. How come that SQL parser/analyser on my database resolves this successfully? 

Because it can do look ups to the database catalogue. With DDLs known for both tables we can resolve this as well.

How to overcome Analyse Error

You have actually two options:

  1. adjust your query so it uses fully qualified column names (like C.CUST_ID ) . In such case no DDLs are needed. 
  2. submit DDLs along with your statement

Here is an example:

CREATE TABLE ACCOUNTS ( CUST_ID NUMBER );
CREATE TABLE CUSTOMER ( CUST_ID NUMBER, STATUS CHAR(6) );

SELECT STATUS
FROM
  ACCOUNTS A,
  CUSTOMER C,
WHERE
  A.CUST_ID = C.CUST_ID;

Hints

  • use our Lionfish app to help you extract SQL scripts from you database. It also extracts database links, synonyms and other DDLs
  • most of our customers upload DDL for the whole database. No need to hand pick only those which are actually used in your queries

Notes

  • when you upload SQL code from a trial account we might assign tables to some columns randomly. This is to show how the visualisation looks like. Of course you are visibly notified about it and such columns are color coded
Did this answer your question?