Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am not sure how to solve this problem:

We import order information from a variety of online vendors ( Amazon, Newegg etc ). Each vendor has their own specific terminology and structure for their orders that we have mirrored into a database. Our data imports into the database with no issues, however the problem I am faced with is to write a method that will extract required fields from the database, regardless of the schema.

For instance assume we have the following structures:

Newegg structure:

"OrderNumber" integer NOT NULL, -- The Order Number
"InvoiceNumber" integer, -- The invoice number
"OrderDate" timestamp without time zone, -- Create date.

Amazon structure:

"amazonOrderId" character varying(25) NOT NULL, -- Amazon's unique, displayable identifier for an order.
"merchant-order-id" integer DEFAULT 0, -- A unique identifier optionally supplied for the order by the Merchant.
"purchase-date" timestamp with time zone, -- The date the order was placed.

How can I select these items and place them into a temporary table for me to query against?

The temporary table could look like:

"OrderNumber" character varying(25) NOT NULL,
"TransactionId" integer,
"PurchaseDate" timestamp with time zone

I understand that some of the databases represent an order number with an integer and others a character varying; to handle that I plan on casting the datatypes to String values.

Does anyone have a suggestion for me to read about that will help me figure this out?

I don't need an exact answer, just a nudge in the right direction.

The data will be consumed by Java, so if any particular Java classes will help, feel free to suggest them.

share|improve this question
1  
This appears to be a clone of this post: stackoverflow.com/questions/13316181/… – Craig Ringer Nov 10 '12 at 4:18
I've had a careful look at this question and the answers on SO and I think it is more at home over there so I'm closing it here. It is on the borderline of being 'too basic' here as well as seeming to want answers from a 'programmer perspective'. Please don't be put off asking here again for slightly more advanced stuff but I'd urge you not to post the exact same question on both sites as it puts folk off answering here. – Jack Douglas Nov 11 '12 at 7:05

closed as off topic by Jack Douglas Nov 11 '12 at 7:05

Questions on Database Administrators Stack Exchange are expected to relate to database administration within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.