Salesforce ODBC-driveren giver dig mulighed for at arbejde med Salesforce-data fra Oracle®, som om Salesforce-dataene var lokale Oracle®-data. Du kan gøre dette fra Oracle®, der kører på både Windows- og ikke-Windows-platforme.
Denne blog deler en løsning på et problem, som en af vores kunder oplevede, da de forsøgte at opdatere et Salesforce-objekt fra Oracle®. Fejlen kunden fik var:
"ORA-02070: database SF does not support some function in this context"
Kunden forsøgte at opdatere disse Salesforce-data:
SQL> select "Type" from Account@SF where "Id"='001w000001CKeM8AAL'; Type -------------------------------------------------------------------------------- Customer - Channel 2 SQL> update Account@SF set "Type"='Customer - Channel 3' where "Id"='001w000001CKeM8AAL'; update Account@SF set "Type"='Customer - Channel 3' where "Id"='001w000001CKeM8AAL' * ERROR at line 1: ORA-02070: database SF does not support some function in this context
Løsningen var at bruge en pass through SQL-sætning:
SQL> DECLARE 2 cr NUMBER; 3 rs NUMBER; 4 BEGIN 5 cr := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@SF; 6 DBMS_HS_PASSTHROUGH.PARSE@SF(cr,'update Account set "Type"=''Customer - Channel 3'' where "Id"=''001w000001CKeM8AAL'' '); 7 rs := DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@SF (cr); 8 DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@SF(cr); 9 END; 10 / PL/SQL procedure successfully completed. SQL> select "Type" from Account@SF where "Id"='001w000001CKeM8AAL'; Type -------------------------------------------------------------------------------- Customer - Channel 3 SQL>