ibm-mobilefirstworklight-adapters

How to call Stored procedure in IBM worklight SQL Adapter with Custom IN Parameter


I am using the following in my Oracle database:

CREATE OR REPLACE
type PARAM_ARRAY as table of VARCHAR2 (4000);

Procedure created in Oracle using custom type

CREATE OR REPLACE

PROCEDURE REGISTERUSER(p_array in PARAM_ARRAY)
AS
BEGIN

dbms_output.put_line( p_array(1));

END REGISTERUSER;

How do I correctly write the below procedure in a SQL adapter?

var mycars = new Array();
    mycars[0] = "Saab";
    mycars[1] = "Volvo";
    mycars[2] = "BMW";

    var result =  WL.Server.invokeSQLStoredProcedure({
        procedure : "RegisterUser",
        parameters :mycars
    });

Solution

  • Worklight provides a well documented sample about creating a SQL adapter here:

    http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v610/04_03_SQL_adapter_-_Communicating_with_SQL_database.pdf

    Worklight also provides a full sample that accompanies the PPT found here:

    http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v610/WorklightAdaptersProject.zip