Skip Headers

# Specifying a SQLCall Input / Output Parameter

Previous

Next

In Example: Specifying an Input and Output Parameter Using the #### Prefix, you specify `in_out` as an input and output parameter by prefixing its name with four number signs (`####`). The type of the input value determines the type of the output value. In this example, a `String` ("MacDonald") is passed in and the output value (for `EMP_ID`) is returned as a `String`.

Specifying an Input and Output Parameter Using the #### Prefix

    SQLCall sqlCall = new SQLCall(
        "INSERT INTO EMPLOYEE (L_NAME) VALUES (####in_out) RETURNING EMP_ID INTO ####in_out");

Executing a SQLCall with an Input and Output Parameter

    ValueReadQuery query = new ValueReadQuery();
    query.setCall(sqlCall);
    query.addArgument("in_out");   // input and outpu

    Vector args = new Vector();
    args.add("MacDonald");

    Number employeeID = (Numbere)getSession().executeQuery(query, args);