SQL & PL/SQL :: Table Contents - Unavailable Date

Oct 17, 2012

i have table A i.e. contents

----------------------
1-jan-2012 x
2-jan-2012 y
4-jan-2012 x
7-jan-2012 x

I need to discplay below:

1-jan-2012 x
2-jan-2012 y
3-jan-2012 0
4-jan-2012 y
5-jan-2012 0
6-jan-2012 0
7-jan-2012 x

View 1 Replies


ADVERTISEMENT

Alter Table Column And Its Contents?

May 4, 2011

I have a table with usernames and passwords. The passwords are stored in plaintext. I would like to issue an ALTER command on the password field to store a hash instead, and then repopulate those fields with an encrypted version of the plaintext passwords that were there before.

I would prefer to do this in a procedure, as I am going to perform it in a test environment first, then eventually in the production environment.

View 2 Replies View Related

SQL & PL/SQL :: Count Of Records In Table With Different Contents

Mar 31, 2010

I am having a table with contents like

item id, name
100,s_enter
100,p_enter
200,s_enter

i would like the output to be

Variable name cnt_s_enter=1 (this is for 200)
cnt_s_p_enter =1 (this is becoz 100 is both in s_enter and p_enter)

I am working with basic case but thats not working.

select
sum(case when name='s_enter' then 1 else 0 end),
sum(case when name in (s_enter,p_enter) then 1 else 0 end)
from table

View 3 Replies View Related

EMCA Error - Database Unavailable Exception?

Jun 7, 2012

I have installed Oracle 11gR2 on Windows 7 professional. I created a DB and a listener also.No issues there; I can connect to the DB with sqlplus and SQL Developer.when I try to configure dbcontrol on this DB, it fires errors;

--------------------------------------------------------------------------------------------
C:Windowssystem32>emca -config dbcontrol db

STARTED EMCA at Jun 7, 2012 2:20:15 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: ORA112
Exception in thread "main" oracle.sysman.emcp.exception.DatabaseUnavailableExcep

[code]...

How this can happen?

View 3 Replies View Related

Application Express :: How To Insert Contents Of CSV File In Table

Sep 16, 2013

I'm starting with APEX, I would like to know how to insert the contents of a file. Csv in a table, how to map a file to a table, how to insert file contents. Xls in a table.

View 1 Replies View Related

PL/SQL :: Use Of Views And Synonyms If Changes Made To Them Affects Original Table Contents

Mar 28, 2013

what is the the use of views and synonyms if changes made to them affects the original table contents?It is data insecurity know?

View 2 Replies View Related

Can Partition A Table Based On Date If It Does Not Have A Date Column

Jun 21, 2012

How can we partition a table based on date if it does not have a date column.

Actually I have to compare two tables on daily basis and fetch few rows from those two tables and enter it to a third table.But both these tables does not have a date column.

I am confused if i need to alter those tables and add date column or if there is some way in which i can compare the data from the two tables for that particular day only and not the whole table data.

View 1 Replies View Related

Deletion Of Contents Of Tablespace

Jun 15, 2012

How can we clean a tablespace(delete all the contents) without dropping the tablespace.

View 3 Replies View Related

SQL & PL/SQL :: Parsing BLOB Contents

Mar 28, 2013

I have some BLOB contents in the format of...

DK99F17,AA,032820130840,Other
ABCD,AA,032820130840,OV
AAZ123,BC,032820130932,DWL
CBA12345,ZA,032820130939,Other
Each BLOB is associated to a file name in the format...
03282013100002_thisfile.txt

The blob for each file may be zero rows to n rows in size, but typically there are 2 to 5 rows (four rows were shown in the rows above).The following kind of gets me there, but not quite as it splits up the BLOB rows at the comma and not the line break (HEX=0D0A / CRLF).

with rec as
(select fs.file_name, utl_raw.cast_to_varchar2(fs.file_data) file_data
from tada.files_store fs
where fs.file_name like '%citations.txt'
and trunc(fs.date_created) = to_date('26-MAR-2013','DD-MON-YYYY'))
[code].....

