[SQL] Create View

2006-11-04 Thread Mark Simon




I don't know whether this is a simple one that has been dealt with
before, but if so, I haven't worked out the right question to search on.

If I create a view thus:

    create view things as select * from whatever;

and then examine my saved view, I find a list of all of the fields from
whatever. I thought it should be possible to save the star (*) as part
of the view. Otherwise, I run into the problem of not getting all of
the fields if I add columns to the table (whatever).

Is this an SQL thing or a PostGreSQL thing?

Thanks,

Mark


-- 


Mark Simon
Manngo Net Pty Ltd
Phone/Fax: 1300 726 000
mobile: 0411 246 672
email: [EMAIL PROTECTED]
web: http://www.manngo.net
Resume: http://mark.manngo.net






[SQL] Create Function (SQL)

2006-11-04 Thread Mark Simon




I am trying to create a simple function using SQL rather than
PGSQL. At this point, it's just for the exercise.

Is it possible to create a function similar to the following:

    create function thing(text) as select * from whatever where id=$1;

Do I need to specify all of the columns from the table (whatever) as
out parameters, or as a return type, or can I have a generic table
returned from this?

Thanks,

Mark

-- 


Mark Simon
Manngo Net Pty Ltd
Phone/Fax: 1300 726 000
mobile: 0411 246 672
email: [EMAIL PROTECTED]
web: http://www.manngo.net
Resume: http://mark.manngo.net