473,782 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

16 New Member
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(fieldna me))
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 2771
debasisdas
8,127 Recognized Expert Expert
From your post i am not sure what exactly you are looking for .
Jan 16 '09 #2
Roobmeister
16 New Member
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 Recognized Expert Expert
i don't think there is any tool specifically for this kind of requirmnet.
Jan 17 '09 #4
Roobmeister
16 New Member
Anyone else have any ideas about how I can go about doing this? Thanks!
Jan 20 '09 #5
amitpatel66
2,367 Recognized Expert Top Contributor
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
Roobmeister
16 New Member
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 Recognized Expert Top Contributor
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 Contributor
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
1507
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 die("blah blah"); echo "<table>\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){
2
3921
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 column table names. I know that there are codes to generate tabs and carriage returns, but can't find anything about including "commas" in a string to output to the file to separate the custom field names. I'd appreciate some help with a line of...
9
3137
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 SUBSTRING(ProductName, 1, CHARINDEX('(', ProductName)-2). I can get this result, but I had to use several views (totally inefficient). I think this can be done in one efficient/fast query, but I can't think of one. In the case that one query is not...
7
3920
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 data elements collected may change year over year, which model better takes of this column dynamicness
1
2490
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 only way to find out the current state of a particular combination of attributes is to "select distinct on (id, ...) ... order by date desc". In the examples below, I've taken real output from psql and done a global search/replace on various...
3
2159
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 where clause is the part I am having trouble with. I want to only insert
1
3408
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 grab the fields listed in a tabular subform and merge it with their memo text. I was able to retrieve the code to list the column names of a table. I constructed the code to iterate the tabular subform rows and replace the brackets with the row...
4
6480
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 flat file. Ideally I would like to be able to just select the Last 2 Columns of the Crosstab query as inputs to the Select query WITHOUT having to go in month after month and manually change it... I may be asking a bit much here but is there a...
4
1801
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 names that belong to each unique ID. It doesn't matter that the ID will be repeated multiple times in the same column, I'll deal with that later. I just need to have the query results with an ID# column and a single Name column. Any help would be...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.