Make two commands: func_odbc-annotate and func_odbc-collapse.
The first one should convert this:
; somefunc is awesome
[SOMEFUNC]
readsql=SELECT id AS col1, 'hardcoded' AS col2 FROM table
into this:
; > ODBC_SOMEFUNC
; >
; > read return values: (1) col1, (2) col2
[SOMEFUNC]
readsql=SELECT id AS col1, 'hardcoded' AS col2
FROM table
and the second one should convert it back to:
; > ODBC_SOMEFUNC
; >
; > read return values: (1) col1, (2) col2
; somefunc is awesome
[SOMEFUNC]
readsql=SELECT id AS col1, 'hardcoded' AS col2 FROM table
This makes for easier editing of long SQL statements.
We have a partial implementation which right now spits out sql format:
[ACCOUNT_ZIPCODE]
;; ACCOUNT_ZIPCODE returns the zipcode for the account that is placing a call.
prefix=MY
readhandle=my_db
readsql=SELECT zip_code FROM account_account WHERE account_id = '${SQL_ESC(${ARG1})}'
becomes:
-- MY_ACCOUNT_ZIPCODE
-- .
-- FUNCTION TYPE: read
-- COLUMNS:
-- 1. zip_code
SELECT zip_code
FROM account_account
WHERE account_id = '${SQL_ESC(${ARG1})}';
Make two commands: func_odbc-annotate and func_odbc-collapse.
The first one should convert this:
into this:
and the second one should convert it back to:
This makes for easier editing of long SQL statements.
We have a partial implementation which right now spits out sql format:
becomes: