Solved

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

Posted on 2014-11-04
2
829 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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 to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

744 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

11 Experts available now in Live!

Get 1:1 Help Now