View 4 Replies View Related

SQL & PL/SQL :: Information On Package Contents

Oct 25, 2012

I am developing some automated test packages for my PL/SQL Packaged code. Going forward I can code the test package in conjunction with the code but I have some historic packages that I would like to develop these test packages for.

To save time I would like to employ oracle data dictionary views in order to construct the framework for my test package. This includes using SQL to get a list of procedures / functions within the package in order to create the test procedures (spec and body). I can do this in a basic way using the user_procedure view with something like...

SELECT 'PROCEDURE test_' || LOWER(procedure_name)
|| ' (p_result OUT VARCHAR2 IS BEGIN JTA.ACCOUNT_PROFILE_MAINT.' || procedure_name || ' END '
|| LOWER(procedure_name) || ';'
FROM user_procedures WHERE object_name = 'ACCOUNT_PROFILE_MAINT' AND subprogram_id != 0 ORDER BY subprogram_id;

However, the above only really works (in simplistic form.. without parameters) for procedures within the package. I would also like to be able to determine if the procedure listed is actually a function or procedure (so that I can alter the syntax accordingly to generate a correctly formatted string calling the program unit).

So, initially how do I determine the type of package program unit I have (Proc/Function)? Do I need to go to all_source to get this information or are there other views available I can join to?

Eventually I would like to extend this to be able to automatically include any parameters in the generated calling string.. again, is there any other option apart from all_source to get this information?

View 3 Replies View Related

SQL & PL/SQL :: How To See The Contents Of Wrapped Package Body

Mar 31, 2011

I want to see a stored procedure definition which is inside the body of a package and the package is wrapped.So I am not able to see the content of the package body.I am new to oracle and I don't know how to decrypt the wrapped package.how to read the content of a wrapped package inside oracle.

View 1 Replies View Related

Server Utilities :: How To Know Dmp File Contents

Sep 24, 2011

Is there a way to list contents of a dmp file(using expdp generate),which objects(tables/vies/procedures/packages) does it contain?

View 4 Replies View Related

PL/SQL :: Adding Columns To Count Contents Of Other?

Aug 31, 2013

how to incorporate counts into my current SQL code  that would count food items, and then car items for each person. Once I understand this concept I hope to apply it to my real database (in Oracle) where I am counting medications and problems for each patient.For example using my test data below, the my goal would be to have count columns show that Cathy had 3 food count and a 1 cars item (the count would need to ignore the null values in these  columns). I don't really care if the count value repeats in every row for that person.

 Select data1.Name, data1.Category,Data1.Results,Case When data1.Category IN ('food') then data1.results end FOOD,Case When data1.Category IN ('Cars')then data1.Results end CARSFROM(Select T1.name Name, null Category, null Results from a_Main T1, a_Food T2 Where T1.cpi_seq = T2.CPI_SEQUNION Select T1.name, 'food', T2.Food  from a_Main T1, a_Food T2 Where T1.cpi_seq = T2.CPI_SEQUNIONSelect T1.name, 'cars',  T3.Cars  from a_Main T1, a_Cars T3 Where T1.cpi_seq = T3.CPI_SEQ)data1where data1.Category is not nullorder by Name,

[code]....

View 2 Replies View Related

Server Administration :: How To Read Dump Contents

Jan 4, 2012

How to read the treedump contents of a index IDX_TB_TEST_N1?

SQL> select object_id,object_name from dba_objects where owner='HXL';

OBJECT_ID OBJECT_NAME
---------- ---------------------------------------------
51786 IDX_TB_TEST_N1

alter session set events 'immediate trace name treedump level 51786'

/u01/app/oracle/admin/oracl/udump/oracl_ora_2679.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1

[code]...

View 6 Replies View Related

Server Administration :: Contents Of Redo Log Files

Feb 1, 2011

I have some doubts about redo log files,

1) Can we fetch 'select statements' from redo log files through the use of log miner utility or any other?
(I think redo log file contains only insert,update,delete and DDL/DCL commands only)

2) If "No" to the above answer then how can i fetch all select statements fired on the system for a day or particular time.
(setting of sql_trace may be the one of them, but can it be possible for system level)

View 4 Replies View Related

Client Tools :: SQL Developer Cuts CLOB Contents?

Aug 23, 2011

I'm having a problem while exporting an DB to file. I have a certain table with a CLOB column which values are cut when I use the Export option on SQL Developer.

View 1 Replies View Related

Backup & Recovery :: Restore Datafile With Its Contents Without Using RMAN

Oct 13, 2011

I have no backup taken in my oracle server.Today morning i created a data file and unknowingly deleted it. Now i need to restore the datafile with its contents without using RMAN.

View 14 Replies View Related

Application Express :: Capture Contents Of Page - Copy To Clipboard

Jan 31, 2013

I just need to run javascript to capture the contents of the page( form) like labels and values in the fields using a COPY button to capture all the information available on the page or form to copy that to system clipboard so that information can be used into another system.

View 2 Replies View Related

Application Express :: Assign To Item List Of Value According To Contents Of Other Fields

Oct 18, 2013

Let me explain, I have two items in my page, the first is not required, if it is null the second field is a value list based on selection A (select from A. .. A. .. where . A..) but if the field is not null then the list of values ​​of the second field is based on the selection B (Select B from B where B. ..). 

I create a dynamic action on the event "change" of my first field,  on the "true action" I tried this: 

declare  vva_ternum Varchar2 (3): = null;Begin   APEX_ITEM.SELECT_LIST_FROM_LOV (2, : P26_TERNUM, 'LOV_RSPRODUIT_TERRITOIRE'); End;  

But it does not work!! 

View 5 Replies View Related

Backup & Recovery :: Dropping Tablespace Including Contents And Datafiles

Jun 17, 2013

1) I have created One tablespace "ABCD" and assigned one user on it "ABCD_AR". I made table through the user and made some transaction.

2) Then I have taken RMAN backup, which include backup of tablespace (ABCD) also.

List of Datafiles in backup set 10
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 997754 17-JUN-13 C:APPADMINISTRATORORADATATESTSYSTEM01.DBF
2 Full 997754 17-JUN-13 C:APPADMINISTRATORORADATATESTSYSAUX01.DBF
3 Full 997754 17-JUN-13 C:APPADMINISTRATORORADATATESTUNDOTBS01.DBF
4 Full 997754 17-JUN-13 C:APPADMINISTRATORORADATATESTUSERS01.DBF
5 Full 997754 17-JUN-13 C:DATAFABCD01.DBF

3) After taking Rman backup, I issued command - "Drop tablespace ABCD including contents and datafiles;"

4) When i issue "LIst backup" through RMAN, its shows blank for the particular tablespace datafile.

SQL> DROP TABLESPACE ABCD INCLUDING CONTENTS AND DATAFILES;

Tablespace dropped.

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
[code]....

how to recover those tablespace's datafile?What happened to earlier tablesapce backup?

View 9 Replies View Related

Retrieving Max / Latest Date From A Table With A Join To One Another Table

Sep 19, 2011

I am having trouble retrieving the Max, latest date, from a table with a join to one another table and other fields from both.I was able to get the MAX service_date grouped by id. But once I tried to add more fields to the query and another table it won't work.

Here is what I have:

selectMAX(cs.service_date), cs.notes, cs.applicant_id,wr.program_code,wr.last_name,wr.first_name,wr.region_code,wr.status_cd
from cs join wr on cs.applicant_id=wr.applicant_id
where wr.status_cd='AC'
group by cs.applicant_id

View 3 Replies View Related

SQL & PL/SQL :: Display Date Ranges In One Column As Separate Date Periods (start And End Date) In Two?

Jun 1, 2010

I'm trying to work out how to take a table like this:

IDDate
12502-Feb-07
12516-Mar-07
12523-May-07
12524-May-07
12525-May-07
33302-Jan-09
33303-Jan-09
33304-Jan-09
33317-Mar-09

And display the data like this:

