473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Application that I can paste a query into & extract column/table names

Hello,

I have hundreds of queries that I need metadata for.

I am looking for an application or tool that I can use that will put the following information from an Oracle SQL SELECT statement into a .csv or text file:

Expressions (ie TO_CHAR(fieldname))
Column Names
Table Names

This is the only metadata I need, so I won't need an ODBC connection to the database - all of this information is within the SQL query itself.

I am hoping that such an application or tool exists, because it would save us many hours of tedious work!

Thanks in advance..
Jan 16 '09 #1
8 2756
debasisdas
8,127 Expert 4TB
From your post i am not sure what exactly you are looking for .
Jan 16 '09 #2
Here's an example: Let's say you have a query like this:

SELECT sysdate as CURRENT_DATE, father_name as FATHER, mother_name as MOTHER from CHILDREN_INFO

You would copy and paste this query into the tool, and it would return the following:

EXPRESSION COL_NAME TBL_NAME

sysdate CURRENT_DATE CHILD_INFO
father_name FATHER CHILD_INFO
mother_name MOTHER CHILD_INFO

I am looking for a tool that would do this!

I would be happy to answer any more questions...

Thanks!
Jan 16 '09 #3
debasisdas
8,127 Expert 4TB
i don't think there is any tool specifically for this kind of requirmnet.
Jan 17 '09 #4
Anyone else have any ideas about how I can go about doing this? Thanks!
Jan 20 '09 #5
amitpatel66
2,367 Expert 2GB
You can do so by using a SPOOL command.Check
SQLPLUS spool to CSV file - dBforums
Export SQL data to a .csv file using Sqlplus - Matrise
on how to spool data to csv file
Jan 21 '09 #6
Thank you, amitpatel66, but I do not need to export the result set to a .csv, I only want the expressions/column names/table names (see example I posted above)
Jan 21 '09 #7
amitpatel66
2,367 Expert 2GB
Oh ok you are looking at metadata export. Well I am afraid to say that there is no seperate tool for such requirement. But you can get the metadata by desc a table or incase if you are using TOAD then you can type the table name and press F4 will give you the metadata of that table.
You can also use dbms_metadata oracle package to get the metadata information.
Jan 22 '09 #8
madankarmukta
308 256MB
Hi,

I agree with what Amit has suggested.

There is another workaround for this if you are working with 10g.But the solution is little bit tricky.

1)Create the function which will accept the string input and return any of the composit dataType - the one you prefer in order to hold output

EXPRESSION COL_NAME TBL_NAME

sysdate CURRENT_DATE CHILD_INFO
father_name FATHER CHILD_INFO
mother_name MOTHER CHILD_

2)Make use of Regular Expression to catch the column names and vales from the string input.

3) Hold the result in variable - declared in step1

Thanks!
Jan 22 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JV | last post by:
k heres the skinny server = php v.4.3.8 w/ MySQL support linux box working apache 2.0 server when connection to the database and submitting a query with <? $result = mysql_query($query) or...
2
by: Joe Gazda | last post by:
I'm a relative newbie to PHP, but have been able to put together some PHP code to generate a CSV/XLS file from a Query result. Now, I would like to include custom column names instead of the MySQL...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
7
by: mittal.pradeep | last post by:
What is the better table design for a data collection application. 1. Vertical model (pk, attributeName, AttributeValue) 2. Custom columns (pk, custom1, custom2, custom3...custom50) Since the...
1
by: Alex Satrapa | last post by:
I have a table from which I'm trying to extract certain information. For historical reasons, we archive every action on a particular thing ('thing' is identified, funnily enough, by 'id'). So the...
3
by: Mike Charney | last post by:
I have a two part question: First I want to insert data into a table and I am using the following command: INSERT INTO tblmain SELECT field1, field2, etc... FROM tblimport WHERE ?????? The...
1
by: christianlott1 | last post by:
I want to provide users with an interface to create a custom merge (all in Access, not Word). User will put in a set of brackets ("<>") in a memo field and when they click the merge button it will...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
4
by: rush2112 | last post by:
I have a table with 7 columns and 50 rows. The first column is a unique ID#, the other 6 columns are for names. (Name1, Name2, ......Name6). I need to create a 2 column query to extract the six...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.