cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

no viable alternative at input ' FROM' in SELECT Clause

Jump to solution

HI All

Trying to do a select via the SWQL studio

SELECT+NodeID,NodeCaption,NodeGroup,AgentIP,Community,SysName,SysDescr,SysContact,SysLocation,SystemOID,Vendor,MachineType,LastBoot,OSImage,OSVersion,ConfigTypes,LoginStatus,City+FROM+NCM.Nodes

But as a result I get - 

2020-06-30 09:14:37,930 [154] ERROR SolarWinds.InformationService.Core.InformationService - SWQL Studio (null) Exception caught in method SolarWinds.InformationService.Core.InformationService.RunQuery
SolarWinds.Data.SWQL.SWQLSyntaxException: no viable alternative at input 'FROM' in Select clause ---> Antlr.Runtime.NoViableAltException: A recognition error occurred.
at SolarWinds.Data.SWQL.Parser.SWQLParser.unaryExpression()
--- End of inner exception stack trace ---
at SolarWinds.Data.SWQL.Parser.SWQLParser.unaryExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.multiplyExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.additiveExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.relationalExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.equalityExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.negatedExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.logicalAndExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.logicalOrExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.expression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.aliasedExpression()
at SolarWinds.Data.SWQL.Parser.SWQLParser.selectedPropertiesList()
at SolarWinds.Data.SWQL.Parser.SWQLParser.selectClause()
at SolarWinds.Data.SWQL.Parser.SWQLParser.selectFrom()
at SolarWinds.Data.SWQL.Parser.SWQLParser.queryRule()
at SolarWinds.Data.SWQL.Parser.SWQLParser.selectStatement()
at SolarWinds.Data.SWQL.Parser.SWQLParser.statement()
at SolarWinds.Data.SWQL.SWQLParser.Parse(String query)
at SolarWinds.Data.Query.Engine.QueryProcessor.ProcessInternal(String query, IQueryExecutionContext context)
at SolarWinds.InformationService.Core.QueryPlanCache.GetQueryPlan(String query, String username, Boolean federationEnabled, Func`1 buildQueryPlan)
at SolarWinds.InformationService.Core.InformationService.RunQuery(String query, IDictionary`2 parameters, IDataSerializer serializer)

!some searching leads to this, but yes not quite the answer but maybe something to do with the version we are running

https://thwack.solarwinds.com/t5/EOC-Discussions/EOC-Not-Accepting-SQL-Filter-Queries-for-Custom-Pro...

We are running version 12.4 of the NPM

Orion Platform 2018.4 HF3, IPAM 4.8.1 HF1, NCM 7.9, NPM 12.4, NTA 4.5.0, VMAN 8.3.1, NetPath 1.1.4 © 1999-2020 SolarWinds Worldwide, LLC. All Rights Reserved.

Is there someone out there who can help me in some way

 

Thanks in advance 🙂

0 Kudos
1 Solution

I copied and pasted your query and got the same error.

 

Replacing the +'s and removing City from the query made it work

SELECT
NodeID,
NodeCaption,
NodeGroup,
AgentIP,
Community,
SysName,
SysDescr,
SysContact,
SysLocation,
SystemOID,
Vendor,
MachineType,
LastBoot,
OSImage,
OSVersion,
ConfigTypes,
LoginStatus
FROM NCM.Nodes

View solution in original post

5 Replies

I copied and pasted your query and got the same error.

 

Replacing the +'s and removing City from the query made it work

SELECT
NodeID,
NodeCaption,
NodeGroup,
AgentIP,
Community,
SysName,
SysDescr,
SysContact,
SysLocation,
SystemOID,
Vendor,
MachineType,
LastBoot,
OSImage,
OSVersion,
ConfigTypes,
LoginStatus
FROM NCM.Nodes

View solution in original post

Hi 

 

That did the trick, thanks alot

 

 

0 Kudos
I'd say removing the +'s fixes it. The query below runs for me.

SELECT NodeID,NodeCaption,NodeGroup,AgentIP,Community,SysName,SysDescr,SysContact,SysLocation,SystemOID,Vendor,MachineType,LastBoot,OSImage,OSVersion,ConfigTypes,LoginStatus,City FROM NCM.Nodes
0 Kudos

HI Shuth

 

If City stays it does not work for me - 

 

br

0 Kudos

Do you have the City node custom property? If your instance does not have this custom property, the column won't exist in your NCM.Nodes table.

I created another custom property called City2 - this now appears in my NCM.Nodes table.

shuth_1-1593507470395.png

 

 

0 Kudos