Possible encoding problem in sql queries

I am using mac os. I've set everything possible (files, eclipse workspace, database collation, mysql charst) to utf-8 encoding. Still when i send a query, smthing like
SELECT * FROM suppliers WHERE LOWER(name_post)='акцент'
using java, empty resultset is returned (it should be nonempty). My only guess is that cyrillic part of the query is not correctly encoded. I used to have lots of those queries under windows w/o any problem. Is there any way to figure out what is going wrong? (If I select the whole table and then verify the constraint within a java loop it works fine)

If you use a Statement, and concatenate your parameters in like:
String query = "select * from my_table where some_id = " + anId;Oracle will create an execution plan for each id that passes through this bit of code. This execution plan gets stored in the shared pool. The more of these that happens, the fuller the pool gets. Oracle will age out older plans, but this can result in pool fragmentation if there's a lot of "churn" in the pool, which there will be if your queries look like the above.
Eventually you'll hit an ORA-4031, as it can't find a suitable chunk of pool to allocate to a query. Some people see that as "I've run out of pool" and so try to "fix" it by expanding the shared pool size. All this tends to do is delay the inevitable.
What a 4031 actually means is "you're not using bind variables", since binding would result in a single plan being held for the above SQL, since it would actually be stored as "select * from my_table where some_id = ?". Thus no flooding of the shared pool.
So, PreparedStatements aren't just about security, but also about good resource management.
Hopefully that makes sense?

