Re: select * from (select * from bob) and other easy stuff
Posted in 2006
> Ugh. How awkward. OK, thanks for the tips. I'm running into some issues
> though (see below), which make things seem pretty bizarre to me.
> >SELECT * FROM TABLE(MULTISET(SELECT * FROM bob))> It seems to be pretty useless though because using something like this:
> select lwind_name,lw_type_cd from table(multiset(select * from
> land_window))> I get a message:
> [Error Code: -9930, SQL State: IX000]
> Byte, Text, Serial or Serial8 datatypes in collection types not
> allowed.
I don't know, this always made perfect sense to me. A "serial" data
type's serial-ness can't be preserved through a virtual table. But my
preference is that when something magick is happening it should be
required that it is explicitly stated (like turning a serial value into
an int value).
> If you can't do something this basic because of a serial column,
You can, you just need to cast it.
SELECT serial_key, other_value
FROM TABLE(MULTISET(SELECT serial_key::INT, other_value FROM booby));