×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Eric,

This worked great!  Two answers and both work great!  I'm starting to feel a
little stupid but appreciate the help.

Glen

-----Original Message-----
From: DeLong, Eric [mailto:EDeLong@Sallybeauty.com]
Sent: Thursday, March 29, 2001 3:00 PM
To: 'RPG400-L@midrange.com'
Subject: RE: Interactive SQL - CAST


Glen,

If I understand correctly, you have fields BOOK_CODE1 (character) and
BOOK_CODE (numeric) in the table. You are trying to copy the numeric value
into the character field? If that is the case, you could try:

UPDATE Library1/BOOK2 SET book_code1 = CHAR(book_code)

See if that does what you want.

hth,
Eric DeLong

-----Original Message-----
From: orsburn@foxvalleytech.com [mailto:orsburn@foxvalleytech.com]
Sent: Thursday, March 29, 2001 2:11 PM
To: RPG400-L@midrange.com
Subject: Interactive SQL - CAST



I'm having trouble converting from data type to another.  I understand if I
attempt to go from character type column to numeric issues will occur if all
the data isn't numeric in that column.  But going from a numeric column to
char, I thought would be easy.  Here is what I've tried doing with very no
success: I used the CAST function with interactive SQL.  I went to run an
Interactive SQL statement such as:

        UPDATE Library1/BOOK2 SET BOOK_CODE1 = cast(book_code as char)

        Book_Code1 is char  (I've changed the length on this)
        Book_Code is numeric (I've tried numeric, decimal) 4,0

The error I receive:  Significant digits truncated during CAST from numeric
to character. 

Then I thought about looking at the data through a SELECT CAST(Book_code as
char) from library1/book2

returns --  + (plus sign only)

Any suggestions?

Glen


----------------------------------------------------------------------
Glen Orsburn
CIS - Instructor @ Fox Valley Technical College
1825 N Bluemound Dr
Appleton,  WI  54912
----------------------------------------------------------------------
web-page: cis.foxvalleytech.com/orsburn
External page: netnet.net/~orsburn

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.