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

problem in join multiple tables

Hi everyone

I wanna join my views in Qlikview but it shows error "OLEDB read failed" , Even though  i wrote them in SQL Server Management Studio and had no problem on it and showed the joined views correctly.

Here is my script :

OLEDB CONNECT32 TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=IT;Initial Catalog=MMTDB;Data Source=192.168.20.22;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=SEPASGOL;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is AAfMXREJUKTaEKNEDG);

Combined:

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

SQL SELECT

    VUnit.Active,

    VUnit.State,

    VUnit.UnitCode,

    VUnit.UnitType,

   

    VUser.father,

    VUser.FName,

    VUser.Id,

    VSick.SickTypeLatinName,

    VSick.SickTypeName,

    VSick.Skill,

    VSick.StartDateCourse,

    VSick.Tribe,

    VSick.UnitCityId,

    VSick.UnitCityName,

     VSick.UnitCode,

    VSick.UnitName,

    VSick.UnitType

FROM

    MMTDB.dbo.QVUnit                  as VUnit,

    MMTDB.dbo.QVUser                as VUser,

   MMTDB.dbo.QVSick                 as VSick

where    VUnit.UnitCode = VUser.UnitCode  

and    VUnit.UnitCode     = VSick.UnitCode;

I would appreciate if anyone can help.

1 Solution

Accepted Solutions
ziadm
Specialist
Specialist

These are possible reasons

1- passing few function in you SQL syntax that are not recognized by the OLEDB.

2- duplicate field names passed

3-Wrong field Names (they may look correct but few unseen charters).

I would suggest try to reduce the query to one filed and add one by one till you get the field that is causing the error for further investigation

View solution in original post

9 Replies
ecolomer
Master II
Master II

Try it in several steps:

1.- Load each of the tables separately

2.- Make the corresponding joins

Anonymous
Not applicable
Author

Hi Dear ecolomer

What's a corresponding join?

can you show me example on my case?

maxgro
MVP
MVP

try to comment the duplicated fields

     VSick.UnitCode,

    VSick.UnitType

ecolomer
Master II
Master II

Hi,

See this:

Anonymous
Not applicable
Author

Hi Dear Massimo

I did it but still show the same error

maxgro
MVP
MVP

Does it work with one table?

SQL select

    VUser.father,

    VUser.FName,

    VUser.Id

FROM

    MMTDB.dbo.QVUser                as VUser

Anonymous
Not applicable
Author

yes it works with two tables also but when i add third one it shows error

maxgro
MVP
MVP

Try only the third table, if you get the same error remove some fields until there isn't any error

ziadm
Specialist
Specialist

These are possible reasons

1- passing few function in you SQL syntax that are not recognized by the OLEDB.

2- duplicate field names passed

3-Wrong field Names (they may look correct but few unseen charters).

I would suggest try to reduce the query to one filed and add one by one till you get the field that is causing the error for further investigation