From: | Larry Rosenman <ler(at)lerctr(dot)org> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | plpgsql function / ??? / help |
Date: | 2001-05-14 18:00:25 |
Message-ID: | 20010514.18002500@ler-freebie.iadfw.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)lerctr(dot)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 | character varying(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=#
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff MacDonald | 2001-05-14 18:16:14 | Re: execute client application from PL/pgSql |
Previous Message | Srikanth Rao | 2001-05-14 15:21:58 | Counting rows in a table |