SQL
The
SQL option represents the
query as a Structured Query Language (SQL) string.
This option cannot be changed by the user. Any changes must be made in the source.
The apostrophe (')
is the delimitation character for any SQL statement. It must appear
at the beginning and end of every line of SQL.
The maximum number of characters on any line is 256.
The syntax is as follows:
SQL' string [string...]' Example
The following represents the SQL for the Main IQD data source:
SQL 'select T1."ORDER_DT" as c1,' 'T2."PROD_NO" as c2, T1."REP_NO" as c3,''T1.
"CUST_NO" as c4, T2."QTY" as c5,''(T2."QTY" * T2."PRI' 'CE") as c6,''
(T2."QTY" * T3."PROD_COST") as c7,''(CASE ''WHEN ((((T2."QTY" * T2."PRICE")-''
(T2."QTY" * T3."PROD_COST"))/(T2."QTY" * ''T2."PRICE"))
<= 0.19) ''THEN ("'Under 20%')''WHEN ((((T2."QTY" * T2."PRICE") - ''
(T2."QTY" * T3."PROD_COST")) / ''(T2."QTY" * T2."PRICE")) BETWEEN 0.2
AND ' '0.65)''THEN ("'20% - 65%')''WHEN ((((T2."QTY" * T2."PRICE") - ''
(T2."QTY" * T3."PROD_COST"))''/ (T2."QTY" * T2."PRICE")) >= 0.66)
''THEN (' "'Over 65%')''ELSE ('ERROR')''END) as c10 from "ORDER"
T1,''("PRODUCT" T3 left outer join "ORDRDETL" T2 ''on T2."PROD_NO" =
T3."PROD_NO") where''(T2."ORDER_NO" = T1."ORDER_NO")''order by
c1 asc,c3 asc,c4 asc,c2 asc'