You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "ArtemSannikov (via GitHub)" <gi...@apache.org> on 2024/09/24 08:18:01 UTC
Re: [I] When I Trying to Generate a chart from stored-procedures query I got an error "Virtual dataset query cannot consist of multiple statements” [superset]
ArtemSannikov commented on issue #23125:
URL: https://github.com/apache/superset/issues/23125#issuecomment-2370586595
> Hii Problem : I have created and executed an Stored Procedure on Sql-Lab and it run successfully , through with I created the dataset and when I go on the chart screen I got an error like this : **Virtual dataset query cannot consist of multiple statements**
>
> My Stored Procedure is Multi-statement in which column is dynamically generated.
>
> ```
> SET SESSION group_concat_max_len=1000000;
> select group_concat(distinct concat('case when pfmap.size =''',pf.DESCRIPTION,''' then pfmap.result end as ',"'",pf.DESCRIPTION,"'")) into @sql
> from product_feature_appl pfa
> inner join product_feature pf on pf.PRODUCT_FEATURE_ID = pfa.PRODUCT_FEATURE_ID and pf.PRODUCT_FEATURE_TYPE_ID='SIZE' and pfa.PRODUCT_FEATURE_APPL_TYPE_ID='STANDARD_FEATURE' and pfa.THRU_DATE is null
> inner join product p on pfa.PRODUCT_ID = p.PRODUCT_ID
> where exists (select order_id from order_item where product_id=p.product_id and created_stamp between now()-interval 6 month and now())
> ;
> SET @sql = CONCAT('select pfmap.vir_prod_id,pfmap.vir_prod_name,pfmap.var_prod_id,pfmap.var_prod_name,pfmap.COLOR,pfmap.facility_id,pfmap.ATP,pfmap.min_stock,pfmap.INBOUND, ',@sql,
> "from
> ..........
> ) as pfmap where pfmap.result is not null order by pfmap.facility_id");
> PREPARE stmt FROM @sql;
> EXECUTE stmt;
> -- DEALLOCATE PREPARE stmt;
> ```
>
> 
>
> Dependency : Using 2.0.0-dev and 2.0.1 Both have the same result
>
> Question :
>
> * Is Multi-Statement Stored Procedure Query is not supported in superset for making chart .
> * Is I am Missing something regards to that .
> @rusackas
How did you solve your problem?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org