Error;invaild number. different data type: how to insert
In testtable, ID(number(12), amount(number(12))
Now I want to insert the following record. I got error,a invalid number .
insert into testtable(id,amount) values('111','9,000.00');
I think data type is different. amount is number type but '9,000.00' is varchar2.
How can i insert '9,000.00' to number data type?
I do insert to_number('9,000.00'). It doesn't work.
Would you help me for this problem.
as amount is a number field it will only take data of type number only.so if ue data is not number type u need to convert it to number and insert it.
however u can select it in the same format(original),using something like this:
SQL> SELECT ename employee, TO_CHAR(sal, '99,990.99') from emp;
EMPLOYEE TO_CHAR(SA
SMITH 800.00
ALLEN 1,600.00
WARD 1,250.00
JONES 2,975.00
MARTIN 1,250.00
BLAKE 2,850.00
CLARK 2,450.00
SCOTT 3,000.00
KING 5,000.00
TURNER 1,500.00
ADAMS 1,100.00
EMPLOYEE TO_CHAR(SA
JAMES 950.00
FORD 3,000.00
MILLER 1,300.00
14 rows selected.
Similar Messages
-
How to add different data types in Linked list?
The basic idea is that I want to implement a linked list like the one which we generally implement in C. I need to store different data types in a single node. Is it possible to implement like this or I have to implement a linked list for each different data type?
I have an application program in which there is a form. In this form there are different text fields in which data is to be inserted by the user. These data's will be inserted into the database. I want to hit the database only once. So I need to store these data in a data structure before I insert into the database. I think it will be easy for me to handle the data in a linked list if I can have different data types in a single node.
Moreover, I think u're not getting my question. This pic will help u.
http://img522.imageshack.us/img522/4500/sampler.jpg
I'm not sure about that the code which u have written will have different data types in single node. I have to try that.
And of course if anyone has any better idea than me, it will be very helpful. -
I have a country dimension which is used in 5 cubes. Now I want to change 'key column' property of the country attribute. Whenever I do this, I get an error as "The key columns of the country measure group attribute do not match in either number or
data types to the key columns of the source attribute". I dont understand what this error is about.
Can someone please help? Thanks in advance.
-Regards,
Raj Patilsounds like you need to verify your dimensional usage tab to verify the relationships between dim and fact on the measure group.
Hi Talktorajpatil,
As Jon said, you can verify the relationships between dim and fact on the measure group on the dimensional usage tab. Use this section to define how you "join" your measure groups to your dimensions. There may be a Dimension-Measure Group relationship
that is defined using the wrong attributes and you'll need to select the correct attributes to link the Dimensions to the measure groups. Here are some similar thread for your reference.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/74203b66-8a71-4681-8e47-8f99cce87b3d/error-on-the-measure-group-which-do-not-match-the-data-type-of-the-key-column?forum=sqlanalysisservices
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/2421058d-fd4a-44b8-8c7c-b0b349bbef2d/measure-group-attribute-key-column-does-not-match-source-attribute?forum=sqlanalysisservices
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support -
Join columns of different data types
Can i join two columns of different data types in a single statement. Is there any cast or convert statement
SELECT B~PARTNER AS RESP_GROUP
FROM BUT000 AS B
INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO.
Here PARTNER_GUID is Raw 16 and PARTNER_NO is Char 32, the query is not returning any rows.
Thanks
Akila.RHi!
Basically we can say, you can't join them, but you might try this way:
SELECT B~PARTNER AS RESP_GROUP
FROM BUT000 AS B
INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO(16). "add
(16)
Or an other version
C~PARTNER_NO+16(16) "depends on, where is the real number stored
Regards
Tamá -
Same Input name with different data type cause the reflection exception
I have a proxy contains couple RFCs. Two RFCs contain an argument named IN_COMPANY_CODE with data type of ZTRE_FX_BUKRSTable. Another RFC contains the same argument name of IN_COMPANY_CODE but hold different data type (String). All RFCs are in the same proxy. Complie and build the application with no issue.
But when I ran the RFC, it generates the reflection exception below:
Method SAPProxy1.Z_F_Tre_R_Pre_Trade_Fx can not be reflected. --> There was an error reflecting 'In_Company_Code'. > The XML element named 'IN_5fCOMPANY_--5fCODE' from namespace '' references distinct types System.String and MSTRFOREX.ZTRE_FX_BUKRSTable. Use XML attributes to specify another XML name or namespace for the element or types.
I realize the conflict introduced by the same name with difference data type. But I would like to know if this is fixable as a bug or if there is any best practice and/or some manual intervention to make it work.Please install fix from OSS note 506603. After this, right-click .sapwsdl file and select "Run custom tool".
-
CAST Not working for me - Arithmetic overflow error converting int to data type numeric - error
GPM is DECIMAL(5,2)
PRICE is DECIMAL(11,4)
COST is DECIMAL(7,2)
Trying to update the Gross Profit Margin % field and I keep getting the "Arithmetic overflow error converting int to data type numeric" error.
UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
FROM SMEMODETAIL WHERE SMD_PRICE<>0 AND SMD_QUANTITY<>0
Example record:
SMD_PRICE SMD_COST GPM%
1.8500 1.62 12.4324324324324300
I added cast and I still get the error.
How do I format to get this to work?
Thanks!Hi GBerthume,
The error is caused by some value such as 1000.01 of the expression (SMD_PRICE-SMD_COST) / SMD_PRICE * 100 exceeds the
precision of the column(DECIMAL(5,2)). The example data doesn't cause the overflow error for the value of the expression is 12.43 which is in the scope of DECIMAL(5,2).
USE TestDB
CREATE TABLE SMEMODETAIL
SMD_PRICE DECIMAL(11,4),
SMD_COST DECIMAL(7,2),
SMD_GPM DECIMAL(5,2)
INSERT INTO SMEMODETAIL(SMD_PRICE,SMD_COST) SELECT 1.8500,1.62
UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
FROM SMEMODETAIL WHERE SMD_PRICE<>0-- AND SMD_QUANTITY<>0
SELECT * FROM SMEMODETAIL
DROP TABLE SMEMODETAIL
The solution of your case can be either scale the DECIMAL(5,2) or follow the suggestion in Scott_morris-ga's to check and fix your data.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Arithmetic Overflow error converting float to data type numeric
Hi,
Am facing strange issue,I have function which returns money datatype and assigning the return money value to float datatype in table.
Error msg:
Msg 8115, Level 16, State 6, Procedure GBCalcCatalogPriceNewV2, Line 204
Arithmetic overflow error converting float to data type numeric.
The statement has been terminated.
Strange thing is the same stored procedure is working fine in production environment,but in the deveopment i see this error.Am scared if the same happens in the production environment.Please advice and advance
thanks
Regards
RAjStrange thing is the same stored procedure is working fine in production environment,
How could that be strange? This is an error that occurs depending on the data. Accidents that are waiting to happen will happen sooner or later.
Then again, a development database may be more prone to such errors, because data that entered are completely out of whack with real life data. Still it is a warning sign. If you have some place where you convert data from float to numeric, you must consider
the risk that the float value is outside the range for the numeric data type. How do you prevent that from happening? Maybe a CHECK constraint on the column? Of if the data origins from a money column, use a numeric data type with sufficient precision.
Erland Sommarskog, SQL Server MVP, [email protected] -
Arithmetic overflow error converting expression to data type int
Hi
iam creating on sp for the database total size , used mb and free size . percentage free .
in this purpose i was creating on sps, with in the sp iam was writing one select statement . it statement is
SELECT [Drivename] ,[DataSizedUsedMB],[DriveFreeSizeMB],DriveTotalSizeMB,
CAST( (DriveFreeSizeMB/DriveTotalSizeMB)* 100 AS NUMERIC(5,2))
As
[PercentFree] ,[DateRecorded] FROM
SELECT SUBSTRING([physical_name],1,1) AS Drivename,
CAST(((SUM(COALESCE(size,0)))*8)/1024 AS NUMERIC(20,2)) AS DriveTotalSizeMB,
CAST(((SUM( COALESCE( FILEPROPERTY( [name],'SpaceUsed'),0)))*8)/1024 AS NUMERIC(20,2)) AS DataSizedUsedMB,
CAST(((SUM(COALESCE(size,0))-SUM(COALESCE(fileproperty([name],'spaceused'),0)))*8/1024)AS NUMERIC(20,2)) AS DriveFreeSizeMB
,SYSDATETIME() AS [DateRecorded]
FROM sys.master_files
GROUP BY SUBSTRING([physical_name],1,1)) AS Data
it was executive one server with out error but the same select statement is writing antoher server iam geeting belo error.
"@ErrorDesc: Line 24 - Line 13- Arithmetic overflow error converting expression to data type int."
how to slove this issue..
please help me...Change 8 to 8E0, to make it a float literal. The data type of
SUM(COALESCE(size,0)))*8)
is int, since all components are int, and it can easily overflow the size for an int. If you use 8E0, you get a float, and the entire expression will be float.
Erland Sommarskog, SQL Server MVP, [email protected] -
Arithmetic overflow error converting expression to data type int. Why in this case?
Hi guys, it is Friday and I am really tired but..
WITH CTE AS (
SELECT LEN(CONS_ID) AS PROCA FROM TryCons)
SELECT SUM(PROCA) FROM CTE
Why I retrieve
Arithmetic overflow error converting expression to data type int.
Len should returns a number and so sum should work. It can be because I am trying to read 500 millions rows? But it wouldn't make sense..Len should returns a number and so sum should work. It can be because I am trying to read 500 millions rows? But it wouldn't make sense..
If the average length of the field exceeds 4.29, that statement will explode. Since I don't know what's in CONS_ID, I can't say whether it makes sense or not. Although, I will have to say that from my uninitiated position, this seems like an
accident to happen.
Erland Sommarskog, SQL Server MVP, [email protected] -
Saving cluster of different data types to a file
Hi,
I use LV 8.6 SDK. I need to save clusters of different data types to a file on a disk, row by row.
To be specific: I have a program that performs various investigations on a signal collected by DAQmx. Each time the quality of the signal is not in a specified boundaries, i get an indication. It is a cluster of time stamp, string, dbl, and Boolean. The program is supposed to run for few weeks in a row so there can be a lot of these indications. I expect to have around 200 000 rows a week (Altogether, divided into several groups).
I thought about TDMS but I am not able to save such a cluster. And I would like to save it as tdms cause i could divide the data to different groups. I also thought about data base but that would be the first time i use db and I really do not have time to learn that now.
I know it is possible to change some of the data types to others, ex Boolean to 0-1, but i need a string and a time stamp there.
Can someone advise me which data format should I use? Which one is the best one in this situation?
Thanks in advance
handreIf you do not need to access data from another application (other than Labview) you can just save it as a binary file.
It is the best choice (for me).
I made an example with one cluster. You can replace that with an array of clusters, of that data type.
Attachments:
Example_VI_BD.png 2 KB -
Store values of different data types into single database field
Hi Friends,
I have to store values of different data types(character, numeric, date, time, text, etc) into a single database field(Char 80). Then read the same values and display it into ABAP Webdynpro report.
Appreciate any ideas, examples, suggestions.
Thanks
JBHi,
Try like this:
data: txt1 type string,
var1(1) type c,
var2(1) type n,
var3 like sy-datum,
var4 like sy-uzeit.
parameters: a type c,
b type n,
c like sy-datum,
d like sy-uzeit.
concatenate a b c d into txt1.
write txt1.
var1 = txt1+0(1).
var2 = txt1+1(1).
var3 = txt1+2(8).
var4 = txt1+8(8).
write: / var1,
/ var2,
/ var3,
/ var4.
Regards,
Bhaskar -
Explain me briefly about evaluation order.As per my knowledge it show data type order.but I have different data type in same dimension ex:account->acc_001 is smart list data type.account-ac_002 is percentage.So fot this i will accont dim in evaluation order.What going can any one explaining brifly ?
2786712 wrote:
thanks John for reply.If you dont mine can you explain clearly with example and screenshot.
@John: You got a task
Here you go: Hyperion Planning and More... -
Arrays of Different Data Types
Hi, I am studing Java Development as 2 of my units (Programming Theory and Programming Practice), and I have a problem with a program which involves an array that contains two data types; int and long. The program is designed to store Student ID's and Exam Marks (1 Exam Mark per ID). The program is designed to use sorting, and the array is to be populated at the start of program execution. It compiles fine, but I get an error when the program is running as soon as you input the first value. The program is not very complex, but I need to understand how to get this fixed and why is isn't already. Any help is appreciated as this is a genuine problem. This program follows a consistent style template given to me by my tutor. The source is given below, and I appreciate any positive response.
Thanks in advance...
Aaron
Name: Aaron Allport ([email protected])
Assignment Number: 7
Program Title/Topic: Student Marks/ID's with use of Array's
Program Description: Using arrays and search/sort methods,
write a program that keeps a record of
students on a module, and allows the
data to be manipulated.
Course Title/Unit: BTEC National in Computing
import javax.swing.JOptionPane;
class StudentRecord
int mark;
long sID;
public class Assignment7
public static void main(String args[])
final int numOfStudents = 11;
String highestMark;
String lowestMark;
String examMark;
long studentID = 00000000;
String menuChoice;
StudentRecord module[] = new StudentRecord[numOfStudents];
inputRecords(module, numOfStudents);
do
menuChoice = JOptionPane.showInputDialog(null,
"STUDENT MODULE MARKS\n\n" +
"1. Find student with highest mark\n" +
"2. Find student with lowest mark\n" +
"3. Find grade for a given student\n" +
"4. Sort records by Student ID\n" +
"5. Sort records by Student Mark\n" +
"6. Display all records");
if (menuChoice.equals("1"))
highestMark = findHighest(module, numOfStudents);
else if (menuChoice.equals("2"))
lowestMark = findLowest(module, numOfStudents);
else if (menuChoice.equals("3"))
examMark = findGrade(module, numOfStudents, studentID);
else if (menuChoice.equals("4"))
studentIDSort(module, numOfStudents);
displayData(module, numOfStudents);
else if (menuChoice.equals("5"))
markSort(module, numOfStudents);
displayData(module, numOfStudents);
else if (menuChoice.equals("6"))
displayData(module, numOfStudents);
} while (menuChoice.equalsIgnoreCase("Q") == false);
System.exit(0);
public static void inputRecords(StudentRecord module[], int numOfStudents)
int i;
String inputMark;
String inputStudentID;
for (i = 1; i < numOfStudents; i++)
module[ i] = new StudentRecord();
inputStudentID = JOptionPane.showInputDialog(null,
"Please enter Student ID for position " + i + ":");
module[ i].sID = Long.parseLong(inputStudentID);
inputMark = JOptionPane.showInputDialog(null,
"Please enter Student Mark for position " + i + ":");
module[ i].mark = Integer.parseInt(inputMark);
public static String findHighest(StudentRecord module[], int numOfStudents)
int highStudentID;
int j;
StudentRecord temp = new StudentRecord();
boolean intChange = true;
int pass = 1;
String outputMark;
String outputSID;
while((pass <= numOfStudents - 1) && (intChange))
intChange = false;
for (j = 1; j <= numOfStudents - pass; j++)
module[j] = new StudentRecord();
if(module[j].mark > module[j + 1].mark)
intChange = true;
temp.mark = module[j].mark;
temp.sID = module[j].sID;
module[j] = module[j + 1];
module[j + 1].mark = temp.mark;
module[j + 1].sID = temp.sID;
pass++;
outputSID = String.valueOf(module[module.length].sID);
outputMark = String.valueOf(module[module.length].mark);
return (outputSID + " " + outputMark);
public static String findLowest(StudentRecord module[], int numOfStudents)
String outputMark;
String outputSID;
int j;
StudentRecord temp = new StudentRecord();
boolean intChange = true;
int pass = 1;
while((pass <= numOfStudents - 1) && (intChange))
intChange = false;
for (j = 1; j <= numOfStudents - pass; j++)
module[j] = new StudentRecord();
if(module[j].mark > module[j + 1].mark)
intChange = true;
temp.mark = module[j].mark;
temp.sID = module[j].sID;
module[j] = module[j + 1];
module[j + 1].mark = temp.mark;
module[j + 1].sID = temp.sID;
pass++;
outputSID = String.valueOf(module[1].sID);
outputMark = String.valueOf(module[1].mark);
return (outputSID + " " + outputMark);
public static String findGrade(StudentRecord module[], int numOfStudents, long studentID)
String foundGrade = "";
int i;
String outputSID;
String outputMark;
for (i = 1; i <= module.length; i++)
module[ i] = new StudentRecord();
if (studentID == module[ i].sID)
outputSID = String.valueOf(module[ i].sID);
outputMark = String.valueOf(module[ i].mark);
foundGrade = (outputSID + " " + outputMark);
if (foundGrade == "")
JOptionPane.showMessageDialog(null,
"No grade found for Student: " + studentID);
return foundGrade;
public static void studentIDSort(StudentRecord module[], int numOfStudents)
int i;
int j;
StudentRecord temp = new StudentRecord();
for (i = (module.length - 1); i >= 0; i--)
for (j = 1; j <= i; j++)
module[j] = new StudentRecord();
if (module[j - 1].sID > module[j].sID)
temp = module[j - 1];
module[j - 1] = module[j];
module[j] = temp;
public static void markSort(StudentRecord module[], int numOfStudents)
int i;
int j;
StudentRecord temp = new StudentRecord();
for (i = (module.length - 1); i >= 0; i--)
for (j = 1; j <= i; j++)
module[j] = new StudentRecord();
if (module[j - 1].mark > module[j].mark)
temp = module[j - 1];
module[j - 1] = module[j];
module[j] = temp;
public static void displayData(StudentRecord module[], int numOfStudents)
String outputMessage = "";
int i;
for (i = 1; i <= module.length; i++)
module[ i] = new StudentRecord();
outputMessage += (module[ i].sID + " " + module[ i].mark + "\n");
JOptionPane.showMessageDialog(null,
"Data Display\n" +
"**** *******\n\n" +
outputMessage,
"Data Display", JOptionPane.INFORMATION_MESSAGE);
}Try this piece of code...... I adapted it to your program, so it starts from 1. You should pass numOfStudents - 1 as numOfStudents to don't get the notorious error =D
if (menuChoice.equals("1"))
findHighest(module, numOfStudents - 1);
I added the println statement because in your prog isn't present an output routine (well, at last I didn't see it..... maybe because I'm sleepy =) )
public static void findHighest(StudentRecord module[], int numOfStudents)
String outputMark;
String outputSID;
StudentRecord retValue = new StudentRecord();
retValue.sID = module[1].sID;
retValue.mark = module[1].mark;
for (int i = 2; i <= numOfStudents; i++) {
if (module.mark > retValue.mark) {
retValue.sID = module[i].sID;
retValue.mark = module[i].mark;
outputSID = String.valueOf(retValue.sID);
outputMark = String.valueOf(retValue.mark);
System.out.println(outputSID + " " + outputMark);
Hope it can help you -
Dynamic ORDER BY clause - Possible different data types...
I have a lexical parameter in my ORDER BY clause:
ORDER BY &P_ORDER_BY
My problem is that I have to designate this parameter as either a date, character or number, but the user defined column being ordered by could be any one of these. When I designate the parameter as a character type, and a number data type column is chosen, it orders by that value, but it orders it as though it were a character field, referencing the initial digit and not the overall numeric value. If I choose a number parameter type, and a character value is chosen, I get an invalid number error, and so on.
Anyone have any ideas how I can do this?Okay, now we're on the right track. The lexical parameter I'm using allows the user to choose from a list of the columns being retrieved in the SELECT statement, so it will always be one that's in there, as you said. Now, since I don't know which one it's going to be, I can't just make all but one of them 'None' for the break order, BUT, what I intended to do was to add a column to the SELECT statement that would always return the column they chose, and I could put the break order on that column, leaving all the rest 'None'. However, in the past, this has created 2 problems for me.
1.) As I mentioned in the first post, the column being returned could have a data type of character, number or date, but the parameter must be designated as only one of these. So, if the user chooses to order by a column having a value with a data type other than what the parameter is designated to be, then I get errors, it doesn't order correctly, etc...
2.) This is the strange, but anytime I've marked all but one column as 'None' for the Break Order, my child data doesn't always stay with the parent. For example, the report is on an IT request database. The 'group fields' consist of data elements that are demographic info.of a request (requester, date requested, description, etc...), and the details for each request list out the comments that have been made in the system for that request. The problem I'm seeing when I set the break orders this way is that each request displays not only its own comments, but it lists out comments for other requests as well, and there doesn't seem to be any logic to which request's comments it lists in addition to its own, it just lists as many as will fit on the page...I don't know if I explained that very well, but that's what's happening.
Does any of that make sense? Any ideas? -
Search help for custome field with different data type
Hi Friends,
I have Created a custom table in which i have created a field is
ZMATLONG which stores material number.
Now the data element is zdmat which is of char 40..
Now i want to give search help for this field ZMATLONG..
I have tried many ways giving search help to this field
a) i Tried to attach the standard search help of MATNR ie : MAT1 but its showing me data type inconsistancy
b) i created a zsearch help and in the selection method i have used database table mara , again here iam getting the same error data type inconsistancy...
Now how can i give the search help like matnr field to my custom field ZMATLONG...
How can i do it..?
Thanks in Advance..
Regards
KumarHi,
MATNR ahs length 18 and ZMATLONG has length 40.So due to this u cannot use MAT1 search help.
best way would be cope MAT1 into Z search help. Then in the search help parameter change the data element of field
MATNR as ZMATLONG.
Now if you assign Z search help to ZMATLONG it will work.
I tried this its working fine.
Shanmugavel Chandrasekaran
Maybe you are looking for
-
Error while running graph through UNIX
I am using below command to run a graph curl -u clover:clover --url http://localhost:8080/clover/request_processor/graph_run?graphID=graph/Configuration.grf&sandbox=name but i am getting below error Error running job: sanbox = null, job file = graph/
-
To whom it may concern, My name is Scott {Removed per Forum Guidelines} and I 2 Samsung LCD TV's and 1 Samsung LCD computer monitor. I started to have an issue with my LNT4042HXIXAA 40" LCD TV. It clicks 52 times before it will turn on. I googled
-
How to delete picture or album in my ipad2
I cannot figure out how to delete certain photos in my photo album..
-
I have the suite on my desktop, but I need to put it on my new laptop. Is it still possible?
-
Jcontrol.exe won't start - NW2004s
Hi All, I have deployed the NW2004s 'Developer Workplace' on my machine. Once the installation completed successfully, the Server was up and running fine. But i'm not able to restart the server (jcontrol.exe stays yellow). Dispatcher is up and runn