plpgsql function / ??? / help
От | Larry Rosenman |
---|---|
Тема | plpgsql function / ??? / help |
Дата | |
Msg-id | 20010514.18002500@ler-freebie.iadfw.net обсуждение исходный текст |
Список | pgsql-sql |
I have the following 2 tables, and a spread sheet that needs to be converted to the assigned_networks table. In the spreadsheet there is an approximation of the router name, but it needs some massaging. I need to load the id field of the router table into the router field of the assigned networks table. Is there an easy way to code a function that can massage the name to the correct DNS name to do this at insert time? Thanks! LER -- Larry Rosenman http://www.lerctr.org/~ler/ Phone: +1 972 414 9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749 US ler=# \d router Table "router"Attribute | Type | Modifier -----------+------------------------+----------------------------------- ----------------id | integer | not null default nextval('"router_id_seq"'::text)name | character varying(256) | ethernet | inet | model | charactervarying(256) | nexthop | inet | comments | character varying(256) | Index: router_pkey ler=# \d assigned_networks Table "assigned_networks" Attribute | Type | Modifier -------------------+------------------------+----------netblock | cidr | router | integer | interface | character varying(256) | dest_ip | inet | mis_token | character(16) | assigned_date | date | assigned_by | character varying(256)| justification_now | integer | justification_1yr | integer | cust_asn | smallint | ler=#
В списке pgsql-sql по дате отправления: