Validate SQL string before executing

I am attempting to find a way to validate an SQL script file before executing against a database. This is to allow any errors within the script to be identified and fixed before running against a pre-live / live database.
These scripts may contain both DDL and DML.
Is there any way to run the script and only have the changes visible to the current user, with all other database users unaffected until the changes have been checked (in a similar way to running an insert / update / delete without committing the changes)? Failing this, are there any tools to check the validity of the statements within an SQL script file?
Any help with these or alternative solutions would be much appreciated.
Cheers,
Steve

This is not sensible.
How can you test a DML that creates a table (that does not create the physical table) and then test a DDL that uses that table that was not created and of which no record exist?
The validity of a SQL statement (DML or DDL) depends on numerous factors, including the state of the database at that specific point in time that it is being run. You may test/check a DML that creates an index and it is fine.. until run on production where it times out as it cannot get a lock on the table in order to create the index.
Or there is insufficient free space in the tablespace to build the index. Or the index is build in parallel and one of the PQs fail because on an Oracle bug, resulting in the complete DDL failing.
Etc. Etc.
If the intention is to be able to test an upgrade/patch/install script for a production database for every single potential problem and error, and then have a 100% guaranteed success rate in running that on production.. er.. excuse me for a moment..
<mad laughter heard from outside>
Er.. okay. Back again.
This will need - no compromises and just for starters - the exact same h/w platform, o/s, Oracle s/w, and duplicated production database (cloned perhaps) as the test platform.
And if this is not possible or feasible then you should forget about having that script tested in such a fashion in order to have a 100% guarantee of a successful production deployment... and investigate the optimum method to test as far as possible, and build a comprehensive plan for change management and dealing with problems out of this upgrade, on production.

