Transport data from query to table

Creating tables and queries

Transport data from query to table

Postby matroSK » Fri Nov 06, 2015 4:42 pm

Hey guys.
Just one question.
Is it possible to "transport" data from query to table? That query comes from another table.
I need to filtrate this data in "query mode" and then I would like to put them in different table.

Thanks
Apache OpenOffice 4.1.1
Windows 7 Ultimate
matroSK
 
Posts: 19
Joined: Thu Jul 23, 2015 10:37 am

Re: transport data from query to table

Postby F3K Total » Fri Nov 06, 2015 5:22 pm

Hi,
if all columns match, just copy the query (rightclick->copy) and paste it onto the target-table in tables area, then select in the wizzard, if not preselected, Append data/Create
R
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
F3K Total
Volunteer
 
Posts: 983
Joined: Fri Dec 16, 2011 8:20 pm

Re: transport data from query to table

Postby matroSK » Wed Nov 11, 2015 12:58 am

thanks, but I´m looking for some way of how it would be done automatically, because this situation will happen often
Apache OpenOffice 4.1.1
Windows 7 Ultimate
matroSK
 
Posts: 19
Joined: Thu Jul 23, 2015 10:37 am

Re: transport data from query to table

Postby F3K Total » Wed Nov 11, 2015 6:29 am

Yes,
also possible, by code.
R
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
F3K Total
Volunteer
 
Posts: 983
Joined: Fri Dec 16, 2011 8:20 pm

Re: transport data from query to table

Postby matroSK » Fri Nov 13, 2015 11:12 am

And could you please suggest me how to do it, because I have no idea.
Apache OpenOffice 4.1.1
Windows 7 Ultimate
matroSK
 
Posts: 19
Joined: Thu Jul 23, 2015 10:37 am

Re: transport data from query to table

Postby F3K Total » Fri Nov 13, 2015 4:39 pm

No,
because the code depends on your source query and the target table, it's column definitions and so on.
R
Last edited by F3K Total on Fri Nov 13, 2015 5:08 pm, edited 1 time in total.
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
F3K Total
Volunteer
 
Posts: 983
Joined: Fri Dec 16, 2011 8:20 pm

Re: transport data from query to table

Postby MTP » Fri Nov 13, 2015 4:46 pm

"by code" means writing an SQL statement and executing it through the Tools→SQL window. Exact SQL depends on your setup but would be something like
Code: Select all   Expand viewCollapse view
INSERT INTO "TargetTable" (SELECT "ColumnA", "ColumnB" FROM "SourceTable" WHERE "ColumnC" = "Something")

You could also write a macro if you want to execute this SQL by pushing a button instead of typing into the SQL window. Then you'd have the learning curve of the SQL language plus the learning curve of the macro language.
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
User avatar
MTP
Volunteer
 
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 1 guest