+ Start a Discussion

query salesforce from PL/SQL

Hi All,

I have made a pl/sql package for salesforce queries. http://code.google.com/p/plsqlsoap/

Simply you can select like this from oracle:

select extractvalue(sf_xml_return,'//sf:Id','xmlns:sf="urn:sobject.enterprise.soap.sforce.com"') Id
from table(OLAP_XMLA_SF5.SF_CALL ('SELECT Id FROM Opportunity'));

I will improve the code with better compression and session handling but now it works for any salesforce replication.

I have tested with Oracle Database 10g Release and PL/SQL Release

If you have any question and/or feature requests do not hesitate contact me

Have fun

Message Edited by gbacskai on 04-29-2008 08:14 AM
I will definitely try this out and let you know how it goes.
This could be huge - think oracle application express and salesforce.
great job!
Salesforce SOAP calls from PL/SQL.

Dear All,

New version added to the repository.
  • General soap calls from salesforce
  • Full Object copy from salesforce to oracle
  • Supported SOAP calls: describeGlobal , describeLayout, describeSObject, describeTabs,getServerTimestamp,getUserInfo,query,queryAll,queryMore


Hello gbacskai


This is Irfan, I want to import some data from Oracle database to the salesforce Tables.

1. What may be the procedures applied here to map the tables and fields. 

2. Can we import the data through xml files ?

3. is there any other utility available for importing or exporting data.


Thanks in advance,

Irfan Shahid. 

Hi Irfan,

1. Yes, You can update, but please first view the next wiki pages: http://wiki.apexdevnet.com/index.php/Sample_SOAP_Messages (enterprise column) and here is an example update from dual:

SELECT extractvalue(sf_xml_return,'/result/id/text()','xmlns="urn:enterprise.soap.sforce.com"')  id
, extractvalue(sf_xml_return,'/result/success/text()','xmlns="urn:enterprise.soap.sforce.com"') success

from TABLE(SELECT olap_xmla_sf.SF_Generic('update'
, '<urn:sObjects xsi:type="urn1:Note">
from DUAL D) x

You can write an oracle trigger for auto update. (please check out the svn again, I made a bugfix on it)

you can use now update,create,delete,merge,undelete

2. If you see it as an oracle table tan yes (see xdb for xml import) or just convert it to the proper salesforce soap message and send it to salesforce.

3. See salesforce app exchange for other tools (like apex data loader)