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


ADVERTISEMENT

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 :: 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

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

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 :: 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 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

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 :: Insert Data Into Valid Table When Validation Fulfilled?

Feb 19, 2013

I have a requirement like to validate the data in PL/SQL script dynamically.

I have 4 tables

TEST_TBL: Data available in this table
TEST_VALID_TBL: Contains field names of TEST_TBL and condition
VALID: Need to insert valid records
INVALID: Need to insert invalid records

I have to insert data into valid table when validation are full filled otherwise it should be insert invalid table .

Validation are based on TEST_VALID_TBL

While checking the data validations FIELD_NAME should be passed dynamically,because i have four columns in TEST_TBL but at present I am validating only 3 columns in feature it may be add more columns to validate.

View 4 Replies View Related

PL/SQL :: Valid Objects Need To Be Compiled While Running Packaged Procedure

Aug 8, 2012

I have a requirement to create a packaged proc which lists down a set of database objects and its statuses whenever the status of objects is changed as valid/invalid in user_objects. Also, those valid objects need to be compiled while running the packaged proc.

View 5 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

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

Client Tools :: Able To Connect From SQL-Assistant BUT Unable To Connect From SQL Developer

Jul 7, 2012

I have been troubling with this issue for the last two weeks...tried so much, but could not able to resolve....

sqlplus username/password@IPAddress:port/ServiceName

I am able to connect to DATABASE from SQLAssistant only when I provide string like ABOVE........If I dont mention the SERVICE, m unable to connect to DB.Now the biggest issue is with SQL Developer.....m not at all able to connect to DB using SQL Developer.

View 3 Replies View Related

Client Tools :: Connect Oracle Developer 6i Without Connect String

Aug 17, 2010

I have installed oracle developer 6i. in sqlplus i want to put my username and password but nothing in the connect string field.

View 1 Replies View Related

Connect Oracle Database From Delphi - Could Not Resolve Connect Identifier Specified

Oct 6, 2010

I have the following computer/setup:

Acer laptop, Intel Processor w/ Windows 7 Professional (64-bit)
Delphi 2010 Professional
Oracle XE (+ the Oracle XE client that comes with it)

I cannot can't to the Oracle database from Delphi. The error I keep getting is:

Alias is not currently opened. [Oracle][ODBC][Ora]ORA-12154:TNS: could not resolve the connet identifier specified.

Here's what I've done:

1. Create an ODBC connection to my Oracle database

- run C:WindowsSysWOW64odbcad32.exe to open the ODBC administrator.
- Data source name: bt_user
- TNS Server Name: localhost/xe
- user bt_user
- Clicked "test connection" -- Success.

2. Open Delphi and drop a TDatabase component on my main form.

- Set the Alias Name property to "bt_user" (the alias I set up in ODBC)
- Set database name to "bt_user".
- Checked "connected".

Alternatively, I tried using the Delphi ADO components (the dbGo components).

- Drop TADOConnection component on my form.
- Select "connection string" and open the dialog.
- Click "build string".
- Select "Microsoft OLE DB Provider for ODBC Drivers" from the selection.
- In "use data source", select "bt_user" from the drop-down list (my ODBC connection from #1)
- Click "test connection".

Again the same error.

My questions are:

1. Can Delphi work with Oracle XE (Express Edition)?

2. If so, then do I need to install the "Instant Client"?

3. Will the instant client for Oracle 10g work with Oracle 10g XE?

4. Do I need to install any additional ODBC driver(s)?

5. Why was I successful in creating the ODBC connection in Windows, but it failed in Delphi?

6. Will Visual Studio.NET (C#) work with Oracle XE, and what are the steps for setting that up?

View 2 Replies View Related

Reports & Discoverer :: Custom SQL Entered Is Not A Valid Statement - ORA-01031

Feb 4, 2011

After validating the SQL statemnet during creating a Custom folder in OracleBi Admin following Error displays. While the same query execute in toad successfully.

The Custom SQL entered is not a valid SQL statement - ORA-01031:Insufficeint Privileges

View 1 Replies View Related

Server Utilities :: Not A Valid Export File Header Failed Verification

Nov 22, 2012

Sometimes during recovery I encountered the following message "

This error occurs when Backup And Restore Occur between different versions

View 4 Replies View Related

Export/Import/SQL Loader :: Can Impdp Perform Checks To See If Dumps Are Valid

Jul 20, 2012

i'm writing a job to export data on a weekly basis and archive those data in-case needed to be re-imported in future, its important that we able to import successfully if ever needed.

can impdp perform checks to see if dumps are valid ?how about old imp?if not, will it be safe enough to rely on the export log file? in another word is it safe to assume its all safe if there is no error or warning in the exp log?

View 7 Replies View Related

Backup & Recovery :: ORA-01139 - RESETLOGS Option Only Valid After Incomplete Database Restore

May 21, 2013

restored from tape a backup then issued rman command

RMAN> restore database;

Starting restore at 21-MAY-13
Finished restore at 21-MAY-13

RMAN> alter database open;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 05/21/2013 15:36:15
ORA-01190: control file or data file 1 is from before the last RESETLOGS
ORA-01110: data file 1: '/u02/oradata/system01.dbf'
[code]....

View 2 Replies View Related

Application Express :: Validation On Text Item / User Enter Valid Date Format

Oct 13, 2012

i have text item :P1_ADMISSION_DATE .i want to validate that item if user does not enter valid date forrmat then display me error.

Date Format is 'DD-MON-YYYY'

i have try with PL/SQL Expression in Validation

My validation code

:P1_ADMISSION_DATE=TO_CHAR(SYSDATE,'DD-MON-YYYY');How can i validate :P1_ADMISSION_DATE to enter valid date format by user.

View 2 Replies View Related

Backup & Recovery :: ORA-01139 / RESETLOGS Option Only Valid After Incomplete Database Recovery

Jan 25, 2011

SQL> alter database mount;
Database altered.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery

View 5 Replies View Related

SQL & PL/SQL :: Select The Valid Data From VARCHAR2 Data

Sep 23, 2011

I need the output like...

OUTPUT(MM/DD/YYYY): 2/03/2011
02/03/2011

create table test (trans_date varchar2(1000));

Insert into test values ('2/03/2011')
Insert into test values ('02/03/2011')
Insert into test values ('12/33/2011')
Insert into test values ('xxx')
Insert into test values ('33/33/2011')
Insert into test values ('03/03/11')

View 4 Replies View Related

Server Utilities :: Append Tables Content To Existing Tables?

Nov 9, 2010

problem on oracle 11gR2 where i have to import data from a source database to an existing table without truncate or drop the target table in the target database.

we have found something called table_exist_action=append in impdp.

View 2 Replies View Related

Maintain Large Tables / Cleanup Data From Our Tables

May 18, 2011

I have to cleanup data from our tables (Production Environment) that contain millions of rows. The question is apart from the solution of the partitioned tables what alternative recommended solution suggests Oracle?

To delete these tables by using a cursor PL/SQL block or to import all the database and in the tables that we want to remove the old rows to use the QUERY option of the data pump utility.

I have used both ways and i have to admit that datapump solution is much much faster than the deletion that suffers from I/O disk.The question again is which method from these two is more reliable and less risky for the health of the database.

View 5 Replies View Related







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