Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update a decimal column from a charcter column?

Status
Not open for further replies.

reedj

Programmer
Sep 20, 2002
1
GB
I need to update a column which is defined as Decimal 9 with the data in a column which is Caracter 11.
The data in the character column is numeric and I have tried using DIGITS with the decimal column but it doesn't seem to like this. Suggestion please!
 
reedj,

try something like this

Assume that updates to the SALARY column are input through a window as a character string using comma as a decimal character (for example, the user inputs 21400,50). Once validated by the application, it is assigned to the host variable newsalary which is defined as CHAR(10).
UPDATE STAFF
SET SALARY = DECIMAL:)newsalary, 9, 2, ',')
WHERE ID = :empid;


The value of newsalary becomes 21400.50.


Take a look at the following for more information



Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top