Results 1 to 3 of 3
  1. #1
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default ñ in an oracle query

    I have this problem when I try to execute this code:
    Java Code:
      
                String sql="SELECT DISTINCT M.AÑO_PERIODO_ACADEMICO_EST,NUM_SEM_PERIODO_ACAD_EST FROM CARRERA C,MATRICULA M,PERIODO_ACADEMICO P,ESTUDIANTE E WHERE C.CODIGO_ESTUDIANTE=? AND P.AÑO=M.AÑO_PERIODO_ACADEMICO_EST AND P.NUMERO=M.NUM_SEM_PERIODO_ACAD_EST AND E.TIPO_DOCUMENTO=C.TIPO_DOCUMENTO_EST AND E.NUMERO_DOCUMENTO=C.NUMERO_DOCUMENTO_EST AND C.TIPO_DOCUMENTO_EST=M.TIPO_DOCUMENTO_EST AND C.NUMERO_DOCUMENTO_EST=M.NUMERO_DOCUMENTO_EST AND ( m.COD_SITUACION_ACADEMICA_EST NOT IN ('C','G','F','S','T','P') OR m.COD_SITUACION_ACADEMICA_EST IS NOT NULL ) AND m.COD_SITUACION_ACADEMICA_EST!='T'";
                    
             prpStmt = connection.prepareStatement(sql);
             int i=1;
             prpStmt.setInt(i++,codigo_estudiante);
                      
                resultSet = prpStmt.executeQuery();
    But it returns me an error because of the character "ñ"
    I need this ñ, I can't delete it, how can I fix that?

  2. #2
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    7

    Default

    I had the same problem, and I resolved it putting "\" before the word with ñ starts

    Java Code:
    String sql="SELECT DISTINCT
    M.\"AÑO_PERIODO_ACADEMICO_EST\", NUM_SEM_PERIODO_ACAD_EST FROM CARRERA
    C,MATRICULA M,PERIODO_ACADEMICO P,ESTUDIANTE E WHERE
    C.CODIGO_ESTUDIANTE=? AND P.AÑO=M.\"AÑO_PERIODO_ACADEMICO_EST\" AND
    P.NUMERO=M.NUM_SEM_PERIODO_ACAD_EST AND
    E.TIPO_DOCUMENTO=C.TIPO_DOCUMENTO_EST AND
    E.NUMERO_DOCUMENTO=C.NUMERO_DOCUMENTO_EST AND
    C.TIPO_DOCUMENTO_EST=M.TIPO_DOCUMENTO_EST AND
    C.NUMERO_DOCUMENTO_EST=M.NUMERO_DOCUMENTO_EST AND (
    m.COD_SITUACION_ACADEMICA_EST NOT IN ('C','G','F','S','T','P') OR
    m.COD_SITUACION_ACADEMICA_EST IS NOT NULL ) AND
    m.COD_SITUACION_ACADEMICA_EST!='T'";

  3. #3
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    the field that has the "ñ" put " "
    Java Code:
     SELECT "Id_Niño", Date FROM "niños"

Similar Threads

  1. Help in Query
    By geeta_ravikanti in forum JDBC
    Replies: 0
    Last Post: 03-31-2008, 01:16 PM
  2. Using sql:query tag
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-15-2008, 03:13 PM
  3. Using sql:query tag
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-14-2008, 09:31 AM
  4. Replies: 1
    Last Post: 07-24-2007, 12:15 AM
  5. oracle query with date question
    By orchid in forum JDBC
    Replies: 1
    Last Post: 05-09-2007, 12:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •