Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

"ORA-01843: not a valid month" when reading data from MySQL database

Jose ArósteguiAug 10 2023

Hi experts,

I'm using Oracle 12.2.0.1.0 and I'm querying data against an external MySQL database using Heterogenous Services (dg4odbc).

I have this view:

CREATE OR REPLACE VIEW APPS.ODSALLOGA_PEDIDOS_ALLO_CAB AS
SELECT
 /*$Header:$*/
   "estado_pedido"       estado_pedido
  ,"time_insercion"      time_insercion
  ,"id_distribucion"     id_distribucion
  ,"cabecera"            cabecera
  ,"codigo_cliente"      codigo_cliente
  ,"pedido_cliente"      pedido_cliente
  ,"lineas"              lineas
  ,"unidades"            unidades
  ,"tipo_proceso"        tipo_proceso
  ,"fecha_albaran"       fecha_albaran
  ,"mensaje_error"       mensaje_error
  ,"timestamp"           TIMESTAMP
  ,"fecha_actualizacion" fecha_actualizacion
  ,"division"            division
 FROM "pedidos_cabeceras"@odsalloga;

Output of DESC command:


Name                Null?    Type            
------------------- -------- --------------- 
ESTADO_PEDIDO       NOT NULL NVARCHAR2(4,5)  
TIME_INSERCION      NOT NULL NVARCHAR2(30)   
ID_DISTRIBUCION     NOT NULL NVARCHAR2(37,5) 
CABECERA            NOT NULL NVARCHAR2(45)   
CODIGO_CLIENTE      NOT NULL NVARCHAR2(9)    
PEDIDO_CLIENTE      NOT NULL NVARCHAR2(45)   
LINEAS              NOT NULL NUMBER(10)      
UNIDADES            NOT NULL NUMBER(10)      
TIPO_PROCESO        NOT NULL NVARCHAR2(37,5) 
FECHA_ALBARAN       NOT NULL NVARCHAR2(12)   
MENSAJE_ERROR       NOT NULL NVARCHAR2(1500) 
TIMESTAMP                    DATE            
FECHA_ACTUALIZACION          DATE            
DIVISION            NOT NULL NVARCHAR2(6)  

In the second column (time_insercion) an external system is creating dates, but with text format, like:

But even when all dates seems to have the mask, I'm getting the error with this SQL:

Does anybody have a clue about this?

Thanks,
Jose.

This post has been answered by Jose Aróstegui on Aug 16 2023
Jump to Answer
Comments
Post Details
Added on Aug 10 2023
16 comments
140 views