[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] SQL kopiering af records i samme tabel



On Thu, 14 Apr 2005, [ISO-8859-15] Rasmus Wätjen wrote:

> I postgres har jeg en database som bl.a. indeholder to tabeller med en 
> en-til-mange relation. I tabel A findes én record for n records i tabel B.
> 
> Nu er det sådan at jeg gerne vil kunne kopiere en post i tabel A til en 
> ny. Det betyder at alle n tilknyttede records i tabel B også skal 
> kopieres og have en opdateret fremmednøgle.
> 
> Er der nogen smart måde at gøre det på, eller skal man lave et
> udtræk, rette i fremmednøgle-kolonnen og inserte påny?

Jeg ville lave den med en stored procedure nu da du bruger postgres, 
men der er måske en smart måde at gøre det på.

/hans
-- 
Horsebakken 78, DK-2400 København NV, Phone: +45 2264 8020
----------------------------------------------------------
Pas på når du ændre dit spam-filter:
http://www.egoland.dk/dagensstribe/11-04-2005.gif


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *