473,789 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Querying schema/description

3 New Member
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 1615
SilRay
3 New Member
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
1542
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 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:contribution="http://www.example.org/#"
3
6061
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 errors saying what happened and where...... is it possible to do that ? for eg. if the Attribute is missing or invalid in the following element <Watch ID="999d999">
0
1841
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 type 'ExternalDestinationBaseComplexType' 2. abstract element 'ExternalDestinationDefinitionEntry' of type 'ExternalDestinationBaseComplexType' 3. two elements 'SAP' and 'Dir' of type ExternalDestinationBaseComplexType with substitutionGroup set...
2
7309
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 problem: using System.Diagnostics; using System.IO; using System.Xml; using System.Xml.Schema;
0
1198
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 order that these developers can take full advantage of the web services, it appears that I need to return output data types in my service description (i.e., before the method is called and the dataset returned), not just input data types. Note...
7
16413
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 stored procedure needs to reside on my sql 2005 server. The task is very simple in Access as we have ODBC connections set up to the UniData via Informix (or IBM) UniData ODBC drivers. I can easily combine my UniData and Sql Server tables from...
3
9931
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"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="myns" xmlns="myns" elementFormDefault="qualified"> <xs:element name="books"> <xs:complexType> <xs:sequence>
4
1324
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 receiving user by a numeric field ITEMUSERID and SENDTO that both refer to the USERID in the USERS table. I want to pull the description of both of these users in my result. I am able to do this using a stored query and then querying that query. I want...
1
4368
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 its element <guid>) that represents the record. Input file is: <?xml version="1.0" encoding="UTF-8" ?> <ListRecords> <record> <header> <identifier>Project_DEM_100</identifier> <datestamp>2000-02-14T09:23:25Z</datestamp> </header>
0
9504
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
10190
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
9011
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
6754
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
5413
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
5545
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4084
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
3692
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2903
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.