sqlparser / gsp_demo_java

Java demos for the General SQL Parser library
122 stars 68 forks source link

Sqlserver procedure cursor can't parse #14

Open csxuyang opened 2 years ago

csxuyang commented 2 years ago
        Declare MyCusror Cursor Scroll

              For Select * From Master_Goods Order By GoodsID

        Open MyCursor

        Fetch next From MyCursor
        Into @GoodsCode,@GoodsName

        While(@@Fetch_Status = 0)
              Begin

                     Begin
                           insert into B select  @GoodsCode,@GoodsName
                     End

                     Fetch next From MyCursor
                     Into @GoodsCode,@GoodsName

              End
        Close MyCursor
        Deallocate MyCursor

cursor can't parse . @GoodsCode,@GoodsName parse as a constant.

21f1nger commented 4 days ago

I faced that problem. There are procedures that are not processed by the library. They are in the metadata file, but in the final result after processing some procedures, they are not. Because of this, data chains are broken.