Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
how sql queries are used while connecting to any database
Thanks
Vijay
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';
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';