473,786 Members | 2,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Field Mapping tool for queries

Hi,

My boss is asking me to generate a column mapping report of all the
queries. Basically, we get our data from ORACLE. There's a queary that
create new table from ORACLE tables. Then, there are reports and
queries that uses the new table.

Is there an add in or tool that can generate mapping reports of the
queries.

Example:
========
Query 1:
Field1 --> from access.field1
Field2 --> from access.field2

make table query from oracle table to new table:
access.field1 --> from oracle_tbl.fiel d1
access.field2 --> from oracle_tbl.fiel d2

Better if it can map it straight to oracle source:
Field1 --> from oracle_tbl.fiel d1
Field2 --> from oracle_tbl.fiel d2

Thanks in advance!
Ross

Nov 13 '05
26 2978
Hi Matthias,

Thanks. But, I've done that. It does not print the fields coming from
external sources. We have lots of queries that actually just replicate
tables from Oracle. And using your suggestion does not print the field
names of the query. It was just empty.

ross

Nov 13 '05 #21
On 10 Dec 2004 15:40:58 -0800, te**@i-vibe.com wrote:
Bas!

Thank you so much, you're really good!

Well, just one last thing. My goal will be completed if somebofy here
has a sub-routine that parses a SQL string to get the tables and
fields used. I know this is easy as I can do this in Java, but it would
be great if someone has a logic in VB. For example:
Query1:
TABLE1.field 1
TABLE1.field 2
and so on....

Thanks!


In the DumpQueries procedure, use someting like

Print #nFile, vbTab & fld.SourceTable & "." fld.Name & _
" " & fld.SourceField

Please look up the online help for other properties of the Field
object in the Fields collection of the QueryDef object, you might find
other interesting things.

HTH
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #22
Hi Matthias,

Thanks. But, I've done that. It does not print the fields coming from
external sources. We have lots of queries that actually just replicate
tables from Oracle. And using your suggestion does not print the field
names of the query. It was just empty.

ross

Nov 13 '05 #23
On 11 Dec 2004 11:32:33 -0800, te**@i-vibe.com wrote:
Hi Matthias,

Thanks. But, I've done that. It does not print the fields coming from
external sources. We have lots of queries that actually just replicate
tables from Oracle. And using your suggestion does not print the field
names of the query. It was just empty.

ross


You do use linked tables, or do you use passtrough queries?
Maybe a concrete example could help here.

Greetings
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #24
On 11 Dec 2004 11:32:33 -0800, te**@i-vibe.com wrote:
Hi Matthias,

Thanks. But, I've done that. It does not print the fields coming from
external sources. We have lots of queries that actually just replicate
tables from Oracle. And using your suggestion does not print the field
names of the query. It was just empty.

ross


Ok, let's do an example:

I'm linking table "dbo.Custom er" from the Northwind database (sample
database on SQL Server) to my MDB, and rename the table as
"tblCustome r". I *cannot* rename the fields in the linked table.

I'm settting up the followeing query, named "qryCustome r":

SELECT tblCustomers.Cu stomerID, tblCustomers.Co mpanyName,
tblCustomers.Ad dress, tblCustomers.Ci ty,
"Phone " & [Phone] & ", Fax " & [Fax] AS Comm,
"Phone " & [Phone] AS Comm2
FROM tblCustomers;

I run the following code:

Sub DumpCust()

Dim db As DAO.Database
Dim qd As DAO.QueryDef
Dim fld As DAO.Field
Dim td As DAO.TableDef

Set db = CurrentDb
Set qd = db.QueryDefs("q ryCustomer")
Debug.Print qd.Name

For Each fld In qd.Fields
Set td = db.TableDefs(fl d.SourceTable)
Debug.Print " Query Table.Field: " & fld.SourceTable & "." &
fld.Name
Debug.Print " Source Table.Field: " & td.SourceTableN ame & "." &
fld.SourceField
Debug.Print
Next
qd.Close
Set qd = Nothing
db.Close
Set db = Nothing

End Sub

I get the result

qryCustomer
Query Table.Field: tblCustomers.Cu stomerID
Source Table.Field: dbo.Customers.C ustomerID

Query Table.Field: tblCustomers.Co mpanyName
Source Table.Field: dbo.Customers.C ompanyName

Query Table.Field: tblCustomers.Ad dress
Source Table.Field: dbo.Customers.A ddress

Query Table.Field: tblCustomers.Ci ty
Source Table.Field: dbo.Customers.C ity

