Skip Headers

# Specifying a SQLCall Input Parameter

Previous

Next

In Example: Specifying an SQLCall with an Input Parameter Using the # Prefix, you specify `last_name` as an input parameter by prefixing its name with one number sign ( `#` ). Example: Executing an SQLCall with an Input Parameter shows how to bind a value to this input parameter when you execute the query.

Specifying an SQLCall with an Input Parameter Using the # Prefix

    SQLCall sqlCall = new SQLCall(
        "INSERT INTO EMPLOYEE (L_NAME) VALUES (#last_name)");

Executing an SQLCall with an Input Parameter

    DataModifyQuery query = new DataModifyQuery();
    query.setCall(sqlCall);
    query.addArgument("last_name");   // input

    Vector arguments = new Vector();
    arguments.add("MacDonald");
    session.executeQuery(query, arguments);