Similar Messages

  • Encoding problem in sql developer

    I have problems with encoding when use timesten database with DatabaseCharacterSet=AL32UTF8. If I use DatabaseCharacterSet=US7ASCII all ok.
    I don't have this problem if connect to timesten using ttisql.
    Server - TimesTen Release 11.2.1.4.0 (64 bit Linux/x86_64) (tt1121:53388) 2009-11-19T19:20:36Z
    Client - TimesTen Release 11.2.1.4.0 (64 bit Linux/x86_64) (tt1121:53388) 2009-11-19T19:20:36Z on Windows XP
    SqlDeveloper - Oracle SQL Developer 2.1.0.63 Build MAIN-63.73
    !http://digilo.com/images/work/sqldeveloper_ecncoding.PNG!

    I can't reproduce this going from SQL Developer on XP with TT 11.2.1.4 32bit installed, to TT 11.2.1.4 32bit on Linux x8664. Can you paste in your DSN settings on the server side and also check the ConnectionCharacterSet setting in the Oracle TimesTen Client DSN Setup (accessed via ODBC Data Source Administrator). Mine is blank. AFAIK SQL Developer should just use AL32UTF8 only as its ConnectionCharacterSet for TT.

  • Collation problem for sql queries

    Hi All,
    We have 1 old database which have collation "Latin1_General_100_CI_AS".
    We have moved this DB to other server & on for this DB collation is "Latin1_General_100_CS_AS"
    There are lots of SQL procedure we had written & all table,field name in case insensitive manner.
    so for new db it will give us error invalid object name because this db is set as "Latin1_General_100_CS_AS".
    Now we can not change the collation of db.
    so please know us how we can achive case insensitivity for object name in query for "Latin1_General_100_CS_AS" collation.
    please help us we are stucked in big issue & it is not easy to change Store procedure as Senstive name of object.

    Anybody have another suggestion for JK?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • PL/SQL Queries in OC

    Is it possible to write normal SQL Queries into the Custom Code of OC?
    for ex -
    "select count(a.visdate) from tablename" or
    "select max(col) from table name"?
    is it also possible to write and set up CURSORS in OC like how we do normally in PLSQL of oracle.

    Hi, Sorry for the late response, hope this helps.
    You would need do the following.
    "Declaration"- Create a cursor
    "Pre-Details" - Use cursor
    "Post-QG-A" Can specify the Qualifying Value here.
    After doing the hard work, you can than use the cursor variables in the validation procedure.
    Thanks,
    Naveen

  • Logging sql queries without any changes in existing apps

    Hi!
    Is it possible to log all SQL queries send from application to database via JDBC without any (or really small) changes in code of existing applications?
    I'm new to JDBC so any suggestions/ideas/best practices are welcome ;)
    Best regards.
    Edited by: matthew_ on Mar 16, 2008 5:35 PM

    Is it possible to log all SQL queries send from application to database via JDBCFirst is an assumption that the driver does in fact sends SQL. It might send some other form.
    But excluding that and excluding that the driver explicitly sends it then you can create a proxy driver. You implement the driver to pass everything to the real driver. Along the way it collects the information.
    You will find that that is quite bit of work. However it impacts the actual code very little and requires nothing more than loading the driver and changing the connection string in the code where it is used.

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • Monitoring Oracle SQL queries in VBA

    I currently use VBA with Excel to generate reports based on data within an Oracle 9 database. The amount of data is very large and the reports can take a long time to process. I have added status bar progress indicators for the majority of the report processing tasks to inform the user of what is going on.
    The problem is that I need to be able to monitor the progress of the main SQL queries since they take upwards of a few minutes to run each (mainly because I need to rank and order data). I currently use code similar to that shown below to query the database from VBA.
    Sub simpleVersion()
    Dim username As String
    Dim password As String
    Dim sid As String
    Dim objSession As Object
    Dim objdatabase As Object
    Dim OraDynaset As Object
    Dim strSQL As String
    username = "user"
    password = "pass"
    sid = "database"
    ' connect to database
    Set objSession = CreateObject("OracleInProcServer.XOraSession")
    Set objdatabase = objSession.OpenDatabase(sid, username & "/" & password, 0&)
    strSQL = "select latitude, longitude, otherdata from scatter where otherdata > 50 order by latitude, longitude"
    ' This command takes a long time to execute when doing ranks/order bys
    Set OraDynaset = objdatabase.DBCreateDynaset(strSQL, 0&)
    Do While OraDynaset.EOF = False
    'Process the data and put on a spreadsheet
    'Status bar messages can be used here without problems
    OraDynaset.MoveNext
    Loop
    Set OraDynaset = Nothing
    Set objSession = Nothing
    objdatabase.Close
    Set objdatabase = Nothing
    End Sub
    When the DBCreateDynaset command is executed VBA waits until the dynaset data is retrieved from oracle. I would like to be able to do something similar to the pseudo code below.
    Execute SQL to create dynaset
    Do while still obtaining dynaset
    Check v$session_longops - Indicate time taken / remaining on status bar
    Loop
    I have found that if you execute a large query without any tasks that require the whole dataset before they can begin (ranks, ordering etc) the dynaset is created almost instantly and excel does not freeze up.
    With non dynaset operations such as inserts it is possible to run the query in non blocking mode. I am able to monitor the progress of the query and indicate it to the user.
    Dim myStatement As OraSqlStmt
    Set myStatement = objdatabase.CreateSql(strSQL, ORASQL_NONBLK)
    Do While myStatement.NonBlockingState = ORASQL_STILL_EXECUTING
    DoEvents
    Select Case intSpinCount
    Case 1
    Application.StatusBar = "Please Wait. Calculating data /"
    Case 2
    Application.StatusBar = "Please Wait. Calculating data -"
    Case 3
    Application.StatusBar = "Please Wait. Calculating data \"
    Case 4
    Application.StatusBar = "Please Wait. Calculating data |"
    intSpinCount = 0
    End Select
    Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
    intSpinCount = intSpinCount + 1
    Loop
    Non blocking mode is explained here. However dynasets are not supported.
    http://download-west.oracle.com/docs/cd/A91202_01/901_doc/win.901/a90173/o4o00022.htm
    I have tried using pl/sql to insert the data requested into a temporary table and then the normal select statement to get the data back out. However since the data stored in a table is not ordered it isn’t much help to me since I still have to do the order by command.
    Anyone got any ideas?
    All help is much appreciated.

    Dear taktang
    I'm a newbie. I'd be grateful if you would tell me where to find "oracle-base"
    thanks
    mik3

  • PLSQL Blocks and SQL Queries in APEX

    Hello,
    Is it possible at all to view undelrying Oracle PLSQL and SQL queries in a run time APEX 3.2 application?
    More elaboratively, can a smart APEX Site user or visitor find a way to see underlying SQL queries and PLSQL code objects?
    Thanks,
    R

    Hi,
    If you just want to see what sql is executed by a session you can use sql trace. This can be switched on for a whole system but is usually more usable when switched on for individual users. The problem with a system like APEX is that database sessions are not directly associated with APEX users and APEX sessions can share database sessions.
    I haven't tried it, but one method that may work is to put a schema logon trigger on the APEX_PUBLIC_USER which switches on tracing when ever this user logs on to the database. It may take a little detective work to understand the sequence of things but all the SQL executed by this user will be recorded and can be analyzed for performance etc. The command to enable SQL tracing could be embedded in the APEX app, but it may be a little random as to which db session has it enabled.
    Perhaps a better tracing option could be seen as a feature request in a future version of APEX.
    Regards
    Andre

  • Erratic Report Region Behavior with Dynamic SQL Queries

    I'm running HTMLDB v 1.5.1.00.12 and I've noticed some odd behavior with report regions using dynamic SQL queries. Every so often, our testers will run a page containing a dynamic sql report region and get the following error, (despite the fact the query was working only moments ago and no other developer has touched it):
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    or sometimes
    failed to parse SQL query:ORA-01403: no data found
    The only solution I've found so far is to:
    1) Make a copy of the failed report region.
    2) Disable or delete the original failed report region.
    The new copy of the report region runs without issue.
    My search of the forums turned up the following two threads, but neither provided me with a clear explanation of the cause, and how to avoid it:
    ORA-06502:PL/SQL: numeric or value error: character string buffer too small
    Re: Import Export Error (ORA-06502)
    The columns being returned are below the 4000 character limit, and the rows being returned are far less than 32k in size.
    Could this have anything to do with the way HTMLDB is internally storing the PL/SQL used to generate the dynamic SQL Query? Is there any known issue related to this with that version of HTMLDB?
    This problem occurs without any discernable pattern or consistency, making it hard to determine where I should focus my efforts in tracking down the cause.

    Hi all,
    My report seems to be behaving correctly once i set it to "Use Generic Column Names (parse query at runtime only)" :)
    Cheers,
    Joel

  • Need help in SQL Queries using GUI controls or variables

    Hello, all
    I have a big problem (I have already had with Visual Basic a few mounths ago) with Java while writing my SQL Queries.
    I would like to know how I must do to use variable data or GUI control data in my SQL Query to select only some records.
    Here, my first Query that works without any problem (no WHERE clause !!!) :
    Statement requeteBedes = connectBedes.createStatement();
    ResultSet resultatSeries = requeteBedes.executeQuery("SELECT * FROM Series");
    initComboBoxSeries(resultatSeries);the method "initComboBoxSeries" fills a JComboBox with all the names of the series in my database.
    Here comes my problem.I would like to use the value of the selected "series" in the JComboBox to search in another table of the same Database. I made another statement but it returns a Null ResultSet :
    ResultSet resultatSearchAlbumsFromSeries = requeteBedes.executeQuery("SELECT * FROM bandes_dess WHERE  ser_nom = '" + strComboBoxSeriesSelected + "' "); The variable strComboBoxSeriesSelected contains the value of the selected line in the combobox with all the series, filled after the first query that is here above and that works very well.
    Could some one help me and tell me how I must use variables or GUI controls values in my SQL Queries or tell me if there is a place where I could find an explanation of that kind of problems (like more "advanced SQL Queries", as the ones currently used in all the Learning Java 2 books)
    Thank you all for your help.
    Christian.

    executeQuery() will never return null. At least that's what the spec says. You are probably catching an exception (probably a syntax error caused by a single quote in strComboBoxSeriesSelected) and ignoring it. Or do you mean the ResultSet contains no rows?
    Anyway, to use parameterized queries, take a look at PreparedStatements. Your code should look like this using PreparedStatement:Statement requeteBedes = connectBedes.prepareStatement("SELECT * FROM bandes_dess WHERE  ser_nom = ?");
    requeteBedes.setString(1, strComboBoxSeriesSelected);
    ResultSet resultatSeries = requeteBedes.executeQuery();Alin.

  • Ruby code for sql queries

    Hello everybody,
    First off, let me apologize if my inquiry does not belong on this forum. I am confident however, that someone here has had experience with this since Oracle and ruby on rails/ruby are used frequently. My fingers are crossed, here's is my problem:
    I am currently working on a database system that utilizes ruby on rails
    with a oracle database. Here's the situation:
    the ruby on rails web application is up and running;
    my oracle database is full of tables that are populated with data;
    there is a successful connection between rails and my oracle database;
    however, what isn't finished is I currently have data mining queries in
    sql (eg. find minimum time someone has been employed = "Select
    min(time) from table...etc") and what I need to do is write one ruby
    program for each of my sql queries so that the ruby program:
    1) connects to the oracle database each time the query is called
    2) runs the sql query on the oracle database
    3) takes the results from the query and returns them in an array or
    something of that nature (so that I can use the results in an html file
    on the ruby on rails web application).
    Again, I apologize if this question does not belong on this forum. If someone however has experience with this could you please give me example code of what this would look like (using different sql queries). Thank you

    I apologize if this question does not belong on this forum. OTN does have a forum dedicated to Ruby/Ruby On Rails. I admit it doesn't seem to get much traffic. I think that's because most people working with Ruby tend to go for F/OSS products.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • SQL queries parser.

    Hello,
    I have quite strange question related to my research.
    Probabley within Oracle DB there is some dynamic library which is parsing SQL queries,
    for example.
    SELECT * FROM schema.table which is able to extract informations from SQL listed above that we want to display all columns from selected table.
    When this construction is valid ( SQL standard ) the next step is verification the object existence in DB. It means
    that there are two separated actions which are analyzing queries.
    I need only first part of that process, which will give me informations about all object used in SQL query
    is it possible to accomodate that internal parser witin stand alone middleware like Weblogic Event Server ?
    I can do it with regular expression patters, but it's not going to be fast and effective for subqueries and all advanced
    constructions for DHW like MODEL, etc.
    Thank You,
    R.

    >
    http://search.cpan.org/~rehsack/SQL-Statement-1.23/lib/SQL/Statement.pm
    BUGS AND LIMITATIONS ^
    * currently we treat NULL and '' as the same - eventually fix
    * No nested C-style comments allowed as SQL99 says
    >
    That's the reason why I want to use dedicated for 11g EE library ;-)
    Thanks for quick reply

  • ? in SQL Queries and not using prepared statements

    Using EclipseLink 1.1.1
    Prepared Statements are disabled
    In our production server something went wrong and one of our Read Queries started erroring. A DatabaseException was thrown and we log the "getQuery.getSQLString()" statement. We found this query in the logs:
    SELECT t1.ID, t1.NAME, t1.DESCRIPTION, t1.EXTREFID, t1.STYLESHEET, t1.DDSVNVERSION, t1.FIRSTNAME, t1.LASTNAME, t1.EMAILADDR, t1.PHONENUMBER, t1.ADDRESS, t1.ADDRESS2, t1.CITY, t1.STATE, t1.POSTALCODE, t1.COUNTRY, t1.ADMINACCTNAME, t1.HASDOCUMENTS, t1.HASTIMEDNOTIFICATIONS, t1.STATUS, t1.ENTRYDATE, t1.EVALEXPDATE, t1.LASTREMINDDATE, t1.FULLUSERS, t1.LIMUSERS, t1.REQUSERS, t1.ISENTERPRISE, t1.EXPDATE, t1.ISDISABLED, t1.DISABLEDDATE, t1.NEEDLICENSEAGREEMENT, t1.ISWARNINGDISABLED, t1.LOCALE, t1.TIMEZONE, t1.CURRENCY, t1.DOMAIN, t1.DOCUMENTSIZE, t1.EXTRADOCUMENTSTORAGE, t1.ONDEMANDOPTIONS, t1.SSOTYPE, t1.RESELLERID, t1.ACCOUNTREPID, t1.LASTUSAGEREPORTDATE, t1.NEXTUSAGEREPORTDATE, t1.USAGEREPORTATTEMPTS FROM T_SSOOPTIONS t0, T_CUSTOMERS t1 WHERE *((((t0.SSOENABLED = ?) AND (t1.SSOTYPE IN (?, ?))) AND (UPPER(t1.DOMAIN) = ?)) AND (t0.CUSTOMERID = t1.ID))*
    Notice the values weren't entered into the where clause. We had to bounce the application to fix the problem. I've never seen this before. I've added more debugging statements to the code - so if this happens again in the future I'll have more information to report on. In the mean time I'm wondering if anyone else has every seen a problem of this nature.

    Database error due to invalid SQL statement.
    I don't have a stack, we were catching the exception and not printing the stack :(
    Like I mentioned in my first post, I added more debugging code (e.printStackTrace()). I understand this is hard to track down without more information. I was just hoping you guys had seen something like this before and had any insight. Like I mentioned before: this is on our production server. I've never seen this type of error before. That particular server (we run in a cluster mode) had been up for several days and then started generating that error. IT bounced the node and everything went back to normal. We have been using toplink for about 5 years now and have never seen this problem, until August 3rd 2009. The only thing that has changed recently is our migration from toplink 10 to EclipseLink. I was wondering if anyone knows if anything had changed in EclipseLink/toplink 11 with the generation of SQL queries.
    I'll keep looking. There is more debugging code in there now. Since the error was "Database error due to invalid SQL statement" this implies the SQL was generated, exited that part of the code and was sent to the db where it failed. I'm afraid the printStackTrace won't help if this error happens again.

  • Problem in SQL Query Execution

    Hi,
    I have tried to Insert Data in Table (Using MySQL) , and as far as i know there is no error in my program and it's executing well with out showing any error and throwing exception. Database connected successfully. I have given the full code here. Help me to execute this program as soon as possible .Thanks in advance.
    Code:_
    public class MysqlConnect{
    public static void main(String[] args) {
    System.out.println("MySQL Connect Example.");
    Connection conn = null;
    String url = "jdbc:mysql://localhost:3306/";
    String dbName = "demo";
    String driver = "com.mysql.jdbc.Driver";
    String userName = "root";
    String password = "root";
    try {
    Class.forName(driver);
    conn= DriverManager.getConnection(url+dbName,userName,password);
    try{
    Statement st = conn.createStatement();
    System.out.println("Connection Established");
    int value = st.executeUpdate("INSERT INTO demo.login VALUES("+17+","+"'G'"+","+"'GG'"+","+70+")");
    System.out.println("1 Row Inserted"+ value);
    conn.close();
    System.out.println("Disconnected from database");
    catch(SQLException Se)
    System.out.println("Exception::SQL Statement Not Executed");
    } catch (Exception e) {
    e.printStackTrace();
    Regards,
    Prabu
    Edited by: [email protected] on Apr 17, 2008 11:10 AM
    Edited by: [email protected] on Apr 17, 2008 11:13 AM

    I think there is some problem in sql statement u have written code as shown bollow
    st.executeUpdate("INSERT INTO demo.login VALUES("17",""'G'"",""'GG'"","70")");
    i think the proper statement is as shown bellow
    st.executeUpdate("INSERT INTO demo.login VALUES('17','G','GG','70')");
    (if all u have 4 columns in u r table of type varchar)
    and if this is not solution for ur problem let me know the table structure , i mean columns and datatype of columns.

  • Multiple SQL Queries in SAP BPC  5.1 EVMODIFY

    Hi All,
    We have multiple SQL Queries in Outlooksoft 4.2 which extracts data from Oracle source system with different set of selections and conditions and parameters. We were able to use multiple SQL Queries in Outlooksoft 4.2 using Transform Data Flow Task and paste parameters using evModify dynamic script task, where ever extract to source system is needed.
    According to  SAP BPC 5.1, all these multiple SQL Queries and extracts by passing parameters will be coded in EVMODIFY dynamic script editor.But, EVMODIFY dynamic script editor is not working with the sets of multiple SQL Queris.It's able to recognize and execute the first SQL Query, but not able to execute from the second SQL Query.
    Does any body, did multiple extracts using SQL Queries to the source system by passing parameters using SAP BPC 5.1 data  manager and SSIS Packages, please let me know, how you did achieve the above functionality.
    Regards,
    Sreekanth.

    Hi Sorin,
    Thanks for your update, I tried declaring the variable between %%....GLOBAL(%GTIMEID%,%SELECTION%) and the package runs now but the problem is that the package is executed using the default date value for the variable GTIMEID declared in the DTSX package and its not taken the date that I'm trying to pass from BPC.  As showed below, please if you could take a look to the ModifyScript and see the last line for the global variable and line 13  PROMTP(SELECTINPUT,%SELECTION%,,,%TIME_DIM%) where I am selecting the TIMEID:
    DEBUG(ON)
    PROMPT(INFILES,,"Import file:",)
    PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    PROMPT(RADIOBUTTON,%CLEARDATA%,"Select the method for importing the data from the source file to the destination database",0,{"Merge data values (Imports all records, leaving all remaining records in the destination intact)","Replace && clear data values (Clears the data values for any existing records that mirror each entity/category/time combination defined in the source, then imports the source records)"},{"0","1"})
    PROMPT(RADIOBUTTON,%RUNLOGIC%,"Select whether to run default logic for stored values after importing",1,{"Yes","No"},{"1","0"})
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when importing data.",1,{"Yes, check for work status settings before importing","No, do not check work status settings"},{"1","0"})
    INFO(%TEMPFILE%,%TEMPPATH%%RANDOMFILE%)
    PROMPT(SELECTINPUT,%SELECTION%,,,%TIME_DIM%)
    TASK(CONVERT Task,INPUTFILE,%FILE%)
    TASK(CONVERT Task,OUTPUTFILE,%TEMPFILE%)
    TASK(CONVERT Task,CONVERSIONFILE,%TRANSFORMATION%)
    TASK(CONVERT Task,STRAPPSET,%APPSET%)
    TASK(CONVERT Task,STRAPP,%APP%)
    TASK(CONVERT Task,STRUSERNAME,%USER%)
    TASK(Dumpload Task,APPSET,%APPSET%)
    TASK(Dumpload Task,APP,%APP%)
    TASK(Dumpload Task,USER,%USER%)
    TASK(Dumpload Task,DATATRANSFERMODE,1)
    TASK(Dumpload Task,CLEARDATA,1)
    TASK(Dumpload Task,FILE,%TEMPFILE%)
    TASK(Dumpload Task,RUNTHELOGIC,1)
    TASK(Dumpload Task,CHECKLCK,1)
    GLOBAL(%GTIMEID%,%SELECTION%)
    Do you guess That I am missing something?
    Thanks in advanced
    Regards

Maybe you are looking for