查询必须以SELECT或WITH错误开头?

时间:2019-05-28 09:58:19

标签: oracle function plsql

我尝试根据条件执行plsql private String getDefaultFont() { File configFilename = new File("/system/etc/system_fonts.xml"); // sans-serif is the default font family name in Android SDK, check out the code in Typeface.java String defaultFontName = "sans-serif"; try { FileInputStream fontsIn = new FileInputStream(configFilename); XmlPullParser parser = Xml.newPullParser(); parser.setInput(fontsIn, null); boolean done = false; boolean getTheText = false; int eventType; while (!done) { eventType = parser.next(); if (eventType == parser.START_TAG && parser.getName().equalsIgnoreCase("name")) { getTheText = true; } if (eventType == parser.TEXT && getTheText) { // first name defaultFontName = parser.getText(); done = true; } if (eventType == parser.END_DOCUMENT) { done = true; } } } catch (RuntimeException e) { System.err.println("Didn't create default family (most likely, non-Minikin build)"); } catch (FileNotFoundException e) { System.err.println("GetDefaultFont: config file Not found"); } catch (IOException e) { System.err.println("GetDefaultFont: IO exception: " + e.getMessage()); } catch (XmlPullParserException e) { System.err.println("getDefaultFont: XML parse exception " + e.getMessage()); } return defaultFontName; } 语句。但这不起作用。

IF

它显示:

  

ORA-20001:查询必须以SELECT或WITH错误开头

1 个答案:

答案 0 :(得分:1)

您的代码似乎缺少用于替代引用语法的Q。替换

User1 :='~
             SELECT * FROM CI_PREFERENCE  WHERE EMAIL_ID = lower(:APP_USER);
           ~';

使用

User1 := q'~
             SELECT * FROM CI_PREFERENCE  WHERE EMAIL_ID = lower(:APP_USER);
           ~';