Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

inserts into join tables

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im having problem getting the syntax
right to insert into join tables. I
can view the in in a select so the joins are
good.
This is how I thought is should look
like:

Thanks,
Bob
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bob, I don't quite understand your question.
If you are wondering why the first one gives you an error? It is because "(test_this_name)" is not a column in your table you are inserting to. So of course it will give you an invalid column error.
Mark
 
Bob Kimmel
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I was trying to do is add a new row a data using the insert
and select statement. I have three tables that have like primary keys
and I joined them together hoping to be able to add data with one insert
statement. After reading some more this weekend, I dont think I can do it this way, unless you know of some trick. Next Im going to make a view of the three table and try to insert into the view. Any other suggestions?
I'm fairly new so be nice:-)
Thanks,
Bob
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I am still confused at what you are doing. If you have one table you are inserting into, then what you want to do is possible. I have many insert statements that are records inserted from a Select statement. Just like thus

My joins are in a where clause, but they can use the ANSI join standards codes. Anything you want.
Also in my example the resultset structure matches the structure of the insertTable.
Hope that helps.
Mark
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!