Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
t_vijay_qlik
Contributor III
Contributor III

Re:Sql

Hi all,

how sql queries are used while connecting to any database

Thanks

Vijay

1 Solution

Accepted Solutions
balabhaskarqlik

First of all, you have to create the connection (use the panel below the script mode). Then, LOAD the attributes and you can do the SQL query. The structure is like this one:

OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=xxxx;Data Source=xxxx;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=xxx;Use Encryption for Data=False;Tag with column collation when possible=False];

ABC:

LOAD*;

SQL SELECT *

FROM "YOUR_TABLE";

Example 2:

OLEDB CONNECT TO [Provider=...........=""] (XPassword is XXXXXXXXXXXXXXXXXXXXXXXXXXXXX);

BCD:

Load *;

SQL SELECT NLFDSTATIONNR,

    SSTATIONBEZ

FROM QSYS.STATION;

Join

SQL SELECT

    NLFDSTATIONNR ,

    DTTSPROBE,

    SZUSINFO1

FROM QSYS.STICHPROBE

where SZUSINFO1='590129204B232P';

View solution in original post

1 Reply
balabhaskarqlik

First of all, you have to create the connection (use the panel below the script mode). Then, LOAD the attributes and you can do the SQL query. The structure is like this one:

OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=xxxx;Data Source=xxxx;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=xxx;Use Encryption for Data=False;Tag with column collation when possible=False];

ABC:

LOAD*;

SQL SELECT *

FROM "YOUR_TABLE";

Example 2:

OLEDB CONNECT TO [Provider=...........=""] (XPassword is XXXXXXXXXXXXXXXXXXXXXXXXXXXXX);

BCD:

Load *;

SQL SELECT NLFDSTATIONNR,

    SSTATIONBEZ

FROM QSYS.STATION;

Join

SQL SELECT

    NLFDSTATIONNR ,

    DTTSPROBE,

    SZUSINFO1

FROM QSYS.STICHPROBE

where SZUSINFO1='590129204B232P';