List:General Discussion« Previous MessageNext Message »
From:Olaf Stein Date:October 14 2008 1:20pm
Subject:Re: Insert static column into VIEW
View as plain text  
You can add a column to a view like this:

CREATE VIEW test4 AS SELECT nummer AS name, ip as content, 1 as domain_id
FROM jabix.spaces JOIN jabix.ves ON spaces.veid = ves.id;

This will set the domain_id vaulues to 1

Olaf

On 10/14/08 8:18 AM, "Samuel Vogel" <samydelux@stripped> wrote:

> Hey guys,
> 
> I am trying to construct a specially crafted view for the powerdns
> DNS-Server.
> This is what I have so far:
> CREATE VIEW test4 AS SELECT nummer AS name, ip as content FROM
> jabix.spaces JOIN jabix.ves ON spaces.veid = ves.id;
> 
> +--------+---------------+
> | name   | content       |
> +--------+---------------+
> | 234235 | 11.46.3.22 |
> | 345232 | 11.46.3.53 |
> +--------+---------------+
> 
> But this is only a part of what powerdns expects as input table.
> For example I would like to add a field namend 'domain_id', which is
> always set to 1 or defaults to 1, without altering my existing tables.
> 
> How would I achieve this?
> 
> Regards,
> Samy



³I consider that the golden rule requires that if I like a program I must
share it with other people who like it.²
Richard M. Stallman

----------------------------------------- Confidentiality Notice:
The following mail message, including any attachments, is for the
sole use of the intended recipient(s) and may contain confidential
and privileged information. The recipient is responsible to
maintain the confidentiality of this information and to use the
information only for authorized purposes. If you are not the
intended recipient (or authorized to receive information for the
intended recipient), you are hereby notified that any review, use,
disclosure, distribution, copying, printing, or action taken in
reliance on the contents of this e-mail is strictly prohibited. If
you have received this communication in error, please notify us
immediately by reply e-mail and destroy all copies of the original
message. Thank you.
Thread
Insert static column into VIEWSamuel Vogel14 Oct
  • Re: Insert static column into VIEWAnanda Kumar14 Oct
    • Re: Insert static column into VIEWSamuel Vogel14 Oct
  • Re: Insert static column into VIEWOlaf Stein14 Oct
  • Re: Insert static column into VIEWMartijn Tonies14 Oct