Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Narrowing using create table select

 
   Database Help (Home) -> Ingres RSS
Next:  It would be nice  
Author Message
NicknameIsNotAvailableInT

External


Since: Nov 13, 2008
Posts: 2



(Msg. 1) Posted: Thu Nov 13, 2008 6:26 am
Post subject: Narrowing using create table select
Archived from groups: comp>databases>ingres (more info?)

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

 >> Stay informed about: Narrowing using create table select 
Back to top
Login to vote
Martin Bowes

External


Since: Feb 05, 2008
Posts: 17



(Msg. 2) Posted: Thu Nov 13, 2008 11:25 am
Post subject: Re: [Info-Ingres] Narrowing using create table select [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 RemoveThis @kettleriverconsulting.com
[mailto:info-ingres-bounces@kettleriverconsulting.com] On Behalf Of
NicknameIsNotAvailableInThisGroup
Sent: 13 November 2008 14:26
To: info-ingres RemoveThis @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 RemoveThis @kettleriverconsulting.com
http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres

 >> Stay informed about: Narrowing using create table select 
Back to top
Login to vote
NicknameIsNotAvailableInT

External


Since: Nov 13, 2008
Posts: 2



(Msg. 3) Posted: Thu Nov 13, 2008 12:19 pm
Post subject: Re: Narrowing using create table select [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 13, 8:40 am, "Paul Mason" wrote:
> 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
 >> Stay informed about: Narrowing using create table select 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[Info-Ingres] When where clause *Really* alters what you s.. - Hi Everyone, I'm running II 9.0.4 (a64.lnx/105)NPTL patch12125. On a brand new database try this...Don't worry it won't crash anything. sql your_new_db << SQL_END \r \continue set autocommit on \g drop view named_object_view; \p\g create view..

changing result of select query in tablefield - Hi I have a tablefield which gets its values from a select query, eg tblField = select val1, val2, val3 FROM tbl1 My problem is that in the table tbl1, val2 has 3 different values in it which are abbreviations. On my tablefield however, ...

Error opening a table. - Hi, I have a set of queries executing for about 5-10 minutes for reporting. System generates exceptions very rarely. When I check the log messages, I found an exception saying "error opening a table <<table name>>". Does anyone ...

Error while adding column using ALTER TABLE - Hi, I get this error when trying to add a column using ALTER TABLE... The Error is... E_QE009D Alter Table ADD/DROP column support for pages greater than 2k only. The SQL statement is... alter table abc add column xyz varchar(100); The..

LIKE with oversize pattern forces table scan? - One of my colleagues is dealing with a Unicenter Helpdesk site and has a call open with CA (remember them?). The problem is that he's noticed that when a query includes a LIKE condition where the pattern contains no wild-card characters but the pattern....
   Database Help (Home) -> Ingres All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]