The community is undergoing maintenance and is in Read-Only mode. Click to learn more.

Active IQ Unified Manager Discussions

WFA User Input SQL Query Error

RoiBeci

Hi,

 

 

I'm trying to run the following query on a user input, but get the error:

 

java.lang.RuntimeException: An unexpected error has occurred while attempting to format SQL. It may be that the SQL provided is not well formed.

 

Do we have some restrictions on a user input query? 

 

Maybe another idea on how to use this query?

 

 



SELECT CASE WHEN EXISTS ( SELECT volume.name as 'volname' FROM cm_storage.cluster, cm_storage.vserver, cm_storage.volume WHERE vserver.cluster_id = cluster.id AND volume.vserver_id = vserver.id AND ( cluster.primary_address = '${ClusterName}' OR cluster.name='${ClusterName}' ) AND vserver.name = '${VserverName}' AND volume.name IN ( select quota_rule.quota_volume from cm_storage_quota.quota_rule where quota_rule.vserver_name=vserver.name AND quota_rule.user_name='${UserName}' ) ) = 1 THEN ( SELECT volume.name as 'volname' FROM cm_storage.cluster, cm_storage.vserver, cm_storage.volume WHERE vserver.cluster_id = cluster.id AND volume.vserver_id = vserver.id AND ( cluster.primary_address = '${ClusterName}' OR cluster.name='${ClusterName}' ) AND vserver.name = '${VserverName}' AND volume.name IN ( select quota_rule.quota_volume from cm_storage_quota.quota_rule where quota_rule.vserver_name=vserver.name AND quota_rule.user_name='${UserName}' ) ) ELSE ( Select * from( SELECT 'fake_vaule' AS value Union select 'fake_value_2' AS value) AS t2 ) End

Thanks,

 

Roi Becidan

NetApp.

 

 

1 ACCEPTED SOLUTION

anuk

Hi Roi,

     You can try running the query without formating the SQL query.  

     To disable formating of SQL queries  unselcet the option "Enable formating of SQL Queries" under WFA Configuration->Other tab. Then run the user input query. By default formating is enabled. You can turn it off.

 

Thanks and Regards

anu

View solution in original post

2 REPLIES 2

anuk

Hi Roi,

     You can try running the query without formating the SQL query.  

     To disable formating of SQL queries  unselcet the option "Enable formating of SQL Queries" under WFA Configuration->Other tab. Then run the user input query. By default formating is enabled. You can turn it off.

 

Thanks and Regards

anu

View solution in original post

RoiBeci

Thanks that did the trick 🙂

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public