Solved

Salesforce.com:  How to find all tables and columns?  (like SQL sys.tables, sys.columns)

Posted on 2014-11-04
2
854 Views
Last Modified: 2016-02-17
Hi All

I've inherted an SSIS package where the data source is salesforce.com, using the Pragmatic Works controls TFSalesForce Source / Destination.

Ten tables, some of these tables have 700+ columns, and my client tells me that these change every once in awhile.

Question:  What's the salesforce.com SOQL to 'find all tables and columns', similar to SQL Server sys.tables and sys.columns?

Thanks in advance.
Jim
0
Comment
Question by:Jim Horn
2 Comments
 
LVL 39

Assisted Solution

by:lcohan
lcohan earned 200 total points
ID: 40421672
I'm a beginner in this "cloud" of the "cloud" as well and looks like Salesforce.com is the most "secretive" of all that actually share the same "database" infrastructure and architecture on the backend << http://www.dbms2.com/2011/09/15/database-architecture-salesforce-com-force-com-and-database/ >>

and here's what I use to learn and dig in the background:

http://developer.force.com/cookbook/recipe/retrieve-a-list-of-objects-using-apex
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 0 total points
ID: 40457708
Answered when I asked the question here:

There's so such equivalent in salesforce. Fields and tables are exposed through metadata describe calls, not through the platform's query language. However, there are app exchange apps that can convert metadata into custom tables that you can query normally. Note that this is essentially cached data, so you'll have to periodically run a process that updates this cache.

Edit:

App Exchange Apps are apps hosted on the site http://appexchange.salesforce.com/, which can be installed by administrators into any organization that the package supports, possibly for an additional one-time or per-month fee.

The query you could use would be dependent on the package being used, but it would probably look something like this:

SELECT PKG__FieldType__c, PKG__FieldLength__c, PKG__DefaultValue__c, ... FROM PKG__Field__c
The exact semantics will vary by type, so you'll have to read the documentation or look at the data structures installed post-installation.

Updating the cache also varies by package. For example, one such app I tested had a Visualforce page with a button that a user could click to kick off the process. Other apps might use some scheduled process to update records every night or use some other process.

The first solution was not something that I could impliment.
Either way, lowering points / accepting for the effort.

Thanks.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Viewers will learn how the fundamental information of how to create a table.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now