Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

loading two tables from ODBC and viewing in one table

Hi, I was trying to get data from two tables in db that I have connected through ODBC. not sure exactly how to do it because I was trying basic queries I learnt in db400.

ODBC CONNECT TO trial;

//-------- Start Multiple Select Statements ------

SQL SELECT *

FROM graphdata.`response_measured`;

//-------- End Multiple Select Statements ------

/*TARGET TABLE */

LOAD [setup],

    'Responsiveness' as Domain,

    [sku],

    [KPI],

    [target]

as [SQL SELECT *

FROM graphdata.`response_target`;]

AND I'm getting this error

Syntax error

Unexpected token: 'ODBC', expected one of: ',', 'AutoGenerate', 'From', 'From_Field', 'Inline', 'Resident', 'Where', ...

LOAD [setup],

    'Responsiveness' as Domain,

    [sku],

    [KPI],

    [target]

as [SQL SELECT *

FROM graphdata.`response_target`;]

///$tab Perf

>>>>>>ODBC<<<<<< CONNECT TO trial

please let me know where I'm going wrong

1 Solution

Accepted Solutions
stabben23
Partner - Master
Partner - Master

Try to remove the square brackets [ ] around the SQL Query, also delete 'as' infront of SQL...

View solution in original post

2 Replies
stabben23
Partner - Master
Partner - Master

Try to remove the square brackets [ ] around the SQL Query, also delete 'as' infront of SQL...

jonathandienst
Partner - Champion III
Partner - Champion III

This is your problem:

LOAD [setup],

    'Responsiveness' as Domain,

    [sku],

    [KPI],

    [target]

as [SQL SELECT *

FROM graphdata.`kbl_one_voice_responsiveness_target`;]

Remove the bold "as" and square brackets and add a semicolon after [target]

LOAD [setup],

    'Responsiveness' as Domain,

    [sku],

    [KPI],

    [target];

SQL SELECT *

FROM graphdata.`kbl_one_voice_responsiveness_target`;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein