Problem converting varchar2 to date data type
Hi allI am facing a problrm when writing a query to extract a SIT of all employee details in which I compared the "sysdate" with a column of type "varchar2" of the table SIT. I get the following error ORA-01841: (full) year must be between-4713 and 9999 and not 0 and the execution of the query
++++++++++++++++++++
SELECT papf.person_id,
WOMEN'S WEAR. Employee_number,
PAPF.full_name,
CAP. Work_permit_type Segment2,
PAC.segment7 visa_expiry_date
OF per_all_people_f women's wear.
per_person_analyses App,
per_analysis_criteria CIP,
fnd_id_flex_structures_tl fifst,
fnd_id_flex_structures FIFS
WHERE papf.person_id = ppa.person_id
AND BETWEEN TRUNC (SYSDATE) papf.effective_start_date
AND papf.effective_end_date
AND papf.current_employee_flag = 'Y '.
AND ppa.analysis_criteria_id = pac.analysis_criteria_id
AND pac.id_flex_num = fifs.id_flex_num
AND fifst.id_flex_structure_name = 'THE SIT NAME'
AND fifst.language = USERENV ('LANG')
AND fifst.application_id = fifs.application_id
AND fifst.id_flex_num = fifs.id_flex_num
AND TO_DATE (pac.segment7,'YYYY/MM/DD HH24:MI:SS') > = trunc (sysdate)
AND papf.employee_number = '9127327':
+++++++++++++++++++++++++++++++++++++
The strange thing is the query above works fine witout the last filter condition (AND papf.employee_number = '9127327') but get the mentioned error i.e ORA-01841: (full) year must be between-4713 and 9999 and not 0 with the State.
Could someone help me on this?
Published by: Kumar Koch on 4 December 2012 02:58
Hello world...
Thank you for your support.
What some, I have maneged to get the result by adding an additional filter to condtiotn with the request in the form beloew.
({AND REGEXP_LIKE (pac.segment7,'[0123456789]{4}/[0123456789]{2}/[0123456789]{2}')
}
Tags: Database
Similar Questions
-
Problem with the CLOB data type.
Greetings,
I am facing a problem with the CLOB data type. I know that the CLOB data type is 4 GB (I use Oracle 9i). But in the Pl Sql procedure, I can only store 34305 size for a CLOB variable character data.
This is the test script that I am trying to run.
DECLARE
-Local variables here*.
I have INTEGER;
C_1 CLOB.
BEGIN
FOR Rec IN (SELECT
*
ACCORDING TO THE TABLE)
LOOP
C_1: = c_1 | Rec.Clo_1;
END LOOP;
EXCEPTION
WHILE OTHERS THEN
Dbms_Output.put_line (SQLERRM);
END;
Here variable C_1 range value 34305 good character regardless of type CLOB. Now the above script fails if query my buckle - huge number of return values. It is throwing the exception "error during transfer of files ORA-06502: PL/SQL: digital error or value."
He would be grateful if someone can help me on this.
Thank you.You are probably better off using DBMS_LOB.append, instead of the concatenation of varchar2 (|).
And... take off your when-other Manager exceptions, please...
-
I want to convert the double data type to string type
I want to convert the double data type to string, have idea about thatHello
Use f
FN: String (ARG) returns the string value of the argument. The argument can be a number, boolean, or node-set element
Example: string (314)
Result: "314".http://w3schools.com/XPath/xpath_functions.asp#string
See you soon,.
Vlad -
convert the money data type in a decimal format 2.
What is the best way to convert the money data type in a decimal 2 format in ms sql 2005 for use in my applications.
This?
CAST (tr.depositReceivedAmount AS decimal (10, 2))
I respectfully disagree with the idea that you must change the query column a type of 'money' data to something else.
In most database servers, "«argent» Silver" is a data type that is designed to provide a very homogeneous behaviour with regard to the arithmetic accuracy. In Microsoft Access, the representation is a the whole scale. MS SQL Server, it is obviously similar. Ditto Oracle and others.
You like that the money data type in the database for this clarification, because "hell has no fury like an accountant looking for a bad penny." The column of database storage formats are designed to satisfy the accountants, and it's a good thing.
Meanwhile, you also want to take care as to exactly how you are dealing with values. There are several points where the district could take place. You don't have available the strongest possible manipulation of the floating of the data types in ColdFusion. You also are somewhat at the mercy of any interface software can be between you and that SQL server, you can use. "It is correct to all about values , but not several times."
I suggest to round the value just before the display and user input must be two decimals.
Then, you may need to do some things at the end of SQL server. For example, when you update a value in the table, you may need to use logical server to explicitly truncate the value to two decimal places, as well as an update of "$ 34,56" explicitly updates the column "$34,5600.." (This kind of thing should happen in the context of SQL Server). You know that the user entry has exactly two significant digits, but maybe (maybe not...)! SQL server may not know this. You want to ensure that the stored server internally represents exactly two digits, when the origin of a user input value.
Do not err on the side of "convenience" or "which seems." good on the screen (If you do, get ready get telephone communications of the accountants, always at inappropriate times of the night.)
-
Problems with the Long data type conversion
With the help of Oracle 11 G.
I have a vision where one of the name of the column is of type long, I need to convert in varchar2. I tried using the to_Lob() function, but this error:
ORA-00932: inconsistent data types: expected - got LONG
I followed this article (step 1), which suggests to use to_lob()
My query is:
I tried to convert it into:select item1, -- this is of type LONG item_vat, price_pc_tot, from xd_item_price_view
I am confused about the "-", why he would expect that? Thanks for watching it.select to_lob(item1) as item1_x, -- this is of type LONG item_vat, price_pc_tot, from xd_item_price_view
>
Sorry mate, just realized that. Yep, this is the one I followed (step 1 using to_lob())
>
It's a case of 'use' along in a query or search.But you can use to_lob as part of creating a new table.
Response to see Dom Brooks in this thread
Re: Conversion long to varchar2And he directly answered your original question
>
But you can't use TO_LOB in a statement SELECT right: -
Data problem whith model number data type
Hi all
Here's a strange thing with the data model of the Editor (Oracle Business Intelligence 11.1.1.7.0 / windows 7 / Firefox).
Create a data set of sql query with this statement "select 1.23 double." The data type of the column is whole and cannot be changed.
So I use the cast function "select cast (1.23 v number (16.2)) double ' and now it's OK the data type is double.
Now add a second line, change the statement like this:
Select cast (1.23 v number (16.2)) double
Union of all the
Select cast (4.56 v number (16.2)) double
If you save the template, and charge it, the type of data has changed in full!
Anyone know why this is happening?
The patch should be applied, but is a temporary solution:
Select cast (d.v number (12,2)) v
de)
Select v 1.23 double
Union of all the
Select 2.34 double v
) d
Thank you
-
problem with the blob data type
Hello
Hi just created a blob table data type and insert a text file of the directory - file "DG" and text contain text "Hello dba.
CREATE TABLE blob_sample (id, NUMBER, blob_data BLOB);
DECLARE
l_bfile BFILE.
l_blob BLOB;
BEGIN
INSERT INTO blob_sample (id, blob_data)
VALUES (1, empty_blob())
RETURN blob_data INTO l_blob;
l_bfile: = BFILENAME ("'DG', ' hello.txt");
DBMS_LOB. FileOpen (l_bfile, Dbms_Lob.File_Readonly);
DBMS_LOB. LoadFromFile (l_blob, l_bfile, DBMS_LOB.getlength (l_bfile));
DBMS_LOB. FileClose (l_bfile);
COMMIT;
END;
/
SQL > select * from blob_sample;
ID BLOB_DATA
1 68656C6C6F206462612773
Above is coded image shape & I try this with the Insert as below... IT WORKS
SQL > insert into blob_sample (id, blob_data) values (1, '68656C6C6F206462612773');
1 line of creation.
But this does not work when encoded length is too large (size 10 KB text file or more)
It returns error
insert into blob_sample (blob_data) values ('416374697
*
ERROR on line 1:
ORA-01704: string literal too long
Please HELP how how can I insert with this method
Published by: Mr. singh on 9 October 2012 18:54
Published by: Mr. singh on October 9, 2012 19:38It does not make sense to try to build a literal string that represents the binary data in a GIF file and that insert a BLOB using an INSERT... Statement of VALUES.
You can use the first approach (dbms_lob.loadfromfile) to load a GIF file (or any file) into a BLOB.
If the image you are trying to load is not a file on the filesystem of database, you can use SQL * Loader on the client machine to load the data, or you can write an application in any language you want that reads the data from the file and inserts it into the BLOB by using the API in your language / framework. You have not told us what language and framework you use, but it shouldn't be too hard to find a suitable example. For example, if you use Java and JDBC, here is an example of loading a GIF in a table.Justin
-
Problem with the percentage data type
Hello
I understand that if a member account data type is percentage, then the corresponding value in the form of data is displayed as a percentage. For example, if I need to get 50% against the particular account member, then I can type either 0.5 or 50%. But is there the parameters by which if I hit 50, system will consider as 50%, not 5 000%.
Thank you.You can type either 0.5 or 50%
See you soon
John
http://John-Goodwin.blogspot.com/ -
Converting Varchar2 to date is prob
Hello guys
My column contains in fact date in the following format
JJ/mm/aaaa
I'll try this query to update in
something like
dd/mm/yyyy HH24:MM:SI
When I use the SELECT statement, it worked fine but when I update the column there
say not one month valid
Please look at the querys
date of creationselect to_Char(to_date(create_date,'mm/dd/yy HH24:MI:SS'),'mm/dd/yyyy HH24:MI:SS') from Report where trunc(Load_Date) = trunc(sysdate - 52) --WorkingFine --but this one not its getting updated no issue in update statment. Update Report Set Create_date = to_Char(to_date(Create_date,'mm/dd/yy HH24:MI:SS'),'mm/dd/yyyy') where trunc(Load_Date) = trunc(sysdate - 52) {Code} Here is my sample data
16/09/2009
15/09/2009
and so onThe create date column is in Varchar2 type Please help dun knw wat i am doing wrong any suggestion will be appreciated Thanks
If you want this format (mm/dd/yyyy HH24.MI:SS) after updating the table, your update to be:
Update Report Set Create_date = to_Char(to_date(Create_date,'mm/dd/yy HH24:MI:SS'),'mm/dd/yyyy hh24:mi:ss') where trunc(Load_Date) = trunc(sysdate - 52)
Max
-
Problem with the incompatible data type
Hi all
I wrote this query and trying to run it and got the following error.
I got this error when I add column.if description I do not add the description column query works fine. _
Attempted to solve by other means but did not work.
Please help on this.
SELECT the description, product, /*Defect.Product*/
TO_CHAR (BG_DETECTION_DATE, 'yyyy') year,
TO_CHAR (BG_DETECTION_DATE, 'Q'). ' Q'Quarter
BUG
where service_type as "Incident".
and produced in ("Siebel", "Intg_Mgmt", "SOA", "NICE", "Genesys", "DW Analytics")
AND DETECTION_DATE
BETWEEN TO_DATE('01-01-2009','MM-DD-YYYY')
AND TO_DATE (OCTOBER 30, 2010 ","DD-MM-YYYY")
Group of to_char(bg_detection_date,'yyyy'), to_char(bg_detection_date,'Q'),
product, description
order by product, year desc, asc quarter
error: ORA-00932: given inconsistent type.expected get clob_Try to replace every occurrence of "description" by 'dbms_lob.substr (description, 100, 1)' in your query, for example.
It of OK if you want to show how only and group using the first 100 characters of the column "description".
-
How to handle the data type DECIMAL MySQL converted to DOUBLE in OBIEE 10 gR 3?
Hi all
I have a problem in OBIEE 10g to I use the MySQL database as datasource direct to the server of the OBI and I have a column in a MySQL table which was designed as the DECIMAL data type (18.0).
This column is used to measure a length, and values are included in seconds (without decimals), in the form as:
"1200"
in the MySQL database.
After the import of the MySQL table associated with the repository of the OBI, the OBIEE converts the DECIMAL data type column to the DOUBLE PRECISION data type automatically.
My goal is to reach the values in this form, certainly in the sense of the term (not at the time!):
hh mm ss
In order to accomplish, I tried to change the format of column with the ROUND function:
ROUND (db.table.column / * 3600 * 2)
The problem is that it doesn't work well if values can be divided with no rest for example
original value: 7200
new value (ROUND): 2
In the case of my example:
original value: 1200
new value (ROUND): 0
It's false, because 1200 seconds are not equal to 0 hours, I want to see two hours of _0.33333_ OR I much prefer more _0 hour 20 m_
Anyone have any ideas?
I tried to make a view of database and importing that type of CHAR data in the database, but is not the solution too, because if I filter BI app or try to make a SUM the BI would drop errors...
Kind regards
LaszloHello
SE refer to this link, it is exactly will meet your need.OBIEE 11 g - change seconds in the format hh: mm: DD
OBIEE functionsShare updates... :)
check if useful/correct...
-
Hello
I used the Labview FPGA module to develop test equipment. Now, I need to write a driver that is to be a Dll with compatible interface to C/C++ for this equipment. So that my client who is familiar with C/C++ can call the driver without any study on labview. But I had a few problem on how to convert labview for C/C++ data complex data type. To clearly explain to my question, I have attached a simple example. (see attachment) I try to generate a Dll for the attached example VI and get the the function prototype at the head of the files as below:
' void OpenFpgaReference (LStrHandle * RIODevice, TD1 * errorIn, LVRefNum * FPGAVIReferenceOut, TD1 * errorOut).
As you have known, the type of data "LStrHandle * RIODevice" and "LVRefNum * FPGAVIReferenceOut" Labview data format are. C/C++ do not have this kind of data type and can not reconige it. As a result, I can't call the Dll of C/C++ programming language. How to convert these two data type of labview for the C/C++ compatible data format, and then build the Dll? Anyone know about this?
The answer is really apprecaited! Thank you in advanced.
Ivan.Chen wrote:
As I found in the following article:
http://digital.NI.com/public.nsf/WebSearch/FB001AA027C8998386256AAD006C142D?OpenDocument
LVRefNum is the name of resource of LabVIEW VISA or refnum, and "it is impossible to convert LabVIEW VISA name of resource or refnum VISession valid ID."
This means that external code modules can not access & control the session VISA which is open by labview. But for my purposes, I will not attempt to access this VISA extenal code(C/C++) session. I just hope that save this session VISA in the external code once I opened it in Labview dll; and pass it to the labview dll when needed. While I have not need to login again when I need to control the device. Is it possible to do?A LVRefNum is really just a single int32 value. Its meaning is useless for other environments than those who created it so that you Michael not any what in C/C++ caller but pass it back to other functions in your DLL, but this often isn't a problem at all.
You can take the following statement of the LabVIEW extcode.h headers and add them to your delabviewed header files to make it work in such a way.
#define Private (T) typedef struct T # _t {void * p ;} * T}
Private (LVRefNum);
The LStrHandle you must set a standard C string instead in your export DLL and document what is the size of the string buffer should have if it is an output parameter.
TD1 error clusters should also be divided into their parameters (C compatible) separate for all items or just to the left of suite entirely.
Rolf Kalbermatter
-
Conversion of the data type of a table column
Hello
I have a column with the varchar2 data type. I want to convert to number data type. But the data in the table are not lost. Can someone suggest me how to convert the column with the varchar2 data type to store the data in the table of number data type.
Thanks in advancetry something like this
create table t(col varchar2(10)); insert into t values('1'); insert into t values('2'); commit; select * from t; alter table t add col1 number; update t set col1 = to_number(col); commit; alter table t drop column col; alter table t rename column col1 to col; select * from t;
Published by: Karthick_Arp on April 6, 2009 12:32 AM
-
Hi all
We can overload subprogrammes that setting differ in the number, order, and type of family data. But impossible to overload if the parameter differs only in the void type.
If I see the standard package, I get
subtype types BINARY_FLOAT is NUMBER;
subtype BINARY_DOUBLE is NUMBER;
But I am able to overload the two procedures, we have a parameter types binary_float and binary_double other. They are of subtype of the same data type. that is the number. So, how is it possible. Also, most of the subtypes have no difference. So, why are there these number of subtypes? Oracle defines subtypes as data type with some sort of constraint on the base data type, but is valid for all? for example, smallint, and decimal.
type of NUMBER is NUMBER_BASE;
subtype of FLOAT is NUMBER;
ACTUAL subtype is FLOAT;
subtype 'DOUBLE PRECISION' is FLOAT;
INTEGER subtype is NUMBER (38.0).
subtype INT is INTEGER;
subtype SMALLINT is NUMBER (38.0).
DECIMAL subtype is NUMBER (38.0).
DIGITAL subtype is DECIMAL;
DEC subtype is DECIMAL;>
We can overload subprogrammes that setting differ in the number, order, and type of family data. But impossible to overload if the parameter differs only in the void type.If I see the standard package, I get
subtype types BINARY_FLOAT is NUMBER;
subtype BINARY_DOUBLE is NUMBER;But I am able to overload the two procedures, we have a parameter types binary_float and binary_double other. They are of subtype of the same data type. that is the number. So, how is it possible. Also, most of the subtypes have no difference. So, why are there these number of subtypes? Oracle defines subtypes as data type with some sort of constraint on the base data type, but is valid for all? for example, smallint, and decimal.
type of NUMBER is NUMBER_BASE;
subtype of FLOAT is NUMBER;
ACTUAL subtype is FLOAT;
subtype 'DOUBLE PRECISION' is FLOAT;
INTEGER subtype is NUMBER (38.0).
subtype INT is INTEGER;
subtype SMALLINT is NUMBER (38.0).
DECIMAL subtype is NUMBER (38.0).
DIGITAL subtype is DECIMAL;
DEC subtype is DECIMAL;
>
Some of those who, as a smallint, SQL ANSI data types. See table 2-6 ANSI Datatypes converted to Oracle data types in the doc of the SQL language
http://docs.Oracle.com/CD/B28359_01/server.111/b28286/sql_elements001.htmOracle allows the name of the ANSI data type to use and combines the name of the ANSI for the appropriate Oracle data type
>
ANSI SQL/DS and DB2 data typesThe SQL statements that create tables and clusters allows also ANSI data types and products IBM SQL/DS and DB2 data types. Oracle recognizes the ANSI or IBM data type name that differs from the Oracle database data type name. It converts the data type for the equivalent Oracle data type, stores the Oracle data type under the name of the column data type and stores the data in the column in the data type Oracle based on the conversions listed in the following tables.
>
But BINARY_FLOAT and BINARY_DOUBLE types are each defined as unique data types (see table 2-1 in this doc).Because they are unique Oracle data types, they can be overloaded.
-
ORA-00902: invalid data type
Hello
What is the problem with my NUMBER data type:
Thank you.SQL> create table sale (purchase-no NUMBER (9) CONSTRAINT sale-purchase-no-pk PR IMARY KEY , costumer-id NUMBER (9) CONSTRAINT sale-customer-id-nk NOT NULL); create table sale (purchase-no NUMBER (9) CONSTRAINT sale-purchase-no-pk PRIMARY KEY , costumer-id NUMBER (9) CONSTRAINT sale-customer-id-nk NOT NULL) * ERROR at line 1: ORA-00902: invalid datatype
Your column and constraint names have traits that are not allowed in the names of identifiers.
Try using instead underscore traits.
Maybe you are looking for
-
Satellite P20: unit stops during playback of DVD
I JUST BOUGHT second hand satellite p20... Well I recharge the battery.I put a dvd 3 or 4 cd (always good at the other players and cd rom) after 3 minutes or 10 minutes or less... well no reason (the battery control save energy were on "never turn of
-
HP Pavilion DV6 touchpad does not and now the keyboard doesn't work
-
How can I connect to someone who is hacking my network?
How can I connect to someone who is hacking my network?
-
Stop code 0x8E problem.
I got the stop next to the startup code (tried multiple restarts with the same problem). I haven't added any new s/w or h/w recently, with the exception of windows updates last week (computer started without problem since these updates so far). Wha
-
What happens if I disable the processor in Device Manager
I see 2 processors in Device Manager. What happens if I disable the processor in Device Manager