Trouble with sql dates getting Monday of this week

Hi
How do I get the Monday of this week. I am using:
<code>next_day(trunc(sysdate,'DAY'),'Monday')</code>
but get the coming Monday. Initially this code was working before apex was upgraded from 3.0 to 3.1.
Why would this stop working.
But if I was to use
<code>next_day(trunc(sysdate,'DAY'-7),'Monday')</code>
thanks
Tony

Hi Scott
thats what I thought but I was not getting the present week's Monday. I am trying to get the Sunday and Monday of the present week so have had to put a
-7 next to the sysdate.
The Application I have been using was running in but when there was an upgrade to apex 3.1 then the returned dates have not been correct.
thanks
Tony

Similar Messages

  • Is anyone facing the similar problem of visible lag while opening app with 3G data on? It seems apple has made 5s slow to improve iphone 4 performance.5s was very smooth on 7.0.6 even with 3G data on. Is this a bug? Is apple going to fix this soon?

    Is anyone facing the similar problem of visible lag while opening app with 3G data on? It seems apple has made 5s slow to improve iphone 4 performance.5s was very smooth on 7.0.6 even with 3G data on. Is this a bug? Is apple going to fix this soon?

    I have same Problem. I tried all options - Reset All Settings, Erase Content & reset all settings, Upgrated to IOS8.1, Restore using iTune. But problem persists.
    When I turn Cellular Data or Wifi ON, then there is a lag while opening the Apps. But If I turn Data/Wifi off, phone becomes super fast. I have checked with my friends. They are not facing this issue. Not sure if Apple know this.

  • Trouble with SQL Expressions

    Hello everyone,
    I'm having trouble with this SQL expression that works in 8.5, and XI R2 runtime and designer, but I cannot edit the expression.  As soon as I open the SQL Expression and click the X-2 check button, the error following
    SQL Expression I'm trying to run:
    (Select Distinct b1.CandEmploymentType
        from ceistaffing a1
        inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where a1.Staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID"
        and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    The Errror I Receive After Clicking the X-2 button:
    Crystal Reports
    Error in compiling SQL Expression :
    Failed to retrieve data from the database.
    Details: ADO Error Code: 0x
    Source: SalesLogix OLE DB Provider
    Description: The multi-part identifier "CEIHRPROJECTEDACTUAL.STAFFINGCHAINID" could not be bound.
    Native Error:  [Database Vendor Code: 181797304 ].
    OK  
    This is the SQL statement passed to the database:
    SELECT (Select Distinct b1.CandEmploymentType
    from ceistaffing a1
    inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where a1.Staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID"
    and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    If I reverse the order of the where clause as follows, I do not get the error
    (Select Distinct b1.CandEmploymentType
    from ceistaffing a1
    inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where CEIHRPROJECTEDACTUAL."STAFFINGCHAINID" = a1.Staffingchainid
    and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    This is the working SQL statement passed to the database.
    SELECT (Select Distinct b1.CandEmploymentType
    from ceistaffing a1
    inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
    Where CEIHRPROJECTEDACTUAL."STAFFINGCHAINID" = a1.Staffingchainid
    and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
    FROM   "sysdba"."CEIHRPROJECTEDACTUAL" "CEIHRPROJECTEDACTUAL"
    I figured I would just reverse the where clause statements, but then I came to this one that I couldn't get to work:
    (Select case when tmp.restartcount = 0 then 'F' else 'T' end from
    (Select Count(b.restart) as restartcount from ceistaffing a inner join ceihrprojectedactual b on a.staffingchainid = b.staffingchainid
    where a.candcontactid = (Select distinct candcontactid from ceistaffing a2 where a2.staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID")
    and b.restart = 'T'
    and a.createdate = (Select min(a1.createdate) from ceistaffing a1
                   where a1.createdate > (Select max(a3.createdate)
                                  from ceistaffing a3
                                  where a3.staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID")
                   and a1.candcontactid = a.candcontactid)) as tmp )
    I've burned an entire day trying to find some solution.  Are there any patches out there that will fix this?
    I'm running Crystal Report XI Release 2 SP2 - Version 11.5.8.826
    Thank you, ...Rob

    Okay, to simplify the illustration of the problem Iu2019m facing, Iu2019ve created a bare bones example as described below:
    I've created a report that returns all contacts from our "CONTACT" table.  On the report, I've created a SQL expression to return a count of all contacts with the similar last name, as shown below:
    (Select count(a1.ContactID) from CONTACT a1 where a1.LASTNAME = "CONTACT"."LASTNAME")
    When I try to save the SQL expression,  I get this error:
    Crystal Reports
    Error in compiling SQL Expression :
    Failed to retrieve data from the database.
    Details: ADO Error Code: 0x
    Source: SalesLogix OLE DB Provider
    Description: The multi-part identifier "CONTACT.LASTNAME" could not be bound.
    Native Error:  [Database Vendor Code: 205193720 ].
    OK  
    This SQL expression works fine in CRW 8.5, but no luck in XI R2 SP4 - As mentioned above in the thread, this seems to be an issue solely with how XI R2 is parsing the SQL Expression.  If I remove the "A1" alias from my expression all is good, but that will not work for some of the more advanced SQL expressions I have that are using joins and sub queries.
    What will it take to get this recognized as an issue worthy of a hot fix?  I'm at a stand-still here, facing the unfortunate possibility of having to re-architect many of my reports.  Please help.
    Thank you, ...Rob
    Edited by: Rob Bartram on Aug 6, 2008 3:45 PM

  • Help with SQL Date

    Hi
    How can I convert a string in 'YYYYMMDD' format to SQL date (in the format 'YYYYMMDD' and also 'YYYYMMDD HH24:MI:SS) to use in my SQL-query (for Oracle Database)
    Thanks for your help
    Praveen Padala

    Hi
    How can I convert a string in 'YYYYMMDD' format to
    SQL date (in the format 'YYYYMMDD' and also 'YYYYMMDD
    HH24:MI:SS) to use in my SQL-query (for Oracle
    Database)
    Thanks for your help
    Praveen PadalaI've done quite a few dates from Java to an Oracle DB. I like to use the SimpleDateFormat class in the java.text packadge.
    import java.text.*; //Use this import
    //In your class
    SimpleDateFormat myDateFormatter = new SimpleDateFormat("dd-MMM-yyyy", new Locale("en","US"));
    //The .format method returns a string. With this format string it can be included in an SQL command
    myDateFormatter.format(myDate);
    You can also use a SimpleDateFormat object with the format of your other dates to get a Date object that can be given to the SimpleDateFormat object set up to format in Oracle compatable form.
    myDate is an object of type Date.
    Hope this helps!
    Kevin.

  • Essbase Studio Error(1021001): Failed to Establish Connection With SQL Data

    Hi.
    I have trying to deploy a cube with Essbase Studio but I get the error: "*Error(1021001): Failed to Establish Connection With SQL Database Server*"
    My environment is Linux 5, Oracle 11g and EPM 11.1.1.2. Oracle database and Essbase was installed with diferent users. In the .bash_profile of hypadmin user (that install Essbase) I have set the following variables
    ORACLE_BASE=/u01/app/oracledb/product/11.1.0
    ORACLE_HOME=$ORACLE_BASE/db_1
    LD_LIBRARY_PATH=/usr/X11R6/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    ORACLE_HOSTNAME=devbi.sigfe2
    PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$ORACLE_HOME/bin:/sbin:$ORACLE_HOME/opmn/bin:$PATH
    ORACLE_SID=orcl
    JAVA_HOME=/u01/app/installfiles/jdk1.5.0_19
    In my pc (windows xp) I can open Essbase Studio console, do the connection to Oracle database, get tables and create minischema, mesures and hierarchies (I can see the preview of hierarchies). Also I can create cubes with EAS and can connect with MAXSHELL to essbase.
    When I try to deploy the cube from Essbaes Studio y get the error "Error(1021001): Failed to Establish Connection With SQL Database Server".
    The Essbase Studio Log File say:
    +12:40:16 07/24/09 (admin-1) INFO Start creating outline in database "5.4.0.41:1423.POC_ESS.POC_ESS1"...+
    +12:40:16 07/24/09 (admin-1) FINA Sign on Essbase by CSS token "5.4.0.41:1423" successfully...+
    +12:40:16 07/24/09 (admin-1) INFO Start building dimension "DM_CIUDADES" ...+
    +12:40:16 07/24/09 (admin-1) MÁS FINA Start creating rule file ...+
    +12:40:16 07/24/09 (admin-1) INFO SQL statement has been created and put into rule file "/home/hypadmin/hyperion/products/Essbase/EssbaseStudio/Server/./ess_japihome/data/DM_CIU.rul"+
    +12:40:16 07/24/09 (admin-1) INFO The query is "SELECT (CONCAT('reg_',CAST(cp_105."ID_REGIONPADRE" AS VARCHAR2(1000)))) as "REGION_PADRE", (CONCAT('reg_',CAST(cp_105."ID_REGION" AS VARCHAR2(1000)))) as "REGION_HIJO", cp_105."DE_REGION" as "REGION_HIJO.Default" FROM "POC"."DM_REGIONES_ESS3" cp_105 ORDER BY cp_105."DE_NIVEL" ASC, cp_105."ID_REGIONPADRE" ASC, cp_105."ID_REGION" ASC"+
    +12:40:16 07/24/09 (admin-1) INFO Rule file has been created and saved as "/home/hypadmin/hyperion/products/Essbase/EssbaseStudio/Server/./ess_japihome/data/DM_CIU.rul"+
    +12:40:16 07/24/09 (admin-1) FINA Essbase starts to add members to DM_CIUDADES dimensioin based on the rules file.+
    +12:40:16 07/24/09 (admin-1) ADVERTENCIA (1021001): Error al establecer conexión con el servidor de bases de datos SQL. Consulte el registro para obtener más información.+
    +12:40:16 07/24/09 (admin-1) ADVERTENCIA essbaseDriver.FailedToBuildDimensionException+
    +12:40:16 07/24/09 (admin-1) GRAVE Unexpected exception in EssbaseExport prevented cube from being deployed+
    -------------- Exception --------------
    com.hyperion.cp.datasources.export.essbase.EssbaseDriverException: Failed to deploy Essbase cube
    Thanks in advance to all that have any idea to help me to solve this issue.
    A.S.

    Hi,
    If you type database SID in lowercase, try to reenter iot in uppercase. Strange, but I and my colleagues encounter this behaviour many times.

  • Trouble with a SELECT stament?Is this is a bug or am i an idiot

    DB version:10g Enterprise Edition Release 10.2.0.3.0
    I have a simple SELECT statement like
    SELECT ship_dtl.track_id,{color:#ff0000}_{color}ship_dtl.cons_id from ship_dtl
    If there is a space between coma and ship_dtl.cons_id in the query(a red underscore is used above to show the space). This query will give the error
    {noformat}ERROR at line 1:
    ORA-00942: table or view does not exist
    {noformat}
    But i don't get this issue with other tables. Why is this happening?
    Edited by: canine_Joe on Sep 4, 2008 3:04 AM

    canine_Joe wrote:
    How many lines of output do i to post to convince you?Ok, well let me be blunt...
    It's not a bug. It can't possibly be.
    Thousands, if not millions, of Oracle developers have been writing queries with or without spaces between their columns in the select clause for a long time now without any issue.
    The fact that Oracle is reporting the table is not found indicates that there's some other issue at hand.
    What version of SQL*Plus are you using against your 10.2.0.3 database? Maybe that's out of date and has a bug or is incompatible with 10.2.0.3. for some reason.
    What user/schema owns the table and what user is running the SQL?
    What permissions are on the table?
    What synomyms exist?
    Is there a problem with keyboard mappings on your client or the language settings on client or Oracle server, so the space isn't really a space character?
    How about taking your query with the space and doing...
    select dump('SELECT ship_dtl.track_id, ship_dtl.cons_id from ship_dtl;') from dual;and seeing what each character is in the string, just to confirm it's a chr 32 (space).
    There may be other reasons too...

  • Trouble with SQL datetime format

    I have written a VI to import a CSV file into a SQL data table but I
    cannot get it to work when using a table with "datetime" data
    format.  It will import into a new table with undefined data
    formats as "varchar" format but no luck when going into a table with the "datetime" data
    format.   I need the datetime format for date/time queries later.
    I have attached a zip file of my VI and the CSV file.  Is there a problem with my CSV format or I am I doing
    something else wrong here?
    Please help.
    Thanks,
    Greg
    Attachments:
    SQL issue.zip ‏54 KB

    Greg
    I have just tried to insert your data into a SQL Server (MSDE) database.
    I found that the INSERT data didn't work. The TRUE for Create Table didn't seem to do any thing. So I created a table using labview like this
    And this is its design.
    I then run the vi again and it starts to work with no issues. So it looks like the Create Table?=TRUE for the INSERT doesn't seem to work on SQL Server. It looks like you need to create the table first.
    Here is your data in the database
    Let me know what you think
    David
    Message Edited by David Crawford on 04-28-2006 11:17 AM
    Attachments:
    Your Data.jpg ‏32 KB
    Create Table.jpg ‏20 KB
    Table Design.jpg ‏15 KB

  • HT6378 Is anyone havig trouble with the date of uploaded photos?

    I am using iCloud Photo Library since its launch, and I am uploading all of my pictures, even those taken with my DSLR camera. The beta app works fine, but the photos I uploaded are presented with the date different from that one taken. I looked at the time and date of any modification, but even this is different from the date registered on the iCLoud Photo Library. Is anyone having the same problem?

    The uploaded files still contain the original digitized date/time. You can test this by downloading or emailing a photo from iCloud.com or from your iPad/iPhone and then checking the metadata. This is also the case for photos taken on the iPhone or iPad and uploaded to iCloud Photo Library directly. Again, the digitized date/time is correct in the image file.

  • Open Toad Data Modeler diagram with SQL Data Modeler

    hi, I've made a diagram with TOAD Data Modeler in Windows. Now I'm working with Linux, so I need a portable application to work with. Oracle SQL Data Modeler seems to be the solution to my problems, but I can't open/import my TOAD's diagrams into SQL Data Modeler.
    Anyone knows how to do it?
    Thanks in advance,
    Neuquino
    Edited by: Neuquino2 on Nov 1, 2010 1:30 PM

    Hi Neuquino,
    there is no import from TOAD Data Modeler. You can generate DDL script with TOAD DM and import that script.
    Philip

  • Having trouble with Mercury Engine, do I have this right?

    Ok, so after many months of looking for a replacement for Sony Vegas Pro we decided that the Adobe solution was the best option for our needs and bought a license for CS5 and two new machines for our video editing.
    The desktop is a poweful beast with the latest and greatest installed, and we also invested in a new laptop which was custom built for on the road editing. This laptop includes the GeForce GTX285M graphics engine but for some reason the Mercury engine within CS5 is not working with this card.
    Can someone explain why this is the case and what the solution may be? I am new to Adobe software so have I installed evrything correctly or is there something I need to install or change within the program to get the mercury engine working with the card. I have tried the usual route with the drop down for Renderer but it is greyed out.  Help?

    This laptop includes the GeForce GTX285M graphics engine but for some reason the Mercury engine within CS5 is not working with this card. 
    Can someone explain why this is the case and what the solution may be?
    Hardware acceleration doesn't work, officially, with any laptop GPU chipset at this time. Search around here for the "GPU hack."

  • Trouble with SQL Anywhere 16

    We are having an issue with SQL Anywhere 16 and were wondering if there is a patch/fix or something that we need to look elsewhere. Our tester is being kicked out of out Sybase application whenever doing certain types of queries and as a result the database is being shutdown. We then have to go back into Sybase 16 and restart the database. We do not recall having this problem with SQL Anywhere 11.5. We have just recently upgraded to SQL Anywhere 16.

    Hi Lawrence,
    I think there's some confusion from both groups on this question. There was never a SQL Anywhere 11.5 version - we had SQL Anywhere 11.0.0, and SQL Anywhere 11.0.1. There was an ASE 11.5 and ASE 16.0 release though, so it is confusing to know which product you are inquiring about based on the version.
    Please provide some further details about which product you are using, the method in which you're using to start your database, and the connection strings that you're using. Hopefully with some more specific database configuration information, we can help you figure out which database product you're looking for additional help on and provide some suggestions.
    Thanks,
    Jeff Albion
    SAP Active Global Support

  • Please Help with sql.Date problem

    I have spent alot of time on what I thought would be an otherwise simple task, and I beleive I am close to completion but I need some much needed help. I have posted various forms of my code to try and acheive the solution but the responses received have been limited.
    I am trying to delete a record from a MS Access database where a Date/Time field in the database (Err_Date) equals a date entered by the user via a textbox.
    I finally have gotten the correct record to delete from the database, but what is very strange is that Tomcat is throwing a 'java.lang.NullPointerException' error. Then when I re-open the database the correct record is deleted.
    Here is my code:
    <%@page import="java.sql.*"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <%@ page import="java.util.Date"%>
    <%
    Connection con = null;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:errorlog", "admin", "");
    catch(Exception e){
         out.println(e.getMessage());
    ResultSet rs=null;
    Statement stmt=null;
    try {
    stmt=con.createStatement();
    String end = request.getParameter("To");//FROM TEXTBOX
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ("dd/MM/yyyy");
    java.util.Date d2 = df.parse(end);//CONVERT STRING TO UTIL DATE
    java.sql.Date date2 = new java.sql.Date(d2.getTime());//CONVERT TO SQL
    PreparedStatement stmnt = con.prepareStatement("DELETE FROM tblError WHERE Err_Date = ?");
    stmnt.setDate(1, date2);
    stmnt.executeUpdate();
    stmnt.close();          
    //CLOSE RESULT SET          
    rs.close();
         stmt.close();
    con.close();
    //CATCH EXCEPTIONS
    catch (SQLException e) {
         out.println(e.getMessage());
    %>

    well, in case anyone ever runs into a problem this stupid again the solution is as follows.
    the code to:
    1. retrieve date from text box
    2. covert string into util date
    3. convert util date into sql date
    4. delete from database
    is all correct.
    the problem is that I previously used String sql="SOME SQL DELETE" and then executed the result set, which of course I then had to close. This wasn't working so I switched to a Prepared Statement. I forgot to remove the 'rs.close()' statement in my code. So Tomcat was trying to close a result set that was never opened...

  • How can I make a report of all records with the date in the last two weeks?

    Hi!
    I have records with a date field, I want to create a report that only includes records with a date which is within the last two weeks of the system date, is this possible? Surely this is a basic database function, I would have thought, but I can find no help about it and there's very little in Mac Help about doing anything other than simple stuff with reports.
    I'm not a genius with databases, so help with any required formula or what have you would be great!

    Hi Jonathan,
    Here's a formula you can use with the Match function. 'Date' is the name of the date field, which must be a "Date" type field.
    'Date'>NOW()-14
    Match will select (highlight) all records matching the query. You'll then need to use Organize > Hide Unselected to show only the matches.
    Unfortunately, I haven't found a way to make the NOW() function work in a Find request, and neither Match requests nor Hide Unselected can be included in a recorded search, either of which would reduce repeating the report to a one-button operation.
    Regards,
    Barry

  • Trouble with database data retrieving!!!Please someone help me!!

    Hello people!!
    I'm havin g a trouble in getting the data from a bean , someone could give me a hand?
    That's the following: The Database class get a conection, a DetalhesLivro.class arraylist
    is obtained with the method getBooks, and I start my servlets apllication with contextListener
    where i staciate this class, so when i retrieving the value the browser keep too long loading
    and give me no data from the class here is piece of code :
    the context:
    package servlets;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.*;
    public final class Contexto implements ServletContextListener{
    private ServletContext context = null;
    public Database db;
    public void contextInitialized(ServletContextEvent event) {
    context = event.getServletContext();
    try {
    db = new Database();
    context.setAttribute("dados", db);
    } catch (Exception ex) {
    System.out.println("Imposs�vel a cria��o do bean:" +
    ex.getMessage());
    public void contextDestroyed(ServletContextEvent event) {
    context = event.getServletContext();
    Database lixo = (Database)context.getAttribute("dados");
    if (lixo != null)
    lixo.remove();
    and this is the class to retrieving the data :
    package servlets;
    import java.io.*;
    import java.sql.SQLException;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Resultado extends HttpServlet {
    DetalhesLivros livro;
    Database db;
    ArrayList livros;
    public void init() throws ServletException {
    db = (Database)getServletContext().getAttribute("dados");
    if (db == null){
    throw new UnavailableException("Couldn't get database.");
    public void destroy() {
    db = null;
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    /* HttpSession session = request.getSession();
    procura = (Procura)session.getAttribute("dados"); */
    response.setContentType("text/html");
    response.setBufferSize(8192);
    String valorRadio = request.getParameter("radio");
    String valorInput = request.getParameter("campo");
    try{
    livros = db.getBooks();
    }catch(Exception e){
    e.getMessage();
    PrintWriter out = response.getWriter();
    // then write the data of the response
    out.println("<html><head><title>Livraria Online!!!</title></head><body><div align=\"center\"><p><strong>"+
    "<p><font size=\"+7\">Loja de Livros</font></p>");
    Iterator iterator = livros.iterator();
    try{
    while(iterator.hasNext()){
    if(valorRadio=="titulo"){
    livro = (DetalhesLivros)iterator.next();
    if(livro.getTitulo()==valorInput){         
    out.println("<p> </p><p><strong>Nome do Livro:"+livro.titulo+
    "</strong></p><p><strong>Autor:"+livro.autor+"</strong></p><p><strong>Pre&ccedil;o:"+livro.getPreco()+"</strong>"+
    "</p><p><strong>C&oacute;digo:"+livro.getCod()+"</strong></p>");
    break;
    break;
    }catch(Exception e){
    e.getMessage();
    out.println("<p></p><br><br><br><table width=\"48%\" border=\"0\"><tr><td width=\"60%\"><a href=\"\"><strong>Pesquisar</strong>"+
    "</a></td><td width=\"40%\"><a href=\"\"><strong>Listar</strong></a></td></tr></table><strong>"+
    "</strong></div></body></html>");
    out.close();
    thanks a lot for some help!!!

    sorry!!
    package servlets;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.*;
    public final class Contexto implements ServletContextListener{
        private ServletContext context = null;
        public Database db;  
        public void contextInitialized(ServletContextEvent event) {
            context = event.getServletContext();             
            try {
                  db = new Database();
                  context.setAttribute("dados", db);
            } catch (Exception ex) {
                System.out.println("Imposs�vel a cria��o do bean:" +
                    ex.getMessage());
        public void contextDestroyed(ServletContextEvent event) {
            context = event.getServletContext();
            Database lixo = (Database)context.getAttribute("dados");
            if (lixo != null)            
                   lixo.remove();                     
    }package servlets;
    import java.io.*;
    import java.sql.SQLException;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Resultado extends HttpServlet {
    DetalhesLivros livro;
    Database db;
    ArrayList livros;
    public void init() throws ServletException {
    db = (Database)getServletContext().getAttribute("dados");
    if (db == null){
    throw new UnavailableException("Couldn't get database.");
    public void destroy() {
    db = null;
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    /* HttpSession session = request.getSession();
    procura = (Procura)session.getAttribute("dados"); */
    response.setContentType("text/html");
    response.setBufferSize(8192);
    String valorRadio = request.getParameter("radio");
    String valorInput = request.getParameter("campo");
    try{
    livros = db.getBooks();
    }catch(Exception e){
    e.getMessage();
    PrintWriter out = response.getWriter();
    // then write the data of the response
    out.println("<html><head><title>Livraria Online!!!</title></head><body><div align=\"center\"><p><strong>"+
    "<p><font size=\"+7\">Loja de Livros</font></p>");
    Iterator iterator = livros.iterator();
    try{
    while(iterator.hasNext()){
    if(valorRadio=="titulo"){
    livro = (DetalhesLivros)iterator.next();
    if(livro.getTitulo()==valorInput){         
    out.println("<p> </p><p><strong>Nome do Livro:"+livro.titulo+
    "</strong></p><p><strong>Autor:"+livro.autor+"</strong></p><p><strong>Pre&ccedil;o:"+livro.getPreco()+"</strong>"+
    "</p><p><strong>C&oacute;digo:"+livro.getCod()+"</strong></p>");
    break;
    break;
    }catch(Exception e){
    e.getMessage();
    out.println("<p></p><br><br><br><table width=\"48%\" border=\"0\"><tr><td width=\"60%\"><a href=\"\"><strong>Pesquisar</strong>"+
    "</a></td><td width=\"40%\"><a href=\"\"><strong>Listar</strong></a></td></tr></table><strong>"+
    "</strong></div></body></html>");
    out.close();
    --------------------------------------------------------------------------------------------

  • Trouble with SQL loader

    Hello there,
    I am trying to load some data to a temp table for normalization but I am getting errors and nothing loads.
    My table is as below
    CREATE TABLE CA(
    OLD_SYSTEM_ID   VARCHAR2(25),
    OLD_DESCRIPTION VARCHAR2(35),
    ORDER_DATE      DATE,
    SHIP_DATE       DATE,
    QUANTITY        NUMBER);My Control file is like this
    LOAD DATA
    INFILE Ca.fwf
    BADFILE Ca.bad
    INTO TABLE CA
    old_system_id    POSITION (1:19) VARCHAR2,
    old_description  POSITION (20:27) VARCHAR2,
    order_date       POSITION (28:35) DATE,
    ship_date        POSITION (36:43) DATE,
    quantity         POSITION (44:47)
    )And my data is like this:
    CA-91003-KTS:2452-10000218619930205199303021
    CA-91003-KTS:2452-2000009171993020519930302100
    CA-91003-KTS:2452-3000009261993020519930302500
    CA-91003-KTS:2452-40000094619930205199303025
    CA-91003-KTS:2477-10000218619930319199304141
    CA-91003-KTS:2477-2000009171993031919930414100
    CA-91003-KTS:2477-3000009261993031919930414500
    CA-91003-KTS:2477-40000094619930319199304145
    CA-91003-KTS:2497-10000218619930519199306141I get this error:
    SQL*Loader: Release 9.2.0.1.0 - Production on Tue Oct 3 10:16:00 2006
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    SQL*Loader-350: Syntax error at line 6.
    Expecting valid column specification, "," or ")", found "VARCHAR2".
    old_system_id    POSITION (1:19) VARCHAR2,Any ideas why? this is happening on 8 different loads although they are all similar, is it to do with VARCHAR2 and commas?
    Regards
    Mike

    What happens when you try to load without any date mask? Does it get rejected? May be you should request your upstream system to send the date values in similar format?.
    If there are going to be only two formats i.e.,DD-MON-YY and DD/MM/YY then you can use decode function. something like below
      "decode(instr(:order_date,'-'),0,to_date(:order_date,'DD/MM/YY'),to_date(:order_date,'DD-MON-YY'))"Post the code which you tried. I dont have acces to database at home so the above code snippet is not tested.

Maybe you are looking for

  • How do I keep my tab groups in my toolbar after restarting...all of a sudden they disappear on restart. I have the restore tabs option on but the groups aren't

    I have 2 problems....... 1.recently on restarting Firefox, all my tab groups disappear...the tabs there but not in my tab groups.... I have the preference set to open all tabs and can't find anything to say open tabs in groups....can you help? I am w

  • Version 6 screen

    I've just installed Version 6 of i-Tunes on my laptop and am really annoyed that approx the bottom third of the screen is now filled with iTunes Music Store clutter. Is there any way to reduce or eliminate this from my screen so that only the song li

  • Case Statement doesn't switch.

    Hello, I'm having an odd problem with a case statement.  I'm passing is a Boolean that is false but the case statement never switches over to the 'false' loop.  I have attached a word doc that has the screen shot of this being single stepped through.

  • Compile error during deployment. (App. Server 8 with Mysql)

    I am using Sun Application Server 8 with several Mysql databases. When I attempt to deploy my .EAR, the App Server's CMP compiler gives an error regarding missing JDO classes. I did try dowloading JDO from java.sun.com, but noted that the jdo jars do

  • IPHONE 4S NO SERVICE ISSUE

    I purchased my Factory unlocked iphone 4s sometime now and it was working fine. Then I updated the os to 7.1.2 and now I am getting No service constantly. I HAVE TRIED EVERYTHING TO REMEDY THIS ISSUE, READ COUNTLESS PAGES HERE SO I HAVE BASICALLY GIV