Narrowing using create table select - Ingres Database
This is a discussion on Narrowing using create table select - Ingres Database ; If I have a table with a c24 field that I would like to remake as a c20, in some other db 's I would use padr(field,20) which seems to not be available in Ingres. My next thought was to ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| c20, in some other db's I would use padr(field,20) which seems to not be available in Ingres. My next thought was to use cast like: create table narrowed as select cast(field as char(20)) as field from original but the result is still a c24 field. If anyone knows how to do this in Ingres, I would be quite grateful! Thanks, John |
|
#2
| |||
| |||
|
2008/11/13 NicknameIsNotAvailableInThisGroup > If I have a table with a c24 field that I would like to remake as a > c20, > in some other db's I would use padr(field,20) which seems to not be > available in Ingres. My next thought was to use cast like: > > create table narrowed as > select cast(field as char(20)) as field > from original > > but the result is still a c24 field. > > If anyone knows how to do this in Ingres, I would be quite grateful! > CREATE TABLE narrowed AS SELECT CHAR(field, 20) AS field FROM original -- Paul Mason |
|
#3
| |||
| |||
|
Hi John alter table alter column But that depends upon what version of Ingres you are running. If there are any views that hang off the table you'll need to redefine them. Martin Bowes -----Original Message----- From: info-ingres-bounces@kettleriverconsulting.com [mailto:info-ingres-bounces@kettleriverconsulting.com] On Behalf Of NicknameIsNotAvailableInThisGroup Sent: 13 November 2008 14:26 To: info-ingres@kettleriverconsulting.com Subject: [Info-Ingres] Narrowing using create table select If I have a table with a c24 field that I would like to remake as a c20, in some other db's I would use padr(field,20) which seems to not be available in Ingres. My next thought was to use cast like: create table narrowed as select cast(field as char(20)) as field from original but the result is still a c24 field. If anyone knows how to do this in Ingres, I would be quite grateful! Thanks, John _______________________________________________ Info-Ingres mailing list Info-Ingres@kettleriverconsulting.com http://www.kettleriverconsulting.com...fo/info-ingres |
|
#4
| |||
| |||
|
On Nov 13, 8:40*am, "Paul Mason" > 2008/11/13 NicknameIsNotAvailableInThisGroup > > > If I have a table with a c24 field that I would like to remake as a > > c20, > > in some other db's I would use padr(field,20) which seems to not be > > available in Ingres. *My next thought was to use cast like: > > > *create table narrowed as > > * *select cast(field as char(20)) as field > > * * from original > > > but the result is still a c24 field. > > > If anyone knows how to do this in Ingres, I would be quite grateful! > > CREATE TABLE narrowed AS > SELECT CHAR(field, 20) AS field > FROM original > > -- > Paul Mason Thank you, that worked perfectly! John |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 02:50 AM.




Linear Mode