Step 0: Macro Inputs
Data Table Input
Data
D
a
1.2
b
2.5
c
3.6
Text Input (26)
Data to Push to Database
Connection Input
Connection
C
sqlconnection
Text Input (36)
Connection Name
Macro Output
In-DB Output
O
Output Query In-DB
Query Detail Output
Q
Output Query Details
Calculate SQL Query Length
count=REGEX_CountMatches([sql_final], ".")
Return Query, Connection and Query Length to User
Execute Query
Error
connection
sql_final
Simple
'__rowcount'
!=
__RowCount
`'__rowcount'` != '__RowCount'
After executing the SQL statement remove the headers as the first line of data and remove the index column to output only the table data In-DB.
Step1: Generate Values SQL Query from Table Data
1
__RowCount
Int64
0
Get Field Names for In-DB Query Field Names
,
Names2=[Name]
The Dynamic Input In-DB Tool takes the first row of data to determine the column names. This section determines the field names and adds that as the first row of data so that they pass to In-DB as the field names.
Convert Table into Values Query
RecordID
sql_lines
V_String
30000
NULL
Formatting for Values as rows and columns
if IsNull([Row-1:RecordID])
then
if [RecordID] != [Row+1:Rec...
RecordID
sql_comb
V_String
30000
Empty
[Row-1:sql_comb]+[sql_lines]
Generate SQL Values Statement
[Row-1:sql_comb]+[sql_lines]
Last
1
Last 1
Final SQL with Syntax
sql_final="select * from (values " + [sql_comb] + ") tbl"
All
if IsString([_CurrentField_])
then "'" + [_CurrentField_] + "'"
else
if IsNumber([_CurrentField_])
then ToString([_CurrentField_])
else "NULL"
endif
endif
SQL String/Number Format
if IsString([_CurrentField_])
then "'" + [_CurrentField_] + "...
1
RecordID
Int32
0
Warn
Warning
All
ByName
#2
#1
The section adds the proper syntax and formatting for the SQL query to convert the table data into a SQL values statement.
Horizontal
Question
Macro Input (53)
Question
Macro Input (54)
Question
Macro Output In-DB (55)
Question
Macro Output (60)
In-DB Values Query
Tab
Questions
Tab (52)
MacroInput
Text Input (36)
Text Input (36)
MacroInput
Text Input (26)
Text Input (26)
LockInMacroOutput
Macro Output In-DB (55)
Macro Output In-DB (55)
MacroOutput
Macro Output (60)
Macro Output (60)
Macro