Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

December 18, 2006

Setting Default Text File Encoding in Eclipse

I was recently working with a set of SQL migration scripts in eclipse and started noticing that the localized characters weren't showing correctly. I've seen all kinds of chaos in my project with different file formats creeping into the sources and database. So I did a looking and found that Eclipse was defaulting to Cp1252 for the encoding. This is a pain and the cause of my files not displaying. So went into Window->Preferences... and Opened General->Workspace and changed the Text file encoding setting to UTF-8. Now all is good again.

December 14, 2006

How to query Oracle Schema

I have been trying to query the difference between Oracle Schemas for a project I'm working on.

  • get SQL Developer (free) from Oracle

  • I needed was a list of the system tables in Oracle which I found here.

  • Next log in as the user who's schema you want to print.

  • The basic query you want is:

    SELECT
    t.table_name
    , column_name
    , data_type
    , data_length
    FROM USER_TABLES t, USER_TAB_COLUMNS c
    where t.TABLE_NAME = c.table_name;

  • run the script using F5 and select the Script Output tab

  • Save the output


You can repeat this process for other schemas and use a diff tool like beyond compare to find the differences.