You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Raghavender Reddy Erupaka <er...@steelwedge.com> on 2015/11/04 05:51:10 UTC

RE:How to validate special charecters and PLSQL quires.

Hi Team,

I am new to Apache calcite, after gone through some examples now I am able to parse simple SQL queries using SqlParser. But here my problem is how can we validate PLSQL quires, like declaring parameters using DECLARE key, conditions(if) ,exec, begin,end..etc., and special characters (@ and ;) . I gone through almost all test classes which you provided, but there are no class has below mention example syntax.

Ex:
DECLARE @lclIstelescopeEnabled bit
      DECLARE @lclMeasureUnit varchar(30)

      set @lclIstelescopeEnabled = 0

      SELECT @lclIstelescopeEnabled =Isnull(is_telescope_enabled, 0), @lclMeasureUnit = measure_unit
      FROM   forecast_plan

      SELECT @lclWeekTypeID = period_type_id
      FROM   period_type_map
      WHERE  period_type_name = 'WEEK'


      if (exists (SELECT name, type
             from sysObjects where type in ('P', 'FN')
             and lower(name) = lower('DT_FORECAST_DATA_pre')))
        begin
             exec DT_FORECAST_DATA_pre
        end

Requirement: Above quiry I'll get from client and I'll append this query to procedure and deploy that. Before deploy I should validate queries.

I really appreciate any help you can provide .


Thanks,

Raghavender Reddy Erupaka
Software Engineer

Steelwedge Software, Inc.

cell  9030684174
www.steelwedge.com<http://www.steelwedge.com/>

[SW New Signature Logo]
Plan. Perform. Profit.

CONFIDENTIALITY NOTICE  This message, including any attachments, contains confidential information and may contain information that is also proprietary and/or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this message is strictly prohibited. If you have received this message in error, please notify us immediately by replying to this e-mail and then delete this message and its attachments from your system. Thank you.


RE: How to validate special charecters and PLSQL quires.

Posted by Raghavender Reddy Erupaka <er...@steelwedge.com>.
Thanks a lot for your quick response.  I am eagerly waiting for that some day.

Regards,
Raghavender.

-----Original Message-----
From: Julian Hyde [mailto:jhyde@apache.org] 
Sent: 05 November 2015 01:43
To: dev@calcite.apache.org
Subject: Re: How to validate special charecters and PLSQL quires.

Calcite’s SQL parser does not handle PL/SQL, just SQL.

PL/SQL (and other languages such as PL/pgSQL and SQL/PSM) is a major extension to core SQL to add procedural extensions. We might go there someday, but not today.

Julian


> On Nov 3, 2015, at 8:51 PM, Raghavender Reddy Erupaka <er...@steelwedge.com> wrote:
> 
> Hi Team,
>  
> I am new to Apache calcite, after gone through some examples now I am able to parse simple SQL queries using SqlParser. But here my problem is how can we validate PLSQL quires, like declaring parameters using DECLARE key, conditions(if) ,exec, begin,end..etc., and special characters (@ and ;) . I gone through almost all test classes which you provided, but there are no class has below mention example syntax.
>  
> Ex:
> DECLARE @lclIstelescopeEnabled bit
>       DECLARE @lclMeasureUnit varchar(30)
>      
>       set @lclIstelescopeEnabled = 0
>      
>       SELECT @lclIstelescopeEnabled =Isnull(is_telescope_enabled, 0), @lclMeasureUnit = measure_unit 
>       FROM   forecast_plan
>       
>       SELECT @lclWeekTypeID = period_type_id 
>       FROM   period_type_map
>       WHERE  period_type_name = 'WEEK'   
>       
>  
>       if (exists (SELECT name, type
>              from sysObjects where type in ('P', 'FN')
>              and lower(name) = lower('DT_FORECAST_DATA_pre')))
>         begin
>              exec DT_FORECAST_DATA_pre
>         end
>  
> Requirement: Above quiry I’ll get from client and I’ll append this query to procedure and deploy that. Before deploy I should validate queries.
>  
> I really appreciate any help you can provide .
>  
>  
> Thanks,
>  
> Raghavender Reddy Erupaka
> Software Engineer
>  
> Steelwedge Software, Inc.
>  
> cell  9030684174
> www.steelwedge.com <http://www.steelwedge.com/>
>  
> 
> Plan. Perform. Profit.
>  
> CONFIDENTIALITY NOTICE  This message, including any attachments, contains confidential information and may contain information that is also proprietary and/or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this message is strictly prohibited. If you have received this message in error, please notify us immediately by replying to this e-mail and then delete this message and its attachments from your system. Thank you.


Re: How to validate special charecters and PLSQL quires.

Posted by Julian Hyde <jh...@apache.org>.
Calcite’s SQL parser does not handle PL/SQL, just SQL.

PL/SQL (and other languages such as PL/pgSQL and SQL/PSM) is a major extension to core SQL to add procedural extensions. We might go there someday, but not today.

Julian


> On Nov 3, 2015, at 8:51 PM, Raghavender Reddy Erupaka <er...@steelwedge.com> wrote:
> 
> Hi Team,
>  
> I am new to Apache calcite, after gone through some examples now I am able to parse simple SQL queries using SqlParser. But here my problem is how can we validate PLSQL quires, like declaring parameters using DECLARE key, conditions(if) ,exec, begin,end..etc., and special characters (@ and ;) . I gone through almost all test classes which you provided, but there are no class has below mention example syntax.
>  
> Ex:
> DECLARE @lclIstelescopeEnabled bit
>       DECLARE @lclMeasureUnit varchar(30)
>      
>       set @lclIstelescopeEnabled = 0
>      
>       SELECT @lclIstelescopeEnabled =Isnull(is_telescope_enabled, 0), @lclMeasureUnit = measure_unit 
>       FROM   forecast_plan
>       
>       SELECT @lclWeekTypeID = period_type_id 
>       FROM   period_type_map
>       WHERE  period_type_name = 'WEEK'   
>       
>  
>       if (exists (SELECT name, type
>              from sysObjects where type in ('P', 'FN')
>              and lower(name) = lower('DT_FORECAST_DATA_pre')))
>         begin
>              exec DT_FORECAST_DATA_pre
>         end
>  
> Requirement: Above quiry I’ll get from client and I’ll append this query to procedure and deploy that. Before deploy I should validate queries.
>  
> I really appreciate any help you can provide .
>  
>  
> Thanks,
>  
> Raghavender Reddy Erupaka
> Software Engineer
>  
> Steelwedge Software, Inc.
>  
> cell  9030684174
> www.steelwedge.com <http://www.steelwedge.com/>
>  
> 
> Plan. Perform. Profit.
>  
> CONFIDENTIALITY NOTICE  This message, including any attachments, contains confidential information and may contain information that is also proprietary and/or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this message is strictly prohibited. If you have received this message in error, please notify us immediately by replying to this e-mail and then delete this message and its attachments from your system. Thank you.