473,378 Members | 1,156 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,378 software developers and data experts.

Querying schema/description

3
I will admit up front that this is to help with an assignment for a class, however, I'm looking for information outside the scope of the assignment because I want to do something cooler. The assignment is intended to demonstrate the ability to query against a joined table. I am supposed to get the values for all fields of a given datatype within these 2 tables that are joined. The teacher expects that we will look at the descriptions of the tables to figure out which fields to query for, but I think that is kinda lame, and would rather do it by running a sub query.

The DESCRIBE TABLE command appears to return a table, but when I tried
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM (DESCRIBE TABLE [TABLENAME])
, I got an error. I also found some things (on this forum) about SYSCAT.TABLES, but I couldn't see how to get the information I was looking for out of that either.

Can anyone point me to a solution on how to get the datatype of a field (or other table metadata) in a form that I could use in this situation, or another solution that would affect the same result? Anything would be much appreciated.

::UPDATE::
OK, I've figured out a query to get the field names, but now I need to query for each of the items I generated in the join of the two tables. I'll post the code for the subquery below. For background, there are only 2 tables in the schema, so I don't need to explicitly define which tables I want to get the data from since I explicitly define the schema in which only the 2 tables I want to look at exist. Here's the code for the subquery
Expand|Select|Wrap|Line Numbers
  1. SELECT TABNAME||'.'||COLNAME variable FROM SYSCAT.COLUMNS WHERE TABSCHEMA = 'DBGUESTG' AND (TYPENAME = 'CHARACTER' OR TYPENAME = 'VARCHAR')
I need to use thet results of that query for the names of the columns I query for in the join of the 2 main tables.
Mar 27 '08 #1
1 1587
SilRay
3
So I've managed to deduce that even if I can get it down to one element from the subquery, it interprets it as a string literal instead of a column name. So in addition to the pivot and looping concatanation, I also need to know how to convert a string literal in to a field name. Any tips?
Mar 28 '08 #2

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

Similar topics

5
by: Ian Malone | last post by:
Hi, I'm wondering if it's possible for a document to contain a namespace which is a self-reference. e.g. in the following: <?xml version="1.0"?> <!DOCTYPE rdf:RDF > <rdf:RDF...
3
by: Shailendra Batham | last post by:
hi guys I need your suggestions / opinion for doing this the right way. I have a XML and a Schema for the same What I want is when its validated against the schema, it should give custom...
0
by: XSD-optimist | last post by:
I am trying to generate the classes for an XSD schema using the Microsoft XSD Object Code Generator (XSDObjGen). I am having a schema that contains the definition of the following: 1. a complex...
2
by: Ali | last post by:
I am having problem compiling schema contained in WSDL file when analyzing schema types contained in it (for example http://www.ebout.net/net/GoogleSearch.wsdl). Following code demonstrates my...
0
by: billmiami2 | last post by:
I'm creating an ASP.NET web service with a number of web methods. The consumers of these web services are developers using Macromedia Flash which comes with its own interface for web services. In...
7
by: mkarbarz | last post by:
Hello, I need to come up with a stored procedure that will allow me to read data from another database. The database I need to read the data from is a UniData residing on a Unix server. The...
3
by: Eric Lilja | last post by:
Sorry for asking so many questions, but I've just started and need to get some things working so I can do the task that is before me. Consider this (validating) schema: <?xml version="1.0"?>...
4
by: chitownjohn69 | last post by:
I'm working on a simple database that has 2 tables one called ITEMS, one called USERS. I'm tracking items being transfered between 2 users. in the ITEMS table I reference the sending user and...
1
by: sakhawn | last post by:
hi all, I need to transform an xml file into a different format (Dublin Core schema) using xslt, file contains different records each record needs to transformed based on a unique ID (in this case...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.