Am 11.11.2013 12:57, schrieb Simon Slavin: > > On 11 Nov 2013, at 11:08am, dd <durga.d...@gmail.com> wrote: > >> How do I insert trackname as "That's Amore" and artistname as >> "Dean Martin" with single query in artist and track tables? > > Sorry, I don't know a way to do that. I hope someone else has a way > but it's normal to have your software figure out that you need to > create artist/publisher/whatever rows first.
C.J. Date offers a way to do it, if I'm remembering right, in his 'Tutorial D' language, (as mentioned in 'Database in Depth'), but it is usually not possible to do it in simple standard SQL. One way to do it in SQL with some upfront preparations, would be to define a special writeable view and arrange a complex INSERT triggers to just insert part of the data into one table and part of the table into a second table. But that kind of defeats the normalization... Might work for your simple structures, but gets pretty ugly if things are more complex. Michael -- Michael Schlenker Software Architect CONTACT Software GmbH Tel.: +49 (421) 20153-80 Wiener Straße 1-3 Fax: +49 (421) 20153-41 28359 Bremen http://www.contact.de/ E-Mail: m...@contact.de Sitz der Gesellschaft: Bremen Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users