SQL & PL/SQL :: How To Fetch Value Which Column Has Timestamp Datatype

Oct 14, 2012

i am running one query which is here

INSERT INTO shiftsample (Empid, PPDate, Inpunch, outpunch)( SELECT Emp_ID, PDate, In_Punch, Out_Punch FROM ProcessDailyData WHERE PDate = to_char(2012-10-15,'yyyy-MM-dd') AND Emp_ID = '00000001' );

in this query pdate has timestamp datatype and in shift sample ppdate column has date type. so i am not able to insert value from process daily data table.

getting this error.

SQL Error: ORA-01481: invalid number format model
01481. 00000 - "invalid number format model"
*Cause: The user is attempting to either convert a number to a string
via TO_CHAR or a string to a number via TO_NUMBER and has
supplied an invalid number format model parameter.

View 19 Replies


ADVERTISEMENT

One Table With A Columntype Timestamp Say Xyz Is Name Of Column

Sep 16, 2012

I have one table with a columntype "timestamp" say xyz is the name of the column.Suppose today is 15th Sept So I want to fetch all those records whose value is between 14th Sept 00:00:00 and 14th Sept 23:59:59.

And date I want to keep this as a variable.

View 5 Replies View Related

SQL & PL/SQL :: Query To Get Timestamp From Only One Date Column?

Apr 10, 2013

I want to write a query to get the time stamp from only one date column,

I tried using a group by clause but getting error "not a group by exp."

Below is the query

SELECT ProdID,ProdRequestID, SUBSTR((max(EVENTTIMESTAMP) - min(EVENTTIMESTAMP)), 18,2)Execution_Time
FROM LOG_TIMESTAMPS where ProdID = 1680988889
group by ProdRequestID
ProdID||ProdRequestID ||EVENTTIMESTAMP

[code]....

In the above i am looking for a diference on ProdRequestId,

Output

ProdIDProdRequestIDEVENTTIMESTAMP
16809888892013-04-09T02-56-34.5025kqcxy03

View 24 Replies View Related

Extract Date From Timestamp Column?

Jun 17, 2012

how to extract DATE from timestamp column

View 2 Replies View Related

PL/SQL :: Get Particular Value From Column Which Is BLOB Datatype?

Jul 31, 2013

on this query. I need to get a particular value from a column which is a BLOB datatype. Here is the sample

data ID                           TESTDATA1                            Best Buy
00001234 12222 30 00 2                           
Lowes 00001234 12222 100 00 3                           
Walmart 00001234 12222 129 00 4                           
abc 00001234 12222 5000 00 5                           
Toshiba 00001234 12222 21 00 6                           
abcdefghij 00001234 12222 49 00  

Where '00001234' is the Invoice , '12222' is Netamount field and highlighted in red is the $ amount for that invoice.

The only data i need query to return 12222 (netamount)= $amount. I tried using substr  select substr((TESTDATA),19,26)test from TABLEA; But this gives me the only the first row but not other amount which have different positions.

Here is the desired output

OutputID                            TESTDATA 1                          
12222 30 2                            12222 100 3                           
12222 129 4                            12222 5000 5                           
12222 21 6                            12222 49 

View 11 Replies View Related

SQL & PL/SQL :: Timestamp Column Whose Values Are In CET Timezone Needs To Be Converted To EST

Mar 6, 2012

I have a requirement in which a particular a timestamp column (date1) whose values are in CET timezone needs to be converted to EST and day light savings should be taken care of in the conversion logic. I should not use any ddl statements for altering the timezone and all.

View 9 Replies View Related

PL/SQL :: Oracle 10.2.0.4 Index On Timestamp Column Not Used When SYSTIMESTAMP Used

Oct 23, 2012

I have a table A with a column B timestamp(6). The tables contains around 300000 rows..I have created index 'idx' on the column B.When i compare column 'B' with systimestamp, it does not use the index, whereas if i compare 'B' with sysdate it uses the index.

Eg :
select count(*) from a where b<=sysdate;

The above used the index 'idx' and executed in 1 second

select count(*) from a where b<=systimestamp;

The above does not use the index and executed in 19 seconds.

View 4 Replies View Related

Updating A Table Column Which Is XML Datatype

Nov 1, 2011

I am updating a table column which is xml datatype and am getting above error.Below is the process what i did. since the xml is too large i split them into small chunks.

DECLARE
conditionXML CLOB;
ls_xml_2 Clob;
ls_xml_3 clob;
ls_xml_4 Clob;
ls_xml_5 Clob;
ls_xml_6 clob;
ls_xml_7 Clob;
[code]...

View 1 Replies View Related

SQL & PL/SQL :: Insert Value In Column Which Has Date Datatype?

Oct 12, 2012

i am having one column name pdate with date datatype

i am updating here value like this

update table1 set pdate='15-10-2012' where id=1;

but showing error: not a valid month.

how to update this.

View 7 Replies View Related

SQL & PL/SQL :: BLOB Datatype - Copy From One Column To Another

Mar 11, 2011

I have two tables with BLOB datatype. I am trying to copy from one column to another column , i am getting errors

CREATE OR REPLACE PROCEDURE update_blob_lob_copy(
v_id in integer,
v_string in varchar
)
as
auditlob lobdemoaudit.theblob%type;
sourcelob lobdemo.THEBLOB%type;
[code]...

View 3 Replies View Related

Datatype Of Column Of A Table In Oracle Or SQL

Aug 6, 2013

a) What if i want to find out the  Datatype of a specific column in the Table. 
b) How do i find the Column Datatypes?

View 3 Replies View Related

Increase Datatype Of The Column Which Already Has Data?

Apr 22, 2013

How to increase datatype of the column which already has data i.e. varchar 10 to 25 bytes

View 2 Replies View Related

Date To Timestamp Conversion Of Column With 150 Million Rows?

Oct 5, 2010

Due to some business requirements a table field needs to change from date to timestamp in order to handle the millisecs.

1>When i alter the row , for a table with 150 million recs will there be a conversion. Is there a recommended way to convert the field. Mind you this field is used as a part of composite PK.

2> There is a interfacing application which connects and copies the data to its system and is using the date type, will that application be able to continue to work without any changes, if it does not care about the millisecs.

3> Will there be performance impact on an existing application that uses the date field to sort

4> Will DB need more space due to the change

View 3 Replies View Related

SQL & PL/SQL :: Table Column Datatype With %type Attribute

Jun 23, 2011

Is it possible to replace datatype of column of one table with another table's column datatype using %type like below

SQL>create table test1 (v1 varchar2(10));

SQL>create table test2 (v1 test1.v1%type);

View 3 Replies View Related

SQL & PL/SQL :: Decrease Size Of Number Datatype Column

May 24, 2012

I want to decrease the size of testid column of number datatype in my "test" named table from size 20 to 15 and the data of maximum size is of 10 digits. but oracle throws an error "ORA-01440: column to be modified must be empty to decrease precision or scale". i cant understand why it is happening?

what is the reason behind it even though new size is maximum than the maximum size of existing data. but when i decrease the size of "varchar2" then oracle does not through any error.

View 3 Replies View Related

PL/SQL :: Search Of Table Names By Column Datatype

Apr 28, 2013

I have a requirement that i should list out all the table names which are all using timestamp datatype in a specified schema. Is there any way to find those table names by using any system tables.

View 1 Replies View Related

Application Express :: Retrieving Column Of Datatype RAW(16)

Oct 26, 2012

I have a table defined where some columns are of the datatype RAW(16). In fact these are foreign keys to other tables. Our company has a policy that all primary keys are of the datatype RAW(16). Not much I can do about that.

Now I want to retrieve all columns of a certain row in that table and just visualize the foreign keys in hex format. All values are filled out nicely, except the columns with datatype RAW(16). Is there something special I have to do to retreive and display these? I defined an item as text-field for these, but this doesn't seem to be working...

I'm using APEX 4.1.1.00.23 at this moment...

View 4 Replies View Related

SQL & PL/SQL :: Change Column Datatype From CLOB To Varchar2

Jun 22, 2012

I have to change the datatype of a column from CLOB to varchar2, without changing the order of the columns. The table has no data.
I could find any other way other than dropping the CLOB columns and then adding new columns with varchar2 datatype. But this changes the order of the columns in the table.

View 4 Replies View Related

SQL & PL/SQL :: How To Fetch Name Of Column And Table Name

Nov 30, 2011

how to get name of coloumn and table name which is being modified in trigger

View 8 Replies View Related

SQL & PL/SQL :: Read Only The Input String From BLOB Datatype Column?

Mar 28, 2013

I have a table that has column with BLOB datatype. I am trying read only the inputted String from the BLOB datatype column. I have used the below query,

SELECT utl_raw.cast_to_varchar2(column1) FROM TAB1
and it gives the result as
<H2><FONT color=#cc0000><EM><U>test</U></EM></FONT></H2>

However I would like to extract only the string "test" which is inputted. Is there any build-in function in oracle which will satisfy this requirement?

View 7 Replies View Related

Error While Using SQL Loader - Bad Datafile Datatype For Column RANGE

Apr 29, 2011

I am trying to load the data from .csv file into the table using SQL Loader.

The table has the following schema:
src_id : number,
dest_id : number,
range: intsys.interval_typ --- > a type containing (lower,upper)
payload : varchar2(100)

The loader.ctl file is :

load data
infile *
append
into table sb_packet
fields terminated by "," optionally enclosed by ' " '
(src_id,dest_id,range,payload)
BEGINDATA
3,32,intsys.interval_typ(10043,142703),"misc data"

When I use the following this ctl file to transfer the data, i get the following error:

SQL*Loader-418: Bad datafile datatype for column RANGE

View 2 Replies View Related

Fetch Multiple Value From A Column And Display It As A Row

Apr 19, 2011

I need to fetch the data from a particular column and display it as a row of data.

For example,

Table

Col1 col2 col3
1 6 10
1 7 11
1 8 12
2 6 18
2 7 null
2 8 19

Data should be diplayed using col 2 as partition as below

col1 col3 col3 col3
1 10 11 12
2 18 null 19

Note: I have also referred to this link [URL]....

View 1 Replies View Related

SQL & PL/SQL :: How To Fetch Column By Comparing Date

Oct 16, 2012

i am fetching one record based on date but not able to fetch the data.

in my table pdate column is there with date datatype and value is in that is:15-OCT-12 so i am fetching empid based on dates.

select empid from masterprocessdailydata where pdate=to_date('15/OCT/12','dd/MM/yy'); but not getting the empid.

View 11 Replies View Related

SQL & PL/SQL :: Cursor To Fetch Column Names

Jul 25, 2013

I have the following piece of

CREATE OR REPLACE PROCEDURE COMP_RECORDS
IS
l_query VARCHAR2 (10000) := '';

CURSOR TBL1
IS
SELECT TABLE_NAME, COLUMN_NAME FROM COLS_TO_COMP WHERE TABLE_NAME='ACE_HIST';
TBL1_REC APP.COLS_TO_COMP%rowtype;

[Code]..

However I am getting an ORA-00923 exception with message as "FROM keyword not found where expected". know if I can/cannot use a cursor to fetch column names for a table?

View 9 Replies View Related

SQL & PL/SQL :: Change Datatype Of Column In Table Online Using DBMS REDEFINITION?

Aug 8, 2011

Is it possible to change the datatype of a column in a table online, using DBMS_REDEFINITION?

If Yes, then which of the options will be used with DBMS_REDEFINITION package?

View 1 Replies View Related

SQL & PL/SQL :: Ref Cursor As In Parameter / How To Fetch Column Values

Sep 21, 2010

i have a proc that is taking p_serial_number refsursor as in parameter. the structure of p_serial_number is required to be

mfg_prod_cdchar (3 byte)
mfg_prod_seq_no char (6 byte)

How do I need to define this ref cursor ? and when I use it in my Procedure how do I fetch the column values ?

View 6 Replies View Related

PL/SQL :: Frame - Fetch Only 3rd Position From Column Customer-ts?

Dec 20, 2012

have a column cstomer_ts from table customer, which contain records like:

"cstomer account"||"PRIVATE"||"foundation"
"cstomer account"||"PRIVATE"||"foundation of money"
"cstomer account"||"PRIVATE"||"Moneycost"now i want to fetch the third record from the column cstomer_ts which starts with 'Foundation'

i mean i want to fetch only 3rd postion frm the column cstomer_ts and tht should starts with 'Foundation'

View 9 Replies View Related

Application Express :: ORA-01439 / Column To Be Modified Must Be Empty To Change Datatype

Sep 4, 2012

I need to modify the column type that already has data in it, i need it change varchar to number then The datas entered have $ and , (e.g $3,200). I need the $ and , removed with column type set to numbers.

When i currently do this i get the following error:

The TABLE operation was not successful for the following reason:

ORA-01439: column to be modified must be empty to change datatype

I've tried unloading the data and loading the data using the spreadsheet, cut and past and csv file but both give me more errors, so i just want that one column modified.

View 2 Replies View Related

PL/SQL :: Conversion Of BLOB Datatype To CLOB Datatype

Aug 17, 2012

I would need to convert the column datatype from BLOB to CLOB. currently in the table, the BLOB column has the data. the requirement is to convert this column from BLOB to CLOB datatype.

How to convert from BLOB datatype to CLOB datatype ?

View 10 Replies View Related

Application Express :: How To Fetch Tabular Form Column Value Into Page Items

Sep 7, 2012

I have created tabular form. I have set LOV for one column. Here my requirement is when i select the value from lov then it will fetch that value into page item.

I am using apex 4.1

View 12 Replies View Related







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