Query Table.Field: tblCustomers.Co mm
Source Table.Field: dbo.Customers.

Query Table.Field: tblCustomers.Co mm2
Source Table.Field: dbo.Customers.P hone

Thus I get all the information about the source table and fields, with
one exception: The query field "Comm" relates to two different fields,
and this is not covered. You would need to parse the field expresssion
only in this case.

HTH
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #25
On 11 Dec 2004 11:32:33 -0800, te**@i-vibe.com wrote:
Hi Matthias,

Thanks. But, I've done that. It does not print the fields coming from
external sources. We have lots of queries that actually just replicate
tables from Oracle. And using your suggestion does not print the field
names of the query. It was just empty.

ross


You do use linked tables, or do you use passtrough queries?
Maybe a concrete example could help here.

Greetings
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #26
On 11 Dec 2004 11:32:33 -0800, te**@i-vibe.com wrote:
Hi Matthias,

Thanks. But, I've done that. It does not print the fields coming from
external sources. We have lots of queries that actually just replicate
tables from Oracle. And using your suggestion does not print the field
names of the query. It was just empty.

ross


Ok, let's do an example:

I'm linking table "dbo.Custom er" from the Northwind database (sample
database on SQL Server) to my MDB, and rename the table as
"tblCustome r". I *cannot* rename the fields in the linked table.

I'm settting up the followeing query, named "qryCustome r":

SELECT tblCustomers.Cu stomerID, tblCustomers.Co mpanyName,
tblCustomers.Ad dress, tblCustomers.Ci ty,
"Phone " & [Phone] & ", Fax " & [Fax] AS Comm,
"Phone " & [Phone] AS Comm2
FROM tblCustomers;

I run the following code:

Sub DumpCust()

Dim db As DAO.Database
Dim qd As DAO.QueryDef
Dim fld As DAO.Field
Dim td As DAO.TableDef

Set db = CurrentDb
Set qd = db.QueryDefs("q ryCustomer")
Debug.Print qd.Name

For Each fld In qd.Fields
Set td = db.TableDefs(fl d.SourceTable)
Debug.Print " Query Table.Field: " & fld.SourceTable & "." &
fld.Name
Debug.Print " Source Table.Field: " & td.SourceTableN ame & "." &
fld.SourceField
Debug.Print
Next
qd.Close
Set qd = Nothing
db.Close
Set db = Nothing

End Sub

I get the result

qryCustomer
Query Table.Field: tblCustomers.Cu stomerID
Source Table.Field: dbo.Customers.C ustomerID

Query Table.Field: tblCustomers.Co mpanyName
Source Table.Field: dbo.Customers.C ompanyName

Query Table.Field: tblCustomers.Ad dress
Source Table.Field: dbo.Customers.A ddress

Query Table.Field: tblCustomers.Ci ty
Source Table.Field: dbo.Customers.C ity

Query Table.Field: tblCustomers.Co mm
Source Table.Field: dbo.Customers.

Query Table.Field: tblCustomers.Co mm2
Source Table.Field: dbo.Customers.P hone

Thus I get all the information about the source table and fields, with
one exception: The query field "Comm" relates to two different fields,
and this is not covered. You would need to parse the field expresssion
only in this case.

HTH
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #27

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1656
by: | last post by:
Hi! I post this text 1 year ago. But no one really could give me an answer. This is the text that I posted long time ago: I have a fundamental question about The way .NET handles the object orientated way of Persistence. I am coming from JAVA and WebObjects (Apple) World and I am looking for a convenient way of working
0
1126
by: Dave Karmens | last post by:
Does anyone have an example of field mapping? I am trying to write an app that reads a .csv file and then allows a user to map those .csv fields to existing SQL fields... I have the reading of the .csv & writing to SQL, but hit the wall trying to get a mapping process to work... Ideally, I would check off a field from the csv and check off a corresponding field in the sql field then hit a map button and it would
4
2754
by: Ashish Kanoongo | last post by:
Does anyone have an example of field mapping? I am trying to write an app that reads a .csv file and then allows a user to map those .csv fields to existing SQL fields... I have the reading of the .csv & writing to SQL, but hit the wall trying to get a mapping process to work...
2
4901
by: David Thielen | last post by:
Hi; I have a small XML file that I need to read/change from my app. Is there some easy way to map from XML to my objects so I can just read it in to my objects, change the objects as needed, then write the whole thing back out? thanks - dave david@at-at-at@windward.dot.dot.net
0
9650
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10164
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...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
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...
0
6748
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();...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.