Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulken
Partner - Contributor
Partner - Contributor

How to use SQL function in joins

Currently facing problem while using sql function in joins. It is giving mw the error as "Invalid object name dbo.<functionname>

I have following query as

Select E.EmpId,

          D.DeptName

from Employees E cross join dbo.GetEmployeeDetails(E.EmpId)

18 Replies
rupamjyotidas
Specialist
Specialist

Maybe this

Select E.EmpId,

          D.DeptName

from Employees E cross join

Select your fieldname

From dbo.GetEmployeeDetails(E.EmpId)

But are you sure you want to do cross join. I fear that join.

Not applicable

Use apply instead of join  when joining table valued functions. 

Select E.EmpId,

           D.DeptName

  from Employees E cross apply dbo.GetEmployeeDetails(E.EmpId)

 

Anil_Babu_Samineni

Does GetEmployeeDetails is a table name or what.

Would you describe more means share the screen which you get the error.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jayanttibhe
Creator III
Creator III

Hi,

Maybe you want something like this :

Select E.EmpId,

          D.DeptName

from Employees E

cross join

dbo.GetEmployeeDetails D

OR

Select E.EmpId,

          D.DeptName

from Employees E ,

dbo.GetEmployeeDetails D

I dint get why you want to specify dbo?  normally if we want to specify specific table in specific Data base then we use this syntax :  dbo.DB_Name.Table_Name

Thanks

Jayant

Gysbert_Wassenaar

Try asking this question on a SQL Server support site. It has nothing to do with Qlikview. Once you have figured out what the correct sql statement is you can use it in Qlikview as it is. Qlikview only passes the sql statement to the oledb or odbc driver and receives the results from the driver.


talk is cheap, supply exceeds demand
rahulken
Partner - Contributor
Partner - Contributor
Author

I am still facing the problem (I tried all the flows mentioned here)QlikviewError.png. Please find the screen shot of the error.

rahulken
Partner - Contributor
Partner - Contributor
Author

Here I tried apply also still faced this error.

jonathandienst
Partner - Champion III
Partner - Champion III

You did try a SQL support site as Gysbert suggested right?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
rahulken
Partner - Contributor
Partner - Contributor
Author

I tried it on SQL and it works in query analyser.