IDPeriodPeriod StartPeriod End
125102-Feb-0702-Feb-07
125216-Mar-0716-Mar-07
125323-May-0725-May-07
333102-Jan-0904-Jan-09
333217-Mar-0917-Mar-09

As you can see, it's split the entries into date ranges. If there is a 'lone' date, the 'period start' and the 'period end' are the same date.

View 13 Replies View Related

Forms :: Expiry Date To Automatically Show A Date 15 Years After Initial Date

Apr 12, 2010

I have a two date fields in my form; valid from date and expiry date.

Currently my valid from date has an inital value property of $$date$$ which automaitcally brings up todays date.

I need my expiry date to automatically show a date 15 years after this date?

View 8 Replies View Related

PL/SQL :: How To Find Max Date From A Table

Mar 2, 2013

I have two table in the database. I want to find the maximum routine date for a case_id when the lock_date is between 20 jan to 29 jan 2012 .

But I am not getting actual output (Output routine_date should be "28-jan-2012" but I m getting "31-jan-2012")

Master
case_id lock_date
101 23-jan-2012
101 24-jan-2012
102 27-jan-2012
102 29-jan-2012
101 30-jan-2012
101 29-jan-2012

Routine (for routine work)
case_id routine_date
101 23-jan-2012
103 28-jan-2012
102 21-jan-2012
102 29-jan-2012
101 21-jan-2012
101 28-jan-2012
101 31-jan-2012

select m.case_id, r.routine_date from master m, routine r,
(select case_id, max(routine_date) from routine group by case_id) rr

where m.case_id=r.case_id
and m.case_id=rr.case_id
and r.routine_date=rr.routine_date

View 7 Replies View Related

Forms :: Copy Contents Of Cid.idate To Id.idate?

Jan 1, 2013

I want to copy contents of cid.idate to id.idate .

View 1 Replies View Related

SQL & PL/SQL :: MAX DATE - Getting Records Out Of Source Table

Sep 28, 2011

Below is my requirement,

Source Table: SRC

COL1 DATE_CREATED CREATED_BY
1 27-SEP-2011 GURU
1 28-SEP-2011 SANKAR

Target Table:TGT

COl1 DATE_CREATED CREATED_BY
1 28-SEP-2011 SANKAR

I need to take the MAX of date_created record and store it in target.

I tried,

select max(date_created), col1, created_by from src
group by col1, created_by,date_created

Which is giving me 2 records which i don't want. How to get only one record out of that source table?

View 2 Replies View Related

SQL & PL/SQL :: Created Table With Date In Database

Feb 22, 2011

Me working on Oracle application Express,there are lots of tables created in it, how will i get to know who created which table and on which date.

View 7 Replies View Related

SQL & PL/SQL :: Create Table With Current Date

Jul 22, 2010

How can we create a table with current date in oracle this is to be done daily a job as following today's table name is MYTABLE-2010-07-23

so every day a job is to create a table with tablename-current date

is this possible? and how to

View 11 Replies View Related

PL/SQL :: Date Format In History Table

Mar 1, 2013

Issue with Date format. I am having data in date column in History table like

'2012/02/22 11:05:20 AM'
'2012/08/15 17:00:00'

I am doing extract from this table to txt file. i want date fomrat in "YYYYMMDD HHMMSS".

i tried below query:

select to_char(to_date('1998/05/31 11:00:00 AM','yyyy/mm/dd hh24:mi:ss'),'YYYYMMDD HH24MMSS') from dual;But it is giving error like "ORA-01830: date format picture ends before converting entire input string".

I am using ORACE 11g verion.
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE     11.2.0.3.0     Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

View 8 Replies View Related

Selecting Data From Table On Date Criteria

May 27, 2011

I am new to oracle and have an issue with selecting data from a table on date criteria.

select * from table1 t where t.DT BETWEEN TO_DATE(sysdate-1,'dd/mm/yyyy') AND sysdate

my understanding is that this should give me the data for just one day. but it is not.

What I want is, data for last 30days from today.

View 2 Replies View Related







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