Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: database and deployment questions

by Bod (Parson)
on Oct 19, 2021 at 23:18 UTC ( [id://11137759]=note: print w/replies, xml ) Need Help??


in reply to Re^2: database and deployment questions
in thread Newbie question

I have data from more than one database and needed to bring them over to drop, rename, perform calculations, joins and export it as flat file

That sounds like a use for a Temporary Table in the RDMS to me...

  • Comment on Re^3: database and deployment questions

Replies are listed 'Best First'.
Re^4: database and deployment questions
by SpaceCowboy (Acolyte) on Oct 21, 2021 at 19:23 UTC
    can you please elaborate, I'd like to learn from you
      can you please elaborate

      Sure...
      Note that I am very much self-taught so may use incorrect terms and make assumptions - others will hopefully correct any errors I make.

      A Temporary Table is much like a regular table in the RDBMS except that it created on the fly by your code. It is automatically dropped by the RDBMS when the database session ends. So it only exists within the current running instance of your code.

      So a common use for a Temporary Table is to gather together data from various different sources (usually other tables) so that SQL operations can be performed on all the data at once. For example, in my CRM I have a reminder view. This takes birthdays from the 'Person' table, reminders from the 'Note' table, anniversaries from the 'Anniversary' table, etc. It loads all this into a Temporary Table before sorting in into date order and showing just the first 20 events.

      This code snippet is ancient legacy code and I wouldn't write it quite like this now but it should give you the idea of pulling data from different places and then working on the combined result.

      In this example, all the data sources are within the same database schema. But they could be in different schemas within the same RDBMS or different RDBMS's. They could be on different machines in different locations potentially accessed over ODBC. They don't even have to be data sources from databases - they could come from anywhere.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137759]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-23 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found