The CreatorCon Call for Content is officially open! Get started here.

Help Creating a Database view

Alex319
Giga Guru

Hi All, 
I'm trying to create a database view to link a custom cmdb table and the case table. 
When I add the cmdb table to the database view and click on 'try me' the table shows no records. 
The purpose of this database view is to create a report which can look at an asset and see if there are any cases related to that asset. 

Alex319_0-1706538315320.png

Alex319_1-1706538410557.png

Any help would be greatly appreciated

 

Thanks

Alex

 

1 ACCEPTED SOLUTION

Siddhesh Wani1
Tera Guru

Hi Alex 

The where clause doesn't support the dot walking. You have to think about the correct condition 

Something unique on the both table and write the query like below

SiddheshWani1_0-1706539662966.png

here com is company and checking the user's company and give the correct data. 

Both field should are referring to the same sys_id.

 

View solution in original post

18 REPLIES 18

Hi @Alex319 ,

 

Please also note the equal sign - that you have not corrected according to your update?

AndersBGS_0-1706539329634.png

"ca_asset.sys_id = pp_asset.sys_id"

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders  

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Siddhesh Wani1
Tera Guru

Hi alex 

 

You have to correct your where clause

ca_asset.sys_id = pp_asset.sys_id

 

Kindly consider marking the provided answer as correct if it proves helpful.
Thank you and best regards,

Alex319_1-1706539289353.png

Even with this change it is still not showing any records. 

Thanks

Alex

Ok, and you have an asset field on both the sn_customerservice_case and u_cmdb_ci (can't read the rest of the table name) where both entries are reference fields referring to the same sysid - is that correct? Have you verified this?

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders  

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Alex319_0-1706539675701.png

Alex319_1-1706539704162.png

Yeah so the asset field is on both case and cmdb table. without showing real life data you can see the same asset is visible on both. 

Thanks

Alex