SQL & PL/SQL :: Time Conversion - Not A Valid Month Error

Aug 16, 2010

why this query is not working

SQL> select xid,start_time from v$transaction;

XID START_TIME
---------------- --------------------
070006009A010000 08/16/10 13:24:43

SQL> select xid,start_time from v$transaction where start_time>to_timestamp('08/16/2010 12:15:00','mm/dd/yyyy hh24:mi:ss');
select xid,start_time from v$transaction where start_time>to_timestamp('08/16/2010 12:15:00','mm/dd/yyyy hh24:mi:ss')
*
ERROR at line 1: ORA-01843: not a valid month

View 17 Replies


ADVERTISEMENT

Server Utilities :: Error Not Valid Month In Sql Loader?

May 17, 2012

I am trying to load below data using sql loader.

05/17/12,07:45:39,resn-j35-ctc113,"USR:ESM.CQueryTypeDlg::RunQuery().wft",0.125,P,schapptbook,22712,25704,705355992045,RBA4010200,10.146.218.154,0, "",0,"","",""

table structure
CREATE TABLE TEMP_CERNER_RESP_TIME_LND
(
INSTALLATION_ID VARCHAR2(50 BYTE) NULL,
TRANSACTION_ID VARCHAR2(50 BYTE) NULL,
SERVER_ID VARCHAR2(50 BYTE) NULL,

[code]...

Below function has been used to transfor data and callled in sql loader control file
CREATE OR REPLACE function return_domain( domain_name varchar2)
return varchar2
as
v_dmn varchar2(100)

[code]...

sql loader control file is as below:

load data
BADFILE '/backup/temp/rajesh/CERNER/BadFiles/FILENAME'
append into table TEMP_CERNER_RESP_TIME_LND
WHEN CLINICAL_TRANSACTION_ID = 'USR:ERM PMSEARCH ENCOUNTER RESULTS DISPLAY'
TRAILING NULLCOLS

[code]...

function takes the parameter as 'DOMAIN50_LPAR5002_slainterval051712_rj35cmi102_08_45_00.csv '

FILENAME in control file will be replace by DOMAIN50_LPAR5002_slainterval051712_rj35cmi102_08_45_00.csv when i run the the the loader i get the below error.

Record 1: Rejected - Error on table TEMP_CERNER_RESP_TIME_LND.
ORA-00604: error occurred at recursive SQL level 1
ORA-01843: not a valid month

View 4 Replies View Related

SQL & PL/SQL :: Function That Accepts 2 Dates - Not A Valid Month Error

Apr 15, 2011

I have function that accepts 2 dates namely sDate and eDate i.e start and end dates. See the declaration part of the function:

startDate eab.eod_date%type;
endDate eab.eod_date%type;

begin
startDate := to_date(sDate,'DD-MON-YY');
endDate := to_date(eDate,'DD-MON-YY');
end

When I called the function it gives me the following error: ORA-01843: not a valid month..And I tried to simulate the process, the below code also show the same error:

select TO_DATE(to_date('13-DEC-09', 'dd-MON-yy', 'nls_date_language=english'),'DD-moN-YY') from dual;

how I can check that error. I need to pass dates to my function.

View 8 Replies View Related

SQL & PL/SQL :: ORA-01843 / Not A Valid Month

Jul 25, 2011

I have a date field with varchar datatype. My data look like :

ID Amend_DATE
1 4/24/1974
1 4/18/2001
1 8/2/1971
2 8/4/1965
3 11/9/2001
4 8/15/2001

I need to find the minimum amend_date for each ID.When i calculate min(amend_date), it gives me error:

ORA-01843 : not a valid month

Query i am using is :

select min(to_date(amend_date ,'mm/dd/yyyy') ) from t group by id;

My data on application appears as 24 April 1974.

View 2 Replies View Related

ORA-01843 / Not A Valid Month

Sep 14, 2012

I have 2 cursors. Cursor 1 selects a number and 2 dates (values in the Table are in the format mm/dd/yyyy for both the columns).

I pass these values to Cursor 2.

v_promotion_id promotion.promotion_id%TYPE;
v_promotion_start_date promotion.start_date%TYPE;
v_promotion_end_date promotion.end_date%TYPE;
CURSOR c_promotion_list IS
(SELECT DISTINCT p.promotion_id,
p.start_date - 5,
p.end_date + 5
FROM promotion p,

[code]....

I am getting this error: ORA-01843: not a valid month

Initially I was passing just the variables without To_date. But I got the same error.

View 2 Replies View Related

SQL & PL/SQL :: ORA-01839 - Date Not Valid For Month Specified?

Nov 1, 2013

our web application has a field DATETO which has no validation (end date). So user can put garbage there. In this field should be SYSDATE + max. 2 years. But also SYSDATE + 1 month OK.

I need to make a script that sets for example "31.12.9999" to null. Because so long end date is non sense.

SQL> SELECT EXTRACT (YEAR FROM (TO_DATE (DATETO, 'DD.MM.YYYY')))
FROM XXX_USER_JC_ORDERID
WHERE DATETO IS NOT NULL;
ERROR:
ORA-01839: date not valid for month specified

no rows selected

Littlefoot writes about ORA-01839 "It usually happens when invalid dates are used, such as 30th of February"[URL]..

I don't see invalid date???

SQL> SELECT DATETO
FROM XXX_USER_JC_ORDERID
WHERE DATETO IS NOT NULL;
DATETO
--------------------------------------------------------------------------------
23.09.2013

[code]...

DATETO
--------------------------------------------------------------------------------
31.12.2014
31.12.2016
31.12.2013
31.08.2014

[code]...

View 7 Replies View Related

Application Express :: Date Formatting - Not A Valid Month

Apr 29, 2013

I am using the cloud version of APEX for a college course. The database script I am trying to load has dates formatted in "DD-MON-RR" and I receive 'not a valid month' and 'a non-numeric character was found where a numeric was expected'. Is there a workaround in APEX for this? I'm trying to avoid changing thousands of lines of data.

View 4 Replies View Related

Time Conversion To Yyyy - Dd - Mm

Mar 5, 2008

1075329297.572

This is unix time where 1075329297 is seconds 572 is milliseconds.

first il store this time in oracle database.when i am retrieving it i want this date into yyyy-dd-mm format. Is it possible to do it in oracle.(using convert function) or is there some other way?

View 8 Replies View Related

SQL & PL/SQL :: Date / Time Conversion

Apr 4, 2010

I am converting data from an old paradox table to a new oracle table, one of the problems im having is incompatibility with date and time formats:

some columns contain times in the format : "00:00:00" eg..... "15:00:00"
some columns have date in the format: "dd/mm/yyyy" eg....... "21/08/2000"
some columns have time and date eg.. "05/09/2000 15:49:39"

Currently I have the data held in tables within an access database, and in CSV format.

eg, I have dates like 03/04/2010 which i need to be 03-APR-10....

how I can get the following into Oracle date formats? there is over 1000 records so manual conversion is out of the question

View 21 Replies View Related

SQL & PL/SQL :: Oracle Date / Time Zone Conversion

Aug 13, 2012

I would like to know how to convert the following:

13-AUG-12 03.30.06.146 PM

to the format:

"MM/DD/YYYY HH:MI:SS AM"...

I believe there is a time zone issue here as well, since the should actually be around 11:30am. I am not sure what time zone is being used.

View 2 Replies View Related

Time Zone Conversion Without Using Function And Without Alter?

Sep 26, 2013

I am able to see 1Hr difference in my date fields of SQL output because in UI (User Interface)  date field was stored in BST format but DB time zone is in GMT format so how to find a solution for 1 hr difference, here i don't have Privileges to alter DB time zone and i couldn't use function as i have so many SQL's and  can't apply that function manually. SO is there any other option to change the DB time zone with out alter it and with out using function. 

View 1 Replies View Related

SQL & PL/SQL :: Stored Procedure - Character To Number Conversion Error

Mar 14, 2011

I have written a stored procedure that has started returning the error:

Error starting at line 1 in command:
call p_glpost('DSTUK', 'L', '2008-01-01', '2008-01-01', '2011-02-18', 1, 1, 1, 0, 'Hi there')

Error report:
SQL Error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "CLARITY.P_GLPOST", line 173
06502. 00000 - "PL/SQL: numeric or value error%s"

I can't seem to find a tool that will let me step into the actual stored procedure line by line to see where the error occurs. It mentions line 173, which seems to be a red-herring, as line 173 is simply one of the 'END IF' lines within this block:

IF NVL(r_dist.transtype,'wild') = 'wild' THEN
NULL;
elsif r_wip.transtype = r_dist.transtype THEN
v_matchCount := v_matchCount+1;
elsif r_wip.transtype <> r_dist.transtype THEN
[code]......

Tell me if it is possible to trace through a SP, and which tool is best (I am trying to use Oracle SQL Developer).

View 8 Replies View Related

SQL & PL/SQL :: ORA-06502 - Numeric Or Value Error - Character To Number Conversion?

Aug 4, 2011

I got a string in the form 1+2+4.If we write select 1+2+4 from dual;then we get o/p as 7.but the same thing iam trying to do in a bit of pl/sql program by passing the string 1+2+4 value to a number variable as below.

COUNT_TASK := TO_NUMBER(TASK6_STATUS);

TASK6_STATUS value is 1+2+4 (this thing i got by replacing the string and lots of stuff) but i need the result after adding these 3 numbers in the string. and i declare COUNT_TASK as NUMBER;and i am very well aware that it gives me the error ORA-06502: PL/SQL: numeric or value error: character to number conversion error

how to add these numbers in my program to get the result 7.

View 6 Replies View Related

PL/SQL :: ORA-06502 - Numeric Or Value Error - Character To Number Conversion?

Jun 20, 2013

1 error has occurred  ORA-06502: PL/SQL: numeric or value error: character to number conversion error

I get the above error when I try to compare the below dates in a Pl/sql process in APEX environment.

Is there a work around for it? or (to_char(V_SERVFROM,'mm/dd/yyyy')) != (to_char(:P29_SERVFROM,'mm/dd/yyyy'))

View 4 Replies View Related

Server Utilities :: ORA-02374 / Conversion Error Loading Table (through Data-pump)

Jul 12, 2013

While importing dump to the new database, error occurred. Below are the errors -

ORA-02374: conversion error loading table "INS"."GENMST_FINANCIER_BRANCH"
ORA-12899: value too large for column TXT_IFSC_CODE (actual: 19, maximum: 15)
ORA-02372: data for row: TXT_IFSC_CODE : 0X'4644524C30303031353739A0A0A0A0'
[code]...

I would like to know, why such error occurred during the import.

View 5 Replies View Related

Precompilers, OCI & OCCI :: Error Implicit Conversion Of String Literal To (char) Is Deprecated?

Jan 30, 2011

i write a select statement in proc that contains 44 columns.

when i precompile it. it is showing the error: implicit conversion of string literal to "char *" is deprecated.when i compile the same select with 40 columns it is not showing any error.

but for more than 40 columns (41-44) it is showing the above error.

View 1 Replies View Related

SQL & PL/SQL :: How To List Data Dynamically Month Wise Picking Month From The Same Table

Jun 4, 2013

I have a requirement to list the data month wise dynamically where month data is also in the same table, hopefully the below posts should bring more clarity to my requirements.

1. Table creation:
Create table T1 (account_no varchar2(15), area_code varchar2(2), bill_month date, consumption number);

2. List table content:
select * from T1;

account_no area_code bill_month consumption

Q00001Q31-Jan-12125
Q00002Q31-Jan-1265
Q00003Q28-Feb-12219
Q00004Q28-Feb-12805
Q00005Q28-Feb-1254
Q00001Q31-Mar-12234
Q00002Q31-Mar-12454
Q00003Q31-Mar-12232
Q00004Q30-Apr-1221
Q00005Q30-Apr-12218
Q00001Q30-Apr-1254
Q00002Q31-May-1219
Q00003Q31-May-1287
Q00004Q30-Jun-12187
Q00005Q30-Jun-1278
so on......so on......so on......so on......

3. Expected output:
account_no area_code Jan-12 Feb-12 Mar-12 Apr-12 May-12Jun-12Jul-12Aug-12Sep-12Oct-12Nov-12Dec-12

Q00001 Q 125 548 2345487423154821518738721512
Q00002 Q 65 127 45487819357831585683152878
Q00003 Q 545 219 2328738735188745897313
Q00004 Q 78 805 1221218187885718387389787138
Q00005 Q 541 54 2621878778386538698182

With the conventional query I hope this is impossible,

View 2 Replies View Related

PL/SQL :: Code Erases Previous Month Record While Updating Current Month Record

May 16, 2013

Using 11gR2, windows 7 client machine. I need to update the table missing_volume (below), where I need to calculate the estimated_missing column. The calculation of estimated_missing column for current month needs previous month numbers (as commented inside the code below). I want the output like the first table. Notice the records start from January, hence estimated_missing for January can't be calculated, but for the the rest of the months it can be done by simply changing 'yr' and 'mnth' (commented inside the code towards the end).

yr          mnth          location     volume          actual_missing          expected_missing     estimated_missing
---------------------------------------------------------------------------------------------------------------------------------
2013            January          loc1          48037          24               57                         
2013             February     loc1          47960          3660               53                      24
2013             March          loc1          55007          78               57                      28
2013             April          loc1          54345          72               58                  77The code:

UPDATE missing_volume g

[Code]....

The code does calculate correct number for 'estimated_missing' as I run the code for each month, but the problem is while updating the current month it also erases the record for previous month. E.g. as can be seen below, after I updated April the column only has the record for April, previous month record is gone, similarly updating March removed February, etc. I can't understand why it's happening!! Here is the output I get:

yr          mnth          location     volume          actual_missing          expected_missing     estimated_missing
---------------------------------------------------------------------------------------------------------------------------------
2013            January          loc1          48037          24               57                         
2013             February     loc1          47960          3660               53
2013             March          loc1          55007          78               57
2013             April          loc1          54345          72               58                   77

why it's happening (I mean where is the flaw in the code) and how to get the desired output (first table).

View 5 Replies View Related

SQL & PL/SQL :: For Each Month Sum Values From Month Before?

Nov 25, 2010

I need for each date sum the values from the begin of the year to present date. In January I will have the value of this month, on February I must sum the value of this month and the value of the month before, and so on, at the end of the year.

Date input

SELECT ID_CLIENT, DT_REG, VAL
FROM (
SELECT 1 as ID_CLIENT, TO_DATE('20100101', 'YYYYMMDD') as DT_REG, 200 as VAL FROM DUAL UNION
SELECT 1 as ID_CLIENT, TO_DATE('20100201', 'YYYYMMDD') as DT_REG, 100 as VAL FROM DUAL UNION
SELECT 1 as ID_CLIENT, TO_DATE('20100301', 'YYYYMMDD') as DT_REG, 200 as VAL FROM DUAL UNION
SELECT 1 as ID_CLIENT, TO_DATE('20100401', 'YYYYMMDD') as DT_REG, 150 as VAL FROM DUAL UNION
SELECT 1 as ID_CLIENT, TO_DATE('20100501', 'YYYYMMDD') as DT_REG, 100 as VAL FROM DUAL UNION
SELECT 2 as ID_CLIENT, TO_DATE('20100101', 'YYYYMMDD') as DT_REG, 100 as VAL FROM DUAL UNION
SELECT 2 as ID_CLIENT, TO_DATE('20100301', 'YYYYMMDD') as DT_REG, 220 as VAL FROM DUAL UNION
SELECT 2 as ID_CLIENT, TO_DATE('20100501', 'YYYYMMDD') as DT_REG, 500 as VAL FROM DUAL UNION
SELECT 3 as ID_CLIENT, TO_DATE('20100201', 'YYYYMMDD') as DT_REG, 150 as VAL FROM DUAL UNION
SELECT 3 as ID_CLIENT, TO_DATE('20100501', 'YYYYMMDD') as DT_REG, 100 as VAL FROM DUAL);

Result

ID_CLIENTDT_REGVAL
101/01/2010200
101/02/2010300
101/03/2010500
101/04/2010650
101/05/2010750
201/01/2010100
201/03/2010320
201/05/2010820
301/02/2010150
301/05/2010250

View 17 Replies View Related

What Happens When UNDO Space Is Full / Transaction Takes More Time To ERROR

Jan 26, 2011

I have a long running transaction (more than 3 hours), and at the same time other operations are occurring on different tables, using the same UNDO space.

Sometimes we see ORA-30036, but this error occurs very late in the process. The transaction normally takes 3 hours, but when UNDO space is full, we do not get ORA-30036 upto 8 hours or 9 hours of process.

I am wondering what could be happening in the background, when UNDO space is full, which makes the transaction to extend upto 8 hours or 9 hours (pl. note, this transaction gets completed within 3 hours normally). This is in 11g, UNDO space is managed manually.

View 2 Replies View Related

Forms :: Getting Error At Compilation Time / To Insert Images Into Table

Oct 3, 2011

I am getting error at compilation time. I want to insert images into table. The code is

declare
f_lob bfile;
b_lob blob;
begin
INSERT INTO imag VALUES(empty_blob())
return img INTO b_lob;
f_lob := bfilename( 'PIC', 'DESERT.JPG' );
dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
end;

errors are
[code]

View 1 Replies View Related

SQL & PL/SQL :: Connect Tables Using Valid From / To

Dec 13, 2011

I would like to join 2 tables which are both using valid_from valid_to.

CREATE TABLE TEST_HIST1
(
ID INTEGER,
DESC VARCHAR2(7 BYTE),
VALID_FROM DATE,
VALID_TO DATE

[code]...

The end result I would like to see is:

ID | Name | Descr | Valid_from | Valid_to
1 | Name1 | Descr1 | 2001/01/01 | 2001/12/31
1 | Name2 | Descr2 | 2002/01/01 | 2002/12/31
1 | Name2 | Descr3 | 2002/06/01 | 2002/12/31
1 | Name3 | Descr3 | 2003/01/01 | 2003/12/31
1 | Name3 | Descr4 | 2004/01/01 | 3000/12/31

View 10 Replies View Related

SQL & PL/SQL :: How To Get Valid Data After Skip Bad Block

Mar 19, 2011

I have a table and no related backup available.If some block is broken, then , how can I get the data with the blocks that are not broken?

Test environment:

SQL> create tablespace test datafile '/u01/app/oracle/oradata/test/test.dbf' size 1m;

Tablespace created.

SQL> create table scott.test_bad_block (id int, name varchar2(20)) tablespace test;

Table created.

SQL> r
1 begin
2 for i in 1..1000000 loop
3 insert into scott.test_bad_block values (i, 'test' || i);
4 commit;
5 end loop;
6* end;
begin
*
ERROR at line 1:
ORA-01653: unable to extend table SCOTT.TEST_BAD_BLOCK by 8 in tablespace TEST
ORA-06512: at line 3
SQL> select count(*) from scott.test_bad_block;

COUNT(*)
----------
40984

Now I know, I have 40984 rows in the table.In order to simulating the block corrupt, I shutdown the database and I used the bvi (a binary file editor to modify a line of record) , then start the database, when I am issuing the same statement, the problem shows:

SQL> select count(*) from scott.test_bad_block;
select count(*) from scott.test_bad_block *
ERROR at line 1:
ORA-01578: ORACLE data block corrupted[b] (file # 7, block # 72)[/b]
ORA-01110: data file 7: '/u01/app/oracle/oradata/test/test.dbf'

It says that the block is corrupted.Now, here is what I can do to get the data right now:

#get the object id
SQL> r
1* select OBJECT_NAME, DATA_OBJECT_ID from dba_objects where owner='SCOTT' and object_name='TEST_BAD_BLOCK'

OBJECT_NAME DATA_OBJECT_ID
-------------------- --------------
TEST_BAD_BLOCK 10327
[code]....

Here are my questions:

1. How can I know, that if there is valid data(the block is not corrupted) after this bad block?
2. How can I get the data after this bad block?

View 21 Replies View Related

Forms :: Validate Field To Be Valid Email ID?

Feb 16, 2011

want to validate a field to be a valid email id.

View 1 Replies View Related

SQL & PL/SQL :: ORA-24247 With Valid ACL When Sending Smtp Mail?

Aug 1, 2012

I have users with the same privileges to the same ACL and some can send emails and some others cannot !

In principle I created the ACL for USER1:

BEGIN
dbms_network_acl_admin.create_acl
(acl=> 'mails_senden.xml',
description=> 'Mails senden ueber INTRANET Mail-Server ...',
principal=> 'USER1',
is_grant=> true,
privilege=> 'connect');
COMMIT;

[code]....

Then I added USER2:

BEGIN
dbms_network_acl_admin.add_privilege
(acl=> 'mails_senden.xml',
principal=> 'USER2',
is_grant=> true,
privilege=> 'connect');

[code]....

USER1 sent a mail via UTL_SMTP successful whereas USER2 got the errors:

DECLARE
*
ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 267

[code]....

There is still the following fact:

USER1 has the role DBA, USER2 got the EXECUTE privilege to packages UTL_TCP, UTL_SMTP (GRANT from SYS).

IF the role DBA was granted to USER2 too then he couldt send emails just as well as USER1.

View 7 Replies View Related

SQL & PL/SQL :: Duplicated Entries In A Valid Unique Index?

May 26, 2010

I'm having problem with my database, which contains more than 1 rows with a same value on a field that has uniqueness contraint.

Here is the log from sqlplus. When I select on RI field, it shows 2 rows. But when I select on SCNUM field, it shows only 1 row. This SCNUM has an unique index on it.

And it is still in VALID state

SQL> set autotrace on
SQL> select ri, scnum from scratch1_p where ri in (536964983, 536955574);
select ri from scratch1_p where scnum='444393975';
RI SCNUM
---------- ----------
536955574 444393975

[code].....

View 14 Replies View Related

Forms :: Verification That User Selected Valid Date

Mar 19, 2013

I have 3 types list items:

1) :1 Day -> 31
2) Month: 1 -> 12
3) Year :1990 -> 2013

I want to check that the user has selected a valid date .. if not an error message will be displayed, for example: 31-02-2013: will be rejected

View 9 Replies View Related

Server Utilities :: IMP-00010 Not A Valid Export File

Oct 7, 2011

IMP-00010 not a valid export file, header failed verification.I want to ask that can I take Import of .dmp file from 64-bit to 32-bit machine

View 2 Replies View Related

Forms :: Frm-15500 Valid And Unique Object Name Must Be Entered

Feb 28, 2012

I'm trying to add a column in an existing form. I added a text item and defined it as a database item. When I tried to rename the item the message (frm-15500 valid and unique object name must be entered)appears, and therefore not able to exit the property Platte.

Is there a way I can exit the Platte and should I've first add the column to the data block and then rename in my form ?

View 1 Replies View Related

SQL & PL/SQL :: REGEXP_LIKE Function For Valid Email Address Validation

Jun 2, 2011

I am writing a REGEXP_LIKE function to validate the email address.. below function works for most of the valid email address, but not working for below condition... not sure how it can be tweaked to work for below condition as well...

Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively (e.g. John..Doe@example.com).

Select 'X' from dual
WHERE NOT REGEXP_LIKE('John.Doe@example.com','^(([a-zA-Z0-9_-])([a-zA-Z0-9_.''-]*)@([((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3}|((([a-zA-Z0-9-]+).)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])]))$')

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved