Float value converted into unwanted value
Hello,
I have a situation with a strange float(22) value conversion during insert. Value 244655737199025 appears as 244655700000000 in the desination table.
It is a simple "insert into +table1+ select from +view1+" statement.
The result of "select * from view1" is correct though.
Any ideas?
Edited by: avtandil on Apr 29, 2009 12:17 PM
Sorry, my bad.
I can see the source of the issue. In an OraEdit tool I use for Pl/Sql programming:
SQL>desc table1 (target)
FORMINDEX FLOAT(22)
SQL>desc view1
FORMINDEX FLOAT(22)
In SQLPlus
SQL>desc table1 (target)
FORMINDEX FLOAT(22)
SQL>desc view1
FORMINDEX FLOAT(126)
Thanks guys
Similar Messages
-
String field value convert into Date with validation
Dear all,
I need some help if someone can please?
Actually I am getting date in string format as 20110315 or 20111025 or so on. I could use to date function for this for conversion but what if 20091432 which is wrong so I can hadle this.
Actually I m using oracle 10g and using anonymous pl SQL block . Can't write function or procedure for this. So I am extracting all the data including date as above and setting some flag so if date is correct then y otherwise no. Pls help. I think I have described everything what exactly I want?
If date is correct then insert in the different table otherwise setting flag if date is not correct. I.e. bdate varchar2
Best regards,
Edited by: Irha10 on 26-Jul-2012 12:29Why wouldn't you be able to use a function or procedure in your anonymous block?
SQL> declare
2 --
3 function is_valid_date
4 ( p_str in varchar2
5 , p_format in varchar2 default 'yyyymmdd'
6 )
7 return varchar2
8 as
9 dt date;
10 begin
11 dt := to_date(p_str, p_format);
12 return 'Valid';
13 exception
14 when others
15 then
16 return 'Invalid';
17 end;
18 --
19 begin
20 for rec in ( select 20110315 str from dual union
21 select 20111025 from dual union
22 select 20091432 from dual
23 )
24
25 loop
26 dbms_output.put_line(rec.str||' '||is_valid_date(rec.str));
27 end loop;
28 end;
29 /
20091432 Invalid
20110315 Valid
20111025 Valid
PL/SQL procedure successfully completed.Just a small example, instead of dbms_output, you could do an update of a 'Valid' column etc. etc... -
In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
CameraRAW : RGB, 128,0,0
Lightroom: RGB, 43,8%, 19,0%, 6,2%
CameraRAW: RGB, 0,128,0
Lightroom: RGB, 29,8%, 47,5%, 17,5%
Mainly i have two questions:
1. Is there any possibility to change the percent RGB values in LR to absolut values?
2. How can i convert CameraRAW values to LR values (see above)?TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.
-
Function module to convert character value of month into numeric value?
Hi Experts,
I need to convert a character value of a month in three alphabets to its numeric value.
e.g. 'jun' should be converted into '06' and 'jan' into '01' using a function module.Can anybody please provide me a similar function module?
TIA
Abhishektry this code:
DATA: text(20) TYPE c,
date TYPE sy-datum.
text = '06. Jul 06'.
TRANSLATE text TO UPPER CASE.
TRANSLATE text USING '. '.
CONDENSE text NO-GAPS.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
EXPORTING
input = text
IMPORTING
output = date.
WRITE date USING EDIT MASK '__.__.____'.
Regards,
Dara. -
How do i convert a float value to a double value?
How do i convert a float value to a double value? HELP PLEASE!! im very stuck!! i gota float data type and i need to convert it to a double data type in order to use it in another operation.....
thank u so much!safe dint realise ppl were so arrogant. thanks for the reply but less of the sarcasm!
-
in fact it's about mac:excel8 or 11 in OSX10.7.4,
how convert in a cell a number written in text format into its value?
cheers francoisHi francois,
If I copyone of them and do a past special/value, it does not work.
Try just Paste instead of Paste Special > Value
I know your question is about Excel, but this works in Numbers:
Copy 1 234 567 (with spaces) and Paste (not Paste Special) into a Cell in a Numbers Table. The result is 1234567 and it behaves as a number. A formula will consider it to be a number:
You asked Wayne: what do you mean by "to reference a cell" ??
The reference is from Cell A2 to Cell A1 through a formula, such as: =A1+1
Regards,
Ian. -
Why can one spot colour convert into two different sets of CMYK values?
Working within Illustrator CC, I have an EPS file of a logo which has a colour fill value of:
Pantone 152 U
CMYK: 0C 51M 100Y 1K
When I copy and paste this into a new document I get a much duller colour (orange) with colour values of:
Pantone 152 U
CMYK: 2C 57M 83Y 2K
I have enabled 'ask when opening' & 'ask when pasting' for Profile Mismatches in Edit->Color Settings->'Color Management Policies' - no warning shows up.
I have also tried turning off, changing color management policies.
I've opened the original eps file and assigned my working space profile (Coated FOGRA39) and then try copy and pasting without success.
Help!In addition to John's useful comments:
Using Pantone 512U (uncoated) isn't correct for Coated Fogra.
Why can one spot color convert into two different CMYK sets if converted by the user?
Assumed, the one spot color is uniquely defined by one Lab set:
– the CMYK spaces are different
– the CMYK spaces are the same but the Rendering Intents are different
– the CMYK spaces are the same but the Black Point Compensations are different
(on or off for Relative Colorimetric).
Assumed, the spot colors are equal by name, but valid for different versions, both in Lab:
– this obviousl at present the most common source of deviations.
Assumed, the spot colors are defined by CMYK:
– a chaotic situation which I wouldn't even like to dicuss.
– CMYK to CMYK conversions should be avoided under all circumstances.
The solutions:
If the spot color will be printed always and everywhere by Pantone spot ink:
– purchase an actual Pantone color fan und discuss with the printer the mixture for the selected ink.
If the Pantone color is merely a design feature, but the doc will be printed by CMYK:
– choose such a color and verify by soft proofing that the color is in-gamut for common CMYK spaces.
– read the Lab values and proceed as far as possible using Lab.
– don't use ink names, don't use any reference to Pantone.
– convert into to a specificic CMYK space in advance to the generation of the specific PDF.
Best regards --Gernot Hoffmann -
Need to convert a binary value into decimal
Hi i need to convert a binary value which i would be getting as a string object to a decimal value......need code for the same
Check Integer.parseInt
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int) -
Converting 11 digit value into 18 digit value by filling from left to right
Hello Experts,
I'm a newbie in ABAP-coding. I didn't found anything in the forum, so I'm sure somebody could give a little help. I would like to concatenate value into field name "mat". The input length is 11 the output length should be 18. Could you please look at the code belove:
data: c1(7) value '10000002',
c2(3) value '001',
c3(1) value '0',
mat type /BI0/OIMATERIAL.
CONCATENATE c1 c2 c3 into mat.
write mat.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = mat
IMPORTING
OUTPUT = mat.
But is not giving me the correct result. I've defined a field "mat" which has the same proerty as 0MATERIAL and length = 18.
After concatenating values into mat, the result should be 10000002001 (length = 11).
But I would like the result to be showing from left to right in this way: 000000010000002001 (length = 18)
Could somebody tell where the problem could be?
Many Thanks
MamadouThe probelm appears to be with
mat type /BI0/OIMATERIAL.
I changed it to
MAT(18)
and got
000000010000000010
Rob -
How to Change Numeric Value into Character Value in Reports at run-time?
Hi,
I am creating some reports, in which i am facing a problem.
i have an AMOUNT field of "NUMBER" data type in a table, I want to show the AMOUNT value in Character at run-rime.
For example, if AMOUNT is 12000 then it should be converted into Character like "Twelve Thosand".
Please help me to make it clear.
Thanking you in advance.u can get decimal points through this function
FUNCTION amt_2_word(amt varchar2) RETURN Char IS
BEGIN
declare
--TYPE v_arr IS VARRAY(6) of varchar2(3);
len number;
i number;
t_amt varchar2(100);
t_word varchar2(20000);
last_3rd varchar2(1);
main varchar2(1000); -- number in format main.sub
--v_main v_arr := v_arr('00','0','00','00','000');
v_main1 varchar2(3) := '00';
v_main2 varchar2(3) := '0';
v_main3 varchar2(3) := '00';
v_main4 varchar2(3) := '00';
v_main5 varchar2(3) := '000';
sub varchar2(1000);
res_1 varchar2(32000);
res_2 varchar2(32000);
res_3 varchar2(32000);
res_4 varchar2(32000);
res_5 varchar2(32000);
res varchar2(32000);
begin
t_amt := lpad(amt, 10, '0');
len := length(amt);
i := instr(amt, '.');
if i = 0 then
main := lpad(amt, 10, '0');
sub := '';
else
main := lpad(left(amt, instr(amt, '.')-1), 10, '0');
sub := rpad(right(amt, len - instr(amt, '.')), 2, '0');
end if;
v_main1 := right(main, 2);
v_main2 := left(right(main, 3), 1);
v_main3 := left(right(main, 5), 2);
v_main4 := left(right(main, 7), 2);
v_main5 := left(main, 3);
if v_main1 <> '00' then
res_1 :=getTwo(v_main1);
end if;
if v_main2 <> '0' then
res_2 := getOne(v_main2) || ' Hundred ';
end if;
if v_main3 <> '00' then
res_3 := getTwo(v_main3) || ' Thousand ';
end if;
if v_main4 <> '00' then
res_4 := getTwo(v_main4) || ' Lac ';
end if;
if v_main5 <> '000' then
last_3rd := left(right(v_main5, 3), 1);
if last_3rd <> '0' then
res_5 := getOne(last_3rd) || ' Hundred ';
end if;
res_5 := res_5 || getTwo(right(v_main5, 2)) || ' Crore ';
end if;
res := 'Rupees ' || res_5 || res_4 || res_3 || res_2 || res_1 || ' ';
if sub is null then
res := res || 'Only';
else
res_1 := getTwo(sub);
res := res || 'and Paise ' || res_1 || ' Only';
end if;
return res;
end;
END;
u write this PL SQL in ur databse and u can use this function and get amount to word -
Conversion failed when converting the varchar value to data type int
Hi, I am unable to resolve this error and would like some assistance please.
The below query produces the following error message -
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'NCPR' to data type int.
Select Pc2.Assess,
Select Pc1.Title
From Pc1
Where Pc1.Assess = Pc2.Assess
) [Title]
From Pc2
However, when I run the query below I get the results shown in the image . Ie. nothing. Pc1 & Pc2 are aliases and are the same table and the assess field is an int. I found NCPR in one cell but that column (prop) is not used in the query. The table
is nearly 25k rows.
SELECT * FROM Pc1 WHERE Pc1.Assess LIKE '%NCPR%' OR ISNUMERIC(Pc1.Assess) = 0
Thank youWHERE ISNUMERIC(id) = 1 and there are obviously no 'NCPR' records in the view as per my previous post.
That is a bad assumption - SQL Server does not have to evaluate the query in the order you are expecting it to.
Take this simple example
CREATE TABLE #example
col1 VARCHAR(50) NOT NULL
INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
SELECT * FROM
SELECT * FROM #example
WHERE ISNUMERIC(col1) = 1
) X
(3 row(s) affected)
col1
1
2
(2 row(s) affected)
compare to
CREATE TABLE #example
col1 VARCHAR(50) NOT NULL
INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
SELECT * FROM
SELECT * FROM #example
WHERE ISNUMERIC(col1) = 1
) X
WHERE col1 = 1
(3 row(s) affected)
col1
1
Msg 245, Level 16, State 1, Line 8
Conversion failed when converting the varchar value 'NaN' to data type int. -
Conversion failed when converting the varchar value to data type int error
Hi, I am working on a report which is off of survey information and I am using dynamic pivot on multiple columns.
I have questions like Did you use this parking tag for more than 250 hours? If yes specify number of hours.
and the answers could be No, 302, 279, No and so on....
All these answers are of varchar datatype and all this data comes from a partner application where we consume this data for internal reporting.
When I am doing dynamic pivot I get the below error.
Error: Conversion failed when converting the varchar value 'No' to data type int.
Query
DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH('')),1,2,'')
SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',0) as ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH(''))
SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
FROM (SELECT QID, QNAME, ANSWERS, Question
FROM Question) T
PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
EXECUTE (@SQL)
I am using SQL Server 2008 R2.
Please guide me to resolve this.
Thanks in advance..........
Ionecreate table questions (QID int, QNAME varchar(50), ANSWERS varchar(500), Question varchar(50))
Insert into questions values(1,'a','b','c'), (2,'a2','b2','c2')
DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH('')),1,2,'')
SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',''0'') as ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH(''))
SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
FROM (SELECT QID, QNAME, ANSWERS, Question
FROM Questions) T
PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
EXECUTE (@SQL)
drop table questions -
Convert an integer value that was created with the Excel DATEVALUE formula to a valid date?
Hello everyone,
How can I convert an integer value that was created with the Excel DATEVALUE formula to a valid date in SSIS?
Is this even possible?
For example:
=DATEVALUE("8/22/2008") will format the cell to display 39682.
Reading the column as a string to get the int value (39682) - how can I turn this into a valid date using SSIS and then importing the real date to sql server?
Thank you!You can use Script component for this and convert your integer values to Date. An example here is following:
CultureInfo provider = CultureInfo.InvariantCulture;
string dateString = "08082010";
string format = "MMddyyyy";
DateTime result = DateTime.ParseExact(dateString, format, provider);
Source: http://stackoverflow.com/questions/2441405/converting-8-digit-number-to-datetime-type
Vikash Kumar Singh || www.singhvikash.in -
How to convert ResultSet's value to String
Dear JDC's
plz tell me how to convert ResultSet's value to String.
kashifI want to read a whole array from a table into a String[]
and then send it to another servlet before I forward it all to anther servlet with request.setParameter.....
Any ideas how to solve it....that is how far I got so far:
rs=pgresult("select count (answer) from answers where qid="+idnum);
numberofquestions = rs.getInt("mynumber");
rs=pgresult("SELECT answer FROM answers WHERE qgroup="+qgroup);
allanswers = new String[numberofquestions];
allanswers = (String[])rs.getArray(1).getArray();
req.setParameter("allanswers",allanswers);
RequestDispatcher dispatcher = req.getRequestDispatcher("editanswers");
dispatcher.forward(req,res);
Tobi -
Hi!
I'm trying to convert domains Single values (fromvalue range) into another languages. .
Thx
ilhanWhat is your db version?
In 11g you can do
SQL> var str varchar2(30)
SQL> exec :str := 'SCOTT,KING,JONES,ALLEN'
PL/SQL procedure successfully completed.
SQL> select empno, ename from emp, xmltable(('"' || replace(:str, ',', '","') || '"'))
where ename = trim(column_value)
EMPNO ENAME
7788 SCOTT
7839 KING
7566 JONES
7499 ALLEN
4 rows selected.
Maybe you are looking for
-
Hi, What is the use of a tax code? I mean once the pricing is done in a sales order and its subsequent documents are created till billing then is there any sap related transaction which uses tax code or it is just used to determine appropriate condit
-
How to get refund of any purchase?, How to get refund of any purchase?, How to get refund of any purchase?
-
Stream7 - bluetooth audio streaming goes off when i turn the display off!
I have a hp stream 7 that is connected via bluetooth to my loudspeakers. Everything is fine until the display turns off or i press the power butten to turn off the display. When i turn on the display(press power button) the sound starts and play norm
-
I have sophos anti virus and it has told me it has put an infected file in users/Shared/infected but when I go to look at this folder it is grayed out (users) finder says that the size is 430 gig but date created is 24 January 1984 08:00 how do I get
-
How to make function that runs every t (min) minutes?
The only one idea i have is endless cycle with checking system time... Any other ideas?