Quantcast
Channel: csv | ThatJeffSmith
Viewing all articles
Browse latest Browse all 27

SQL Developer 4.1: Easier Excel Imports

$
0
0

The most read post on this site? ‘How to Import from Excel to Oracle with SQL Developer‘ – and it has been since I published it almost 3 years ago.

People really like Excel. Or I should put it this way – Excel is the way information is shared in an organization. It makes no matter how much money was invested in BI, reporting, and databases – at the end of the day, it’s going into a spreadsheet.

That being said, sometimes you need to take data in a spreadsheet, or text delimited file, and move it back into Oracle. Either as a new table, or into an existing table.

For version 4.1, we tweaked the existing wizard to save you a bunch of clicks. The wizard works as it’s always done, so don’t freak out that we went to change stuff for the sake of change.

But something bothered us, and we figured it bothered you too.

You couldn’t see the data you were importing once it came to mapping the columns. So you’d have to go back, back in the wizard to the preview window, and then forward, forward to the column definitions.

Or maybe you had the file open in another editor so you could review it as necessary.

Well, that’s nonsense. So let’s make it so you can ALWAYS see the data.

Oh, and we tweaked a bunch of other things too :)

How it works in version 4.1

Get to the data FASTER. Now you can define the input file and see it on the same screen. Also, if this is a file you’ve just created with a SQL Developer export, or it’s a file you’ve recently imported – it’s going to show up on the file-history-drop-down-thingy.

Looks for this in SQL Developer whenever you're prompted to save or open a file.

Looks for this in SQL Developer whenever you’re prompted to save or open a file.

Next we need to know how you want to bring the data in…

Note the preview window remains, no more forgetting what the data looks like.

Note the preview window remains, no more forgetting what the data looks like.

Now let’s map the columns.

Yup, data is still there.

Yup, data is still there.

So for this example, I’m creating a new table. So for each column, I need to define the datatype.

We now take a 'best guess' on the datatype - if it looks like a number, we put in number. And, I can see the values that are being proposed for this column.

We now take a ‘best guess’ on the datatype – if it looks like a number, we put in number. And, I can see the values that are being proposed for this column.

But what if it’s NOT number?

OK, we THINK this is a date, but we're not able to guess the date format.

OK, we THINK this is a date, but we’re not able to guess the date format.

We do give you a drop down list of some date formats. You can choose one, or enter your own. AND, we grab the date format from your NLS preferences and make it the first choice. Now, I happened to build this excel file WITH SQL Developer, so picking that date format just happens to be right for me :)

Note a few other things going on in this screen:

  • On-screen validation: we used to ASK if you wanted to validate your import at the very end of the wizard. Now we validate for you automatically as you go through each column. Problems are highlighted with the warning or error images in the data preview window. We also add a message to explain to you why we think there is a problem.
  • Reviewed columns are marked: each column is italicized until you’ve actually looked at it. So if you’re reviewing 200 columns, you can tell right away which once you’ve looked at – or not.
  • SizingIf it’s a number or a string, we look at the preview window amount of rows and best-guess the column sizing and precision. We’re tweaking this for the next update, say +2 on scale based on ‘biggest’ number found. We’re also looking at some pre-defined text sizes for columns, say 10, 100, 256, 4000, 32k…Remember, this is only for NEW tables.
Ok, I picked the right date format, all is well now.

Ok, I picked the right date format, all is well now.

Last step…

...review and go!

…review and go!

But wait, there’s more!

We’ve made it easier to do the same imports over and over again. And you can now run these via the command-line interface. But those topics will have to wait for another post. Stay tuned!


Viewing all articles
Browse latest Browse all 27

Trending Articles