Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:01:31+00:00 2026-06-08T12:01:31+00:00

Teradata has a useful view called dbc.tables that you can use to query objects.

  • 0

Teradata has a useful view called dbc.tables that you can use to query objects. I’ve used this to query the RequestText in views with success, but procedures seem to be compiled a bit differently.

When I look at the RequestText of a procedure (TableKind P), all I get is something like this:

ALTER PROCEDURE '468137'xn.'546321987654321345646556213165468654654654'xn COMPILE /* mydb.procedurename */;

Is this a reference to the actual RequestText that’s stored elsewhere? How do I get to it?

I want to actually query it with SQL, not dump it to a text file.

The reason why is because I need to run a LIKE statement against it to search for references to a specific table name. It would be inconvient to have to dump it to a text file and then search the text file manually.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:01:37+00:00Added an answer on June 8, 2026 at 12:01 pm

    Stored Procedures are compiled to be an executable object. On Windows, they’re compiled into DLLs. On Unix, they’re compiled into Shared Objects. Those objects are stored within the owning database.

    Here’s a similar question asked on the Teradata Forums.

    Viewing the Original Procedure Code

    Since they’re compiled, the original code won’t we visible in somewhere like DBC.Tables, so unfortunately as you’ve found, the following query against DBC.Tables won’t work.

    SELECT *
    FROM DBC.Tables
    WHERE TableKind = 'P'
    AND RequestText LIKE '%abc%';
    

    Instead, the only way to retrieve the Stored Procedure code is to execute the following:

    SHOW PROCEDURE mydb.procedurename;
    

    How to Find Stored Procedures That Contain a Specific String of Characters

    What I would do is to use VBScript or VBA to connect to Teradata via ODBC. I would first run this to get a list of all Stored Procedures:

    SELECT *
    FROM DBC.Tables
    WHERE TableKind = 'P';
    

    Then, I would loop through each result and run the following, saving the result to a variable in VBA.

    SHOW PROCEDURE <dbname>.<tablename>;
    

    I would then use something like the InStr() function to find when the code contains a certain string of text.

    Granted, this is a lot more involved that I think you were initially hoping for.

    Alternate Option

    An alternate option is to utilise tables in the DBQL database, if they’re available to you.

    This database contains some “logging” tables where you can see a history of all SQL statements executed on the system.

    That way, you can run the type of query you initially were hoping for using a LIKE condition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyonen help with Teradata? I want to create a query that is a
I have two tables in a teradata database that look like this accounts account_number
Can any one suggest good resources and practice exercises for Teradata and Business Objects
I'm trying to make a Teradata SQL query that will return the n -th
I use teradata and the below query outputs Altlüd when run using a teradata
Can Teradata SQL Query do Auto-Increment? I'm looking for something similar to SELECT Date
In Teradata, I need a query to first identify all members in the MEM
I'm converting database from Teradata to SqlServer. I've noticed all tables and procedures are
This is in teradata. For many good reasons, I would like to have a
can you extract data from teradata on ibm z/os as an XML document? i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.