Toad World® Forums

Generated join condition contains syntax error

All,

This relates to Toad for Oracle, Beta 13.0.0.12

I’m writing a join - the tables have multiple matching key columns.
After the ON I type the first alias, then hit Ctrl-T.
In the pop-up list I select the entire list of predefined equal conditions.
All the required comparisons are generated - which is fine and saves me a lot of typing (Thanks!)

But - they are generated as a comma-separated list.
So I have to go over it and change every comma into an AND.

I think it makes sense (in this context at least) to generate an AND-separated list rather than a comma-separated one.

Does this make sense, or am I missing some drawback or other complication?

Thanks in advance for your opinions.

Kind regards,
Abe Kornelis

Sample code:


– COAGREEHEAD (Table)

CREATE TABLE COAGREEHEAD
(
CUSTNO VARCHAR2(7 CHAR) NOT NULL,
AGREETYPE VARCHAR2(2 CHAR) NOT NULL,
COCLASS VARCHAR2(2 CHAR) NOT NULL,
BUUNIT VARCHAR2(3 CHAR) NOT NULL,
COMPNO NUMBER(2) NOT NULL,
CURRENCY VARCHAR2(3 CHAR) NOT NULL,
COOBJ NUMBER(3) NOT NULL,
CUSTDISC VARCHAR2(8 CHAR) NOT NULL,
SEQNO NUMBER(3) NOT NULL,
AGREEDESC VARCHAR2(30 CHAR),
PRICECODEAH VARCHAR2(2 CHAR),
EMPLOYNO VARCHAR2(5 CHAR) NOT NULL,
STOCKNO NUMBER(3) NOT NULL,
FROMDATE DATE,
TODATE DATE,
PRCHANGECD VARCHAR2(1 CHAR),
COSALESPGMID VARCHAR2(8 CHAR),
COAGREEALLOWMOD VARCHAR2(1 CHAR),
SHIPBEFORE DATE
);


– COAGREEHEAD_PK (Index)

CREATE UNIQUE INDEX COAGREEHEAD_PK ON COAGREEHEAD
(CUSTNO, AGREETYPE, COCLASS, BUUNIT, COMPNO,
CURRENCY, COOBJ, CUSTDISC, SEQNO);


– COAGREELINE (Table)

CREATE TABLE COAGREELINE
(
CUSTNO VARCHAR2(7 CHAR) NOT NULL,
AGREETYPE VARCHAR2(2 CHAR) NOT NULL,
COCLASS VARCHAR2(2 CHAR) NOT NULL,
BUUNIT VARCHAR2(3 CHAR) NOT NULL,
COMPNO NUMBER(2) NOT NULL,
CURRENCY VARCHAR2(3 CHAR) NOT NULL,
COOBJ NUMBER(3) NOT NULL,
CUSTDISC VARCHAR2(8 CHAR) NOT NULL,
SEQNO NUMBER(3) NOT NULL,
LINENO NUMBER(4) NOT NULL,
PARTNO VARCHAR2(20 CHAR),
CLASS1 VARCHAR2(2 CHAR),
CLASS2 VARCHAR2(3 CHAR),
CLASS3 VARCHAR2(4 CHAR),
CLASS4 VARCHAR2(4 CHAR),
CLASS6 VARCHAR2(4 CHAR),
AGREEDEF NUMBER(1) NOT NULL,
AGREEVALUE NUMBER(22,7) NOT NULL,
QTYDISCCD VARCHAR2(1 CHAR),
COSALESPGMID VARCHAR2(8 CHAR),
UNITPRICE VARCHAR2(3 CHAR)
);


– COAGREELINE_PK (Index)

CREATE UNIQUE INDEX COAGREELINE_PK ON COAGREELINE
(CUSTNO, AGREETYPE, COCLASS, BUUNIT, COMPNO,
CURRENCY, COOBJ, CUSTDISC, SEQNO, LINENO);


– Test statement for generating ON clause

select * from coagreehead a join coagreeline b on a. – Hit Ctrl-T to bring up list with suggested clauses

Thanks, Abe. This has been logged.

Michael

This will be fixed in next beta. Join conditions are concatenated using “AND” in upper/lower/camel case as set in your formatter options.

Michael

Thanks for the update. And a happy new year to you!

Abe