Similar Messages

  • Changing sql-statement before executing query

    I want to change the sql-statement of a query just before it is executed.
    I have tried it with a query redirector/sessionevent listener, but I could get it to work.
    Do you have any examples.
    I want to change the tablename in a sql-statement like this:
    before
    select id from emp
    after
    select id from emp_v
    Any examples out there to do this?

    ... I am using SAP NetWeaver BI 7.0
    Monique

  • Newbie (View sql statement before execute immediate)

    Here is a sample:
    <code>
    drop table dummy;
    create table dummy(county varchar2(20)
    ,fiscalyear number(4,0)
    ,wavkeyid number(4,0));
    Insert into dummy(county,fiscalyear,wavkeyid)
    values('Jefferson',2012,59);
    commit;
    </code>
    I am trying to use a bind variable in the SQL statement.
    I would like to see the statement before it is executed.
    Example
    Select county from dummy where wavkeyid=59 and fiscalyear=2012
    Is there a way for me to see the line above?
    <code>
    PROCEDURE test_BindVar
    AS
    v_message_tx varchar2(200);
    v_wavkeyid_nr number:=59;
    v_county_tx varchar2(40);
    BEGIN
    v_message_tx:='Select county from dummy '||
    ' where wavkeyid=:x and fiscalyear=2012 ';
    dbms_output.put_line
    ('v_message_tx '||v_message_tx);
    execute immediate v_message_tx into v_county_tx using v_wavkeyid_nr;
    dbms_output.put_line
    ('v_county_tx '||v_county_tx );
    END;
    </code>
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE 10.2.0.4.0 Production"
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    TIA
    Steve42

    you missed the forum you are in ;)
    "SQL Developer (Not for general SQL/PLSQL questions)"
    recommend to post your question to the related forum on OTN.

  • How to validate required fields before executing menu item ("Save As") using cutom Javascript?

    Hi,
    Sorry, I am new to PDF Development. I tried creating PDF using Acrobat XI Pro. During creation, I have encountered issues in running custom JavaScript. The requirement is to validate all the required fields before saving the PDF. I tried using the following scripts to validate the said required fields. But, it's not working.
    Option 1: If the field is null, a message box will appear.
    if(this.getfield("textbox") = null){
    app.alert("required");
    else {app.execMenuItem("SaveAs");}
    Option 2: If the field is required, a message box will appear.
    var f = this.getField("textbox");
    f.required = true;
    if(f = true)
    app.alert('required');
    else
    app.execMenuItem("SaveAs");
    The scripts mentioned above are not working. I wanted to validate the required fields before saving the PDF.
    In addition, I tried validating each field using the following script:
    f = getField(event.target.name)
    if (f.value.length == 0)
        f.setFocus()
        //Optional Message - Comment out the next line to remove
        app.alert("This field is required. Please enter a value.")
    When I open the PDF, the script is working. However, when the message box pops out, the "OK" button is not working as expected. The message box is not closing. I tried opening the form in a site in different Java versions (like 7-11 and 7-67). It's working in version 7-67. I tried upgrading the Java version from 7-11 to 7-67. Still, it doesn't work.
    I would appreciate your feedback on this matter.

    If you set the fields as required, then when the user hits the print button you could run this script:
    var txt = form1.execValidate();
    if (txt == true){
    print command
    This code assumes that the root node of your form is form1. Also ensure you put a message into the Empty Message parameter for each field that you want to mark s required.

  • Create SQL string, PL/SQL

    Hi,
    In my application I have a selectList component, called P1_SELECTLIST. When a user chooses a value, say, 'Car,' I would like my report to return allvalues contained in subclasses of object type 'Car.' I have successfully setup a hierarchy table.
    Since you cannot use a bind variable for an object type, I have create the following PL/SQL code to create a SQL string, then execute it. I am not sure where in my application this code goes as I have tried to put it as the report source for the page but have had no success. Perhaps it needs to be created as a separate process?
    Thanks.
    DECLARE
    p1_string VARCHAR2(30);
    BEGIN
    p1_string:=
    'SELECT p.show() FROM ItemHierarchy_obj_table p WHERE VALUE(p) IS OF (' || :p1_selectlist || ')';
    EXECUTE IMMEDIATE p1_string;
    END;

    First, you need to make your p1_string variable bigger. You have it defined for 30 characters which is smaller than you SQL string.
    Second, Create a Report Region... when you get to step where you can, Enter SQL Query or PL/SQL function returning a SQL Query, enter the following:
    DECLARE
      p1_string VARCHAR2(300);
    BEGIN
      p1_string:=
    'SELECT p.show() FROM ItemHierarchy_obj_table p WHERE VALUE(p) IS OF (' || :p1_selectlist || ')';
      RETURN p1_string;
    END;You don't have to execute the query, APEX will take care of that for you.

  • Executing PL-SQL Query before running a Report

    Hi Guys,
    Can i use a Run a Pl-Sql Query every time before executing a report. Like if i am opening a report then the pl-sql Query should run before it.
    Thanks
    Rondo.

    Try with Evaluate as one of the column's expression.. so that we can limit to specific report..
    or
    Use Connection Pool->Connection Pool Scripts tab->use 'Execute before query'
    Since we can set the repository variables using advanced tab.. the same variable we may validate using Connection pool scripts tab.
    This might be more dev work..
    Edited by: Srini VEERAVALLI on Dec 17, 2012 9:00 PM

  • How to get prepared string before sending to sql

    Hi
    I want the prepared string before sending to Sql (After substitution and setXXX), is it possible to do this? if yes, how ?
    PreparedStatement ps = cn.prepareStatement("select * from table1 where name= ''?'' ");
    ps.setString(1, "mytable")
    <-- I want the prepared string before sending to Sql (After substitution and setXXX) -->
    ResultSet rs = ps.executeQuery();
    Thanks
    Ali

    As I mentioned, I want Sql Text before execution
    n (getting resultSet), and after whole of setXXXs,No way, I believe.
    I have tried in many ways, let me put down my work.
    String query = "'Select * from dept where deptno=?'";
    System.out.println("Before : "+query);
    PreparedStatement ps = con.prepareStatement("select "+query+",? from Dual");
    ps.setInt(1,50);
    ResultSet rs = ps.executeQuery();
    if(rs.next()) {
    System.out.println("After : "+rs.getString(1));
    ps.close();
    con.close();I have tried in these lines, to capture the sql query, but it is failing at execution and the exception is 'bind variable not found'. So, I think you need to implement your own class to construct this query. Getting the details from DatabaseMetadata to see how the driver's setter methods works and you can use the same logic in your custom class.
    Good luck.

  • How to validate a Query without executing it?

    How to validate a Query without executing it?
    For example if I have:
    ReadAllQuery myQuery = new ReadAllQuery(myClass);
    myQuery.setSelectionCriteria(myExpression);
    What can I do to have must validation as possible been done before executing the query?
    Validation that could be done are:
    - Expression reference fields that really exist in TopLink mapping
    - Literal provided to expression are of compatible type
    - Parameter setting set against the query are all compatible

    Your could prepare the query.
    query.prepareCall(session, record);
    This will do all query validation and generate the SQL for the query.

  • NDS - Maximum Limit in SQL String

    When executing NDS I usually just use EXECUTE IMMEDIATE, but now I've had to use the OPEN FOR statement and
    execute a SQL string that I read in from a column in a table. Now I know I've encountered an error before that states
    I've exceed a limit in the number of characters the SQL string can have before "opening" it via NDS.
    Does anyone the max I should set my VARCHAR2 column that holds the SQL statements? I recall it was 255 bytes I
    think.
    Thanks,
    Gio
    null

    Max of SQL statement length is 64K
    more limitations here http://www.itsystems.lv/gints/oracle_limits.htm

  • Building SQL String ?

    I am trying to build a SQL String and send it to the database...
    this is how i am trying to form a query string
    StringBuffer sBuff = new StringBuffer(250);
    sBuff.append("old information")
    sBuff.append("new history added twice");
    String caseObjId = "2567034";
    StringBuffer queryBuff = new StringBuffer(250);
    queryBuff.append("UPDATE table_case ");
    queryBuff.append("SET case_history =" + sBuff);
    queryBuff.append("WHERE objid =" + caseObjId);
    i am getting SQL Exception saying
    com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near 'information'.
    let me know what where i am doing mistake
    thanks
    KM

    The previous posters are right on target for debugging your problem; if you printed out the query that's giving you problems, you would see:
    UPDATE table_case
    SET case_history =old informationnew history added twice
    WHERE objid =2567034 and the problem then becomes obvious that the string/varchar data needs to be quoted.
    That will fix your immediate problem.
    However, since you are obviously a newbie, I'll tell you how to fix 2 or 3 more problems; don't use Statement, use PreparedStatement and bind your parameter values.
    <rant>
    First, when a database executes a SQL statement for the first time, it has to "parse" it. "parsing" is an awful like compiling in that it often takes 100 times longer or more to compile a bit of code than it does to execute it. A good database will check a cache of parsed SQL to see if it doesn't need to parse again, but it often relies on an exact match of the SQL. If you use Statement and change the value of case_history or objid, it's not an exact match. However, if you use PreparedStatements, your values aren't part of the SQL; therefore you get a lot more matches in the parse cache and the database saves a huge amount of work.
    Second, when you build up SQL with embedded values like you're doing, you have to deal with any special characters appropriately; in particular the single quote character; for example, if you have a LAST_NAME column, you need to support the name "O'Conner"; the single-quote in the middle has to be recognized and properly escaped. This problem simply goes away with parameter bindings; the code and the data are widely seperated and there's no question where the boundary is.
    Third, building up SQL in the way you did is the technique that causes a major security hole an poorly coded applications. Let's say you're building an e-commerce site that will keep customer credit card numbers on file (risky) and want a function to display credit card numbers given an account number (not really a good idea, but it illustrates the technique). You have code like:
    StringBuffer queryBuff = new StringBuffer();
    queryBuff.append("SELECT CC_FIRST_NAME, CC_LAST_NAME, CC_NUMBER, CC_EXP ");
    queryBuff.append("FROM CARD_DATA);
    queryBuff.append("WHERE account_number  =" + acct_number);this will work just great when a user enters their account number of "1234567", and it will work just great (for the hacker) when the account number is entered as "1234567 or (CC_FIRST_NAME = 'Bill' and CC_LAST_NAME = 'Gates')"; the hacker's add-ons are treated as code, not data, and the e-commerce site spits up a customer's data to an authorized person. Again, parameter binding prevents this and add-ons get treated as part of the account number, probably generating a data-type error on the database. Obviously, you can validate the data to numerics in this example, but if you use PreparedStatement instead, you don't have to think, it takes care of itself.
    </rant>

  • SQL String Not a Query Trouble

    Just upgraded my JDeveloper and Oracle Application Server to 10.1.2 and some code that was working before no longer works. I suspect JDBC driver issues but I've been swapping jar files like a crazed loon and still no joy. Perhaps some here can give me a clue.. the exception I get is:
    nested exception is: org.exolab.castor.jdo.PersistenceException: Nested error: java.sql.SQLException: SQL string is not Query while executing UPDATE PER_USERS SET ACCTNM='paul',FIRSTNM='Paula',LASTNM='Sanders',MI='M',EMAIL='[email protected]',PHONEEXT='9362',ROLE_ID=1,DIVISION_ID=null,ERRTYPE_ID=null,ACTIVE='T' WHERE USER_ID=1 at ourcustomdbaccess.Query.execute(Query.java:112) at ...
    Query is a subclass of Castor's OQLQuery.
    Interestingly, before the upgrades this code would not work in JDev (9.0.4) but would work on the application server.
    Any suggestions appreciated!
    Paul

    Oooops ...
    Has the dang documentation writer (that's me) simply believed what the dang developer (that's the buddy sitting directly in front of me, nice guy by the way) has told him instead of testing it thoroughly enough.
    Unfortunately, only CHAR, CLNT, LANG, CUKY, UNIT and c are supported with operator && up to now.
    I adjust the documentation in SP09  (that's the current version, I'm working on). But maybe, that's also the SP, where the restriction will be abolished anyway (the problem as always in Open SQL - and meanwhile also in ABAP CDS - is, that each database must deliver the same result for all possible combinations and a lot of testing has to be done before the functionality can be released).
    Sorry for that and thanks for notifying me!
    Horst

  • Test Query before executing

    Hello everyone,
    I am write my final exam and I have to use oracle as the database and php as the GUI - programming - language.
    Image this situation:
    - Webform with 3 Textfields (names are a,b,c)
    I have a table let's say mydata
    mydata | value1 | value2 | value3
    And I have defined some integrities like
    value1.length >= 5
    value2.length <= 5
    value3.length >= 5 and value3.length <= 10
    Now I want as soon sobody presses the submit button at the formular, the input-data should be checked. Right now I check them with PHP and as soon as an error occure, I return to the form with some error message.
    I know, that is not the correct way, because if I check the data with PHP I don't need to create integrities at oracle.
    Is there a way to check a query before exceuting? PHP creates three
    querys, tests them all, and as soon there are no errors, then php calls the final
    exceute querys.
    My english is really bad, hopefully you get what I mean.
    Thanks a lot
    Hauke
    PS.: I know I could update / insert all three values at the same time and it won't update / insert anything if one error occures, but in my program a form inserts / updates data from different tables at the same time
    Message was edited by:
    user584520

    Hey,
    so basicly what I what to do is to iterate through an array with sql - statements.
    ---- PHP ARRAY ----
    update table1 set x=21 where id=1;
    update table2 set y=333 where id=2;
    ---- PHP ARRAY ----
    Now, I want to make sure, that all statements are correct for the oracle intergrity BEFORE the data will update.
    In other words, all the querys should be tested and only if all tests are correct, then
    it sould do the update - commands.
    In case it's still not clear lets say you have a webform for changing your personal data. One field for your email-address and one for you lastname. I have oracle constraints to validate the email-address and another for validate the length of lastname. Also lets consider the email-address and lastname are not in the same table. What I have to do is something like
    update CONTACTS set email='test' where id=1;
    and
    update ADDRESS set lastname='somebody' where id=1;
    If I put both querys in one array and iterate thought it, the first element will cause an error because of the violation of constraints for email-address, the second one will be fine. So after iterating thought the array the lastname has changed, but the email is still the old one.
    So the only way is the check all statements before executing them, but I have no idea if there is a possibility to do something like that.
    Thanks again ;-)
    Hauke

  • SQL statement not executing

    Please enlighten me. This is driving me crazy.
    I don't know if this is a database or java code related problem.
    JVM: 1.4.2
    Database: Oracle 9i
    Objective: trying to add a row into a table
    Problem: 1. SQL statement never gets executed.
    2. Application freezes. I have to terminate it myself.
    Any Ideas?
    void addCourse(){
    try {
        DriverManager.registerDriver ( new oracle.jdbc.driver.OracleDriver () ) ;
       System.out.println("Driver registered");  //---> ok.
    Connection conn = DriverManager.getConnection ( dbPath, username, password ) ;
       System.out.println("Connected");   // -----> it connects fine
       ResultSet rset = stmt.getResultSet();
       System.out.println("getting result set");  //-----> gets the resultSet fine
      Statement stmt = conn.createStatement();
      System.out.println("statement created");  //------> it creates statement
    7 = are the credits. Number on table. Length allowed 5.
    CS 500 = are the course code. Varchar2 on table. Length allowed 20
    Java = Actual course name. Varchar2 on table. Length 30
    3 = credits. Number on table. Length 5.
              // Prepare a statement to insert a record
              String sql = "INSERT INTO course VALUES (7 , 'CS 500', 'Java', 3 )"; //-->ok. Tested it manually 
              // Execute the insert statement
            stmt.executeUpdate(sql);  //----> *** java program freezes right here.***
            System.out.println("sql executed");   //--> Checked table. SQL never gets executed.
    catch ( SQLException ex ) {   //---> no error messages thrown.
    System.err.println(ex.getMessage());
      System.err.println(ex.getErrorCode());
      System.err.println(ex.getSQLState());
    }

    Nothing looks amiss in the code... How long are you waiting before you manually terminate?
    Can you replace the executeUpdate() with execute and change the INSERT to a SELECT? Does that work normally (you should be sure to get at least one row to verify that it is working correctly)? Can you select and update a different table in a different tablespace successfully?
    Couple of possibilities (I know this is weak):
    1) You have hit a deadlock condition because the table is locked by another or same process.
    2) You are running into network problems.
    3) Your insert is being queued up in Oracle's transaction manager (if configured).
    4) Have you tried both the Oracle thin and Oracle OCI driver? Do they both fail without error?
    5) Can you turn off autoupdate and try the insert? Does the executeUpdate() return then?

  • SQL Strings in Where Clause - single quotes issue

    All,
    I’m having issues related to SQL String literals when trying to deploy to flash. The complication works fine but I then get a message (see below) stating that a ; is missing. The SQL query and the iview runs fine when we use numeric values or do not apply a where clause on the table.
    I am using Visual Composer that has been packaged with NW2004sSP7_Preview
    VC & Flex Version: 645.7.0.3
    The Error message is get is;
    Error in executing a process for Flex compilation, Error 1033: ';' expected
          (C:usrsapJ2EJC01j2eeclusterserver0GUIMachine_Business_Packagestest_48731FLEX_COMPILATION_FOLEDRAADCN.mxml:269)
    Error 1205: The statement 'Test' is incomplete.
          (C:usrsapJ2EJC01j2eeclusterserver0GUIMachine_Business_Packagestest_48731FLEX_COMPILATION_FOLEDRAADCN.mxml:269)
    Failed to compile AADCN.mxml
    When I goto the deployment file – it has the below line;
    <i>'<Request type="EXECUTE_RELATIONAL" system="BI_JDBC" system_type="SAP_BI_JDBC" maxrows="500" templateid="BIR_SQL"><Objects type="INPUT" shape="OBJ" role="INPUT"><Object type="INPUT_FIELD" id="SQL_STATEMENT" appName="SQL" mapped="0" value=""/></Objects><Objects type="OUTPUT" shape="SET" role="OUTPUT"><Object type="OUTPUT_FIELD" id="name" appName="name"/></Objects><Objects id="1" type="TEMPLATE_PARAMETER"><Object id="2" type="SQL" value="select name from pub.srcompany where name ='Test Company'"/></Objects></Request>';</i>
    It seems that the parser for the flash deployment is prematurely finishing the parse when it hits the single quotation in the SQL string!
    We had a similar error where if we had a carriage return in the SQL (e.g. between the from & the where clause) then the deployment parser was stating that the line finished prematurely. In the deployment file the carriage return forced a new line thus making the message incomplete. Removing the carriage return resolve that issue
    The SQL Preview in the SQL Editor within VC works fine with the string literals in the where clause.
    The functionality compiles & deploys in web dynpro however it does not return the results to the table
    Questions
    1:> Has anyone successfully used flash with string literals in the SQL where clause or had seen this issue in the past?
    2:> Is there a setting to get the SQL working on Web dynpro for the information to be returned that I may have missed?
    Any assistance would be greatly appreciated.
    Best Regards,
    Ian.

    Hey,
    I have worked with SQL Editor a lot. Here's a how to guide I put together on it:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6339e7d4-0a01-0010-1c98-db00e52e989a
    Let me know if that helps...
    Prakash

  • Hard coded SQL string doesn't run with error PLS-00103

    I have created a package with 34 stored procedures [pre]to create some materialized view with hard coded SQL [pre]string (client required for this hard coding). The [pre]first part with 21 simple create statements has
    [pre]worked fine. 2nd part with 11 complicated create [pre]statements, only first one has worked. all others [pre]have  not worked.
    [pre]
    I used dbms_output.put_line (sql_string) to check the [pre]individual create statement, it has looked fine. I [pre]have run individual SP within package. I have got [pre]error message as ORA-06550: line 1, column 45:
    [pre]PLS-00103: Encountered the symbol "end-of-file" when [pre]expecting one of the following: ; [pre]
    <an identifier> <a double-quoted delimited-identifier> [pre]The symbol ";" was substituted for "end-of-file" to [pre]continue.
    [pre]I have checked SQL string between 1st part and 2nd [pre]part. They are the same and all with ';' to end SQL [pre]string and END SP name in the end. Please help me to [pre]identify where the problems are. Thanks. Followings [pre]are some sample SQL string:
    [pre]PROCEDURE sp_1st_string
    [pre]IS
    [pre]BEGIN
    [pre]    EXECUTE IMMEDIATE 'CREATE MATERIALIZED VIEW
    [pre]mv_name1 TABLESPACE space_name PARALLEL ( DEGREE [pre]DEFAULT INSTANCES DEFAULT ) BUILD IMMEDIATE REFRESH [pre]COMPLETE ON DEMAND WITH PRIMARY KEY AS SELECT col1, [pre]col2,col3, col4, col5 FROM tableone A, table_two B [pre]WHERE A.id = B.id';
    [pre]COMMIT;
    [pre]END sp_1st_string;
    [pre]PROCEDURE sp_2nd_string
    [pre]IS
    [pre]BEGIN
    [pre]   EXECUTE IMMEDIATE ' CREATE MATERIALIZED VIEW
    [pre]mv_name2 TABLESPACE PDE_DATA PARALLEL ( DEGREE [pre]DEFAULT INSTANCES DEFAULT ) BUILD IMMEDIATE REFRESH [pre]COMPLETE ON DEMAND WITH PRIMARY KEY AS select col1 .. [pre]col10 from tableone a, tabletwo b, tablethree c, [pre]tablefour d, tablefive e, tablesix f where clause;
    [pre]COMMIT;
    [pre]END sp_2nd_string;
    Message was edited by:
            citicbj
    Message was edited by:
            citicbj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    stevencallan:
    Thanks for your advice. I have been thinking the above problem may be [pre]caused by this. If I run 'Create MV statement' in SQL PLUS or Toad, single quote [pre]will work. But when I put hard coded SQL string in package and stored [pre]procedure, it will cause compiling error. After I took off single quote, SP will be [pre][pre]compiled successfully. When I run package.sp, it will cause the problem. [pre]Here is the sample code:[pre]
    [pre]CREATE MATERIALIZED VIEW my_mv TABLESPACE space_name [pre][pre]PARALLEL (DEGREE DEFAULT INSTANCES DEFAULT) BUILD IMMEDIATE [pre]REFRESH COMPLETE ON DEMAND WITH PRIMARY KEY AS select A.ID , [pre]A.CNTL_NUM, C.XX_CODE, D.FIRST_NAME, D.MDL_NAME, [pre]D.LAST_NAME, H.XX_DESC, TO_DATE(TO_CHAR(C.CREAT_TS, [pre]'MM/DD/YYYY'),'MM/DD/YY'), F.STATE, CASE WHEN A.XX_CODE IS NOT NULL [pre]THEN X END, E.X_DESC  from TABLE1 A, TABLE2 B, TABLE3 C, TABLE4 [pre]D, TABLE5 E, TABLE6 F, TABLE7 G, TABLE8 H
    [pre]where D.X_SW = 'X' and B.X_SW = X' and G.X_SW = 'X' and B.CNTL_ID = [pre]A.CNTL_ID and B.CNTL_ID = D.CNTL_ID and B.X_ID = C.X_ID and B.X_ID = [pre]G.X_ID and B.X_ID = F.X_ID and G.X_CD = H.X_CD and B.X_CD = E.X_CD [pre]and E.X_CD = '25' and C.ENRLMT_ID NOT LIKE 'O%'; [pre]
    [pre]When I hard coded this statement in package and sp, I have to take off single [pre]quote ' ' form 'MM/DD/YYYY', 'MM/DD/YY', X_SW ='X', X_CD = '25' AND NOT [pre]LIKE 'O%', Then I can compile whole package successfully. This is why I [pre]mentioned that 1st part 21 simple create statement work because they don't have [pre]these single quote in the statement. In 2nd part with 13 complicated create [pre]statements, some of them have no single quote in the statement. They will [pre]run. Some of them with single quote in statement. They will have the problem [pre]to run if I take off single for compiling. [pre]
    [pre]Please give me some idea what is the reason. Thanks a lot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • How do I change the background color to black? I'd like Photoshop's generated web gallery to display photos against a black background.

    I can't find a place to change the background to black from white. I'd like Photoshop's automated web gallery feature to show photos against a black background once I open the htm file inside Firefox. I use a Mac with OS 10.6.7 (current) on my 27-in.

  • TV AC & PD Problems on 3000 N100 w/ Vista HP

    I noticed there was LOTS more disk activity recently, particularly at startup.  There was never a 'freeze', but the response was definately sluggish.  Looking up what was happening with the Windows Resource Monitor it reported most of the activity wa

  • JavaScript Load Order

    Hi all, I'm using JDeveloper 11.1.1.6.0 and I'm noticing the following behavior: In template jspx I have a <af:resource> tag pointing to a JavaScript library (jQuery) In my fragment jsff I have an <af:resource> tag pointing to a secondary library tha

  • Apache httpd version on waas

    How can I determine the Apache HTTPD version running on the WAAS/WAE?

  • Quality check for consumables

    Hi , I want to do quality check for consumables . When doing GR it is directly expensed to Cost Centre . How can it be posted to quality stock and then then after usage decision it be charged to cost centre . Regards Nandini