REM minipar.bas REM REM This script parse a SQL statement and prints the errors REM into the output window. REM REM Usage: REM Select the code you want to parse and start the script. REM It is necessary, that you select a database object in the REM project tree. '--------------------------------------------------------------- ' (C) 2003 Alligator Company Soft:ware GmbH ' http://www.alligatorsql.com ' Author : Manfred Peter '--------------------------------------------------------------- DIM nViewIndex AS INTEGER DIM nIndex AS INTEGER DIM sOut AS STRING DIM nCount AS INTEGER DIM nCol AS INTEGER DIM nRow AS INTEGER DIM nMaxRow AS INTEGER '------------------------ ' check if a view is open nCount = GetViewCount() IF nCount = 0 THEN OUTPUT("No code defined for parsing ...") END END IF nViewIndex = GetActualViewIndex() sSelect = View(nViewIndex).GetSelection() IF sSelect = "" THEN DIM nStartRow AS INTEGER DIM nStartCol AS INTEGER DIM nEndRow AS INTEGER DIM nEndCol AS INTEGER nStartRow = 1 nStartCol = 1 nEndRow = View(nViewIndex).GetLineCount() nEndCol = View(nViewIndex).GetLineLength(nEndRow) View(nViewIndex).SetSelection(nStartRow, nStartCol, nEndRow, nEndCol) sSelect = View(nViewIndex).GetSelection() IF sSelect = "" THEN OUTPUT("Please enter or select a valid SQL statement ...") END END IF END IF '--------------------------------- ' Get Connection from project tree DIM sConnection AS STRING sConnection = GetConnectionFromTree() IF sConnection = "0" THEN OUTPUT("No database object selected ...") END END IF DIM sCursorHandle AS STRING sCursorHandle = OpenCursor(ORACLE, sConnection, sSelect) IF sCursorHandle = "0" THEN OUTPUT("Error in SQL statement") ELSE OUTPUT("No errors found ... Statement OK ...") END IF CloseCursor(sCursorHandle)