We are trying to convert Oracle pl/sql to sql server t-sql. We are using the oracle grammar file as per the below url. I have attached the grammar file as well.
https://github.com/antlr/grammars-v4/blob/master/plsql/plsql.g4.
The pl/sql block contains/forms a query dynamically like the example below.
exec_stmt := 'UPDATE dedupjobqueue SET status = ''COMPLETED'' WHERE bank_id = ''' || v_bank_id ||''' AND orgkey ='''|| sorgkey||''' and JobID != '|| JobID || '';
The translation to t-sql construct is having some issues. The result being broken down incorrectly as mentioned below. Have a close look at the semicolon ";" in between the dynamic query.
SET @exec_stmt = 'Update CORPNEGATIVEJOBQUEUE SET status=''COMPLETED'' WHERE bank_id=''';
It should have done it as below.
SET @exec_stmt = 'Update CORPNEGATIVEJOBQUEUE SET status=''COMPLETED'' WHERE bank_id=''' + @v_bank_id + ''' AND CORP_key =''' + @sorgkey + ''' and JobID != ' + @JobID + '' ;
Can someone help in suggesting if the grammar needs to be changed to handle it and any other pointers ?
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.