Using the -i or -n params from the go command to assign the value of one column to different variables does not seem to work.
Examples: (# - denotes an output line in FS, the rest are input lines)
DROP TABLE IF EXISTS test_table /
CREATE TABLE test_table (`col one` VARCHAR(20)) /
INSERT INTO test_table VALUES ('one') /
declare test_var1=val1
declare test_var2=val2
SELECT * FROM test_table
go -i test_var1=1 -i test_var2=1
declare -p test_var1 test_var2
declare test_var1=val1
declare test_var2=val2
SELECT * FROM test_table
go -n test_var1='col one' -n test_var2='col one'
declare -p test_var1 test_var2
Tested on both ADS 12.0.15 and ADS 13 RC1 using both MySQL and SQLite, in all the cases the behavior is as above.
Current implementation does not support 1-N mapping, we will add support for this in 12.0 and later versions.
Mapping column index/name to different variables now is supported:
SVN r31083/r31084 - 12.0 branch
SVN r31085 - 13.0 branch
SVN r31086 - trunk
The following validations are added:
(1) These cases will generate a warning:
go -i var_1=1 -i var_1=1
==> go: 'var_1=1': Duplicated VARIABLE_NAME=COLUMN_INDEX, ignored
go -n var_1=clm_1 -n var_1=clm_1
or
go -n var_1=clm_1 -n var_1=CLm_1
==> go: 'var_1=CLm_1': Duplicated VARIABLE_NAME=COLUMN_NAME, ignored
(2) These cases will throw an exception and query won't be executed:
go -i var_1=1 -i var_1=2
==> go: 'var_1=2': Conflict column indexes, variable 'var_1' has been assigned to column index '1'
go -n var_1=clm_1 -n var_1=clm_2
==> go: 'var_1=clm_2': Conflict column names, variable 'var_1' has been assigned to column name 'clm_1'
Conflict between -i and -n options has been taken care of in the previous implementation:
go -i var_1=1 -n var_1=clm_3
No message generated, please see NOTES section of \go man page for details.
Mapping column index/name to different variables now is supported:
SVN r31083/r31084 - 12.0 branch
SVN r31085 - 13.0 branch
SVN r31086 - trunk
The following validations are added:
(1) These cases will generate a warning:
go -i var_1=1 -i var_1=1
==> go: 'var_1=1': Duplicated VARIABLE_NAME=COLUMN_INDEX, ignored
go -n var_1=clm_1 -n var_1=clm_1
or
go -n var_1=clm_1 -n var_1=CLm_1
==> go: 'var_1=CLm_1': Duplicated VARIABLE_NAME=COLUMN_NAME, ignored
(2) These cases will throw an exception and query won't be executed:
go -i var_1=1 -i var_1=2
==> go: 'var_1=2': Conflict column indexes, variable 'var_1' has been assigned to column index '1'
go -n var_1=clm_1 -n var_1=clm_2
==> go: 'var_1=clm_2': Conflict column names, variable 'var_1' has been assigned to column name 'clm_1'
Conflict between -i and -n options has been taken care of in the previous implementation:
go -i var_1=1 -n var_1=clm_3
No message generated, please see NOTES section of \go man page for details.
Verified using ADStudio 12.0.15-9 & 14 Dev 8, mapping to different vars is now supported. Also added regression tests for the additional changes.
Closed.
Verified using ADStudio 12.0.15-9 & 14 Dev 8, mapping to different vars is now supported. Also added regression tests for the additional changes.
Closed.
Issue #8244 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 12.0/r31083-84,13.0/r31085,trunk/r31086 |
No time estimate |
Current implementation does not support 1-N mapping, we will add support for this in 12.0 and later versions.