Re: Create view

From: K.Y. Fung <kyfung_at_hotmail.com>
Date: 2 Oct 2002 19:38:42 -0700
Message-ID: <c22bb40d.0210021838.6fba94c7_at_posting.google.com>


Bernard Peek <bap_at_shrdlu.com> wrote in message news:<2xjcnNPsSjm9EwIY_at_diamond9.demon.co.uk>...
> There is insufficient information to give a complete answer. If your
> view has a 100 character column and the source table has a 150 character
> column then someone needs to decide on the algorithm for discarding
> data. Should you use the leftmost or rightmost characters in the source
> data? Should the algorithm return <null> if the source data is more than
> 100 characters?

It is just an Open University homework question. What we have learn are:

  1. How to define a table.
  2. How to define a view.
  3. How to use CAST in expressions.
  4. How to alter column type of a table.
  5. How to alter column size of a table. The course material told us that if the resulting size is smaller than the original one, DBMS will truncated! We don't have so many options to choose from.

I guess this question try to test us, once again, what we have NOT learn. To define a view that have column of different type and size than the base table with just one SQL statement.

The first response to my original question works. What we have not learn is the use of CAST in the way presented by Tibor Karaszi.

Thanks and regards,
K.Y. Fung Received on Thu Oct 03 2002 - 04:38:42 CEST

Original text of this message