Anybody know how to show the indeces of a connected database table?
Proc contents doesn't show them, so I tried to pass a describe to sybase...can't get it to work...tried a number of ways.
execute(describe table ' MEMBER ') by sybase;
SYBASE_43: Executed: on connection 0
describe table ' MEMBER '
SYBASE: 0 row(s) affected by INSERT/UPDATE/DELETE or other statement.
ERROR: Error executing statement. Error Code: -156 Incorrect syntax near the keyword 'table'.
Got it to work...using system proc sp_helpindex
29 proc sql;
33 select * from connection to foo( sp_helpindex CLAIM);
SYBASE_70: Prepared: on connection 3
sp_helpindex CLAIM
TRACE: sydesc()
SYBASE: Cursor closed.
Found that proc on http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc36273_1251/html/sprocs/X95841.htm
You tried explicit SQL Pass through with the describe statement?
What about querying from sp_tables or sp_columns directly?
select * from mysybase.sp_tables
@tomrvincent wrote:
Anybody know how to show the indeces of a connected database table?
Proc contents doesn't show them, so I tried to pass a describe to sybase...can't get it to work...tried a number of ways.
execute(describe table ' MEMBER ') by sybase;
SYBASE_43: Executed: on connection 0
describe table ' MEMBER '
SYBASE: 0 row(s) affected by INSERT/UPDATE/DELETE or other statement.
ERROR: Error executing statement. Error Code: -156 Incorrect syntax near the keyword 'table'.
NOTE: Libref FOO was successfully assigned as follows:
Engine: SYBASE
Physical Name: RPT_XEG_2
29
30 select * from foo.sp_tables;
SYBASE_56: Prepared: on connection 1
SELECT * FROM dbo.sp_tables
ERROR: File FOO.sp_tables.DATA does not exist.
Why did you give the DESCRIBE TABLE command a string instead of a table name?
How does the DESCRIBE TABLE command return its results? Does it look like a table? Perhaps you want use this syntax instead.
select * from connection to sybase
(describe table MEMBER)
;
That syntax works well for many Teradata commands.
Or perhaps there is some function in Sybase you can wrap around the describe table command to have its output converted to the same type of output that a normal SELECT statement would return?
Got it to work...using system proc sp_helpindex
29 proc sql;
33 select * from connection to foo( sp_helpindex CLAIM);
SYBASE_70: Prepared: on connection 3
sp_helpindex CLAIM
TRACE: sydesc()
SYBASE: Cursor closed.
Found that proc on http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc36273_1251/html/sprocs/X95841.htm
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.