dbTalk Databases Forums  

Information_schema views

comp.databases.sybase comp.databases.sybase


Discuss Information_schema views in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
php newbie
 
Posts: n/a

Default Information_schema views - 06-03-2004 , 10:55 AM






Hello,

I have a couple of queries that go against information_schema views in
SQLServer to get list of tables, columns, and such. I have looked at
Sybase documentation and it does not seem to have an equivalent set of
views to accomplish the same task.

Are there an alternative queries to get, for example, all tables in a
database, or all columns in a table?

Thanks in advance

Reply With Quote
  #2  
Old   
Michael Peppler
 
Posts: n/a

Default Re: Information_schema views - 06-03-2004 , 11:01 AM






On Thu, 03 Jun 2004 08:55:45 -0700, php newbie wrote:

Quote:
Hello,

I have a couple of queries that go against information_schema views in
SQLServer to get list of tables, columns, and such. I have looked at
Sybase documentation and it does not seem to have an equivalent set of
views to accomplish the same task.

Are there an alternative queries to get, for example, all tables in a
database, or all columns in a table?
Look at the sp_help system stored procedure.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html



Reply With Quote
  #3  
Old   
Carl Kayser
 
Posts: n/a

Default Re: Information_schema views - 06-03-2004 , 11:19 AM



You may want to contact Ryan Putnam [putnamr (AT) river (DOT) it.gvsu.edu]. He
provides a bunch views.

An issue that I see is that "sp_" procedures are "write once, use on any
database" where as views would have to be loaded into each database of
interest.

"php newbie" <newtophp2000 (AT) yahoo (DOT) com> wrote

Quote:
Hello,

I have a couple of queries that go against information_schema views in
SQLServer to get list of tables, columns, and such. I have looked at
Sybase documentation and it does not seem to have an equivalent set of
views to accomplish the same task.

Are there an alternative queries to get, for example, all tables in a
database, or all columns in a table?

Thanks in advance



Reply With Quote
  #4  
Old   
php newbie
 
Posts: n/a

Default Re: Information_schema views - 06-03-2004 , 05:10 PM



"Carl Kayser" <kayser_c (AT) bls (DOT) gov> wrote

Quote:
You may want to contact Ryan Putnam [putnamr (AT) river (DOT) it.gvsu.edu]. He
provides a bunch views.

An issue that I see is that "sp_" procedures are "write once, use on any
database" where as views would have to be loaded into each database of
interest.

Michael, Carl: I appreciate your responses. I will check out the
sp_help.

Can I use sp_help programmatically too, say, from an ODBC connection
to Sybase? If not, are there system tables that I can use SQL
statements to access to get the same information?

I agree with your comments on the "view". It wasn't my intention to
create such views, I assumed they would be in a similar location. I
would just as easily use system tables if that is where such
catalog/schema/etc. information is kept.


Reply With Quote
  #5  
Old   
Michael Peppler
 
Posts: n/a

Default Re: Information_schema views - 06-04-2004 , 01:27 AM



On Thu, 03 Jun 2004 15:10:41 -0700, php newbie wrote:

Quote:
"Carl Kayser" <kayser_c (AT) bls (DOT) gov> wrote in message
news:<c9nj39$rna$1 (AT) blsnews (DOT) bls.gov>...
You may want to contact Ryan Putnam [putnamr (AT) river (DOT) it.gvsu.edu]. He
provides a bunch views.

An issue that I see is that "sp_" procedures are "write once, use on any
database" where as views would have to be loaded into each database of
interest.


Michael, Carl: I appreciate your responses. I will check out the sp_help.

Can I use sp_help programmatically too, say, from an ODBC connection to
Sybase? If not, are there system tables that I can use SQL statements to
access to get the same information?
You can use sp_help from an ODBC connection - it should be
no problem. You can also look at the source of sp_help to
get some information about the system tables it uses.

In general you want to look at sysobjects (where type = 'U'), syscolumns
and systypes. These three tables should give you most of
the information you need regarding the tables, their
columns, and the datatypes of the columns.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html



Reply With Quote
  #6  
Old   
Willie Kraatz
 
Posts: n/a

Default Re: Information_schema views - 06-04-2004 , 07:44 AM



All the system tables are described in the ASE Reference manual. You can
find it at http://sybooks.sybase.com/as.html. I routinely run SQL queries
against these tables.
"php newbie" <newtophp2000 (AT) yahoo (DOT) com> wrote

Quote:
"Carl Kayser" <kayser_c (AT) bls (DOT) gov> wrote

You may want to contact Ryan Putnam [putnamr (AT) river (DOT) it.gvsu.edu]. He
provides a bunch views.

An issue that I see is that "sp_" procedures are "write once, use on any
database" where as views would have to be loaded into each database of
interest.


Michael, Carl: I appreciate your responses. I will check out the
sp_help.

Can I use sp_help programmatically too, say, from an ODBC connection
to Sybase? If not, are there system tables that I can use SQL
statements to access to get the same information?

I agree with your comments on the "view". It wasn't my intention to
create such views, I assumed they would be in a similar location. I
would just as easily use system tables if that is where such
catalog/schema/etc. information is kept.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.