从Laravel调用Oracle存储过程,它具有2个IN和一个OUT参数

时间:2017-06-21 00:11:21

标签: php oracle laravel pdo oci8

  1. 这是我的程序:

    创建或替换PROCEDURE GET_CONTENT(IID IN INTEGER,键入IN RAW,DATA    OUT CLOB)    如    开始    SELECT ENCRYPT_DECRYPT.DECRYPT(DATA,KEY,UTL_RAW.cast_to_raw(key))    进入数据    来自AUDIT_TABLE    WHERE ID = IID;    END;

  2. 以下是我一直在尝试的内容:

    $pdo = DB::connection('oracle')->getPdo();
    
    $sql = 'CALL GET_CONTENT(?,?,?)';
    $stmt = $pdo->prepare($sql);
    $lid =  11;
    $key = 'MASTERKEY';
    $stmt->bindParam(1, $lid, PDO::PARAM_INT, 10);
    $stmt->bindParam(2, $master_key, PDO::PARAM_STR|PDO::PARAM_INT, 100);
    $stmt->bindParam(3, $DataResult, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 
    200);
    print "Values of bound parameters _before_ CALL:\n";
    print "  1: {$lid} 2: {$key}\n";
    
    $stmt->execute();
    
    print "Values of bound parameters _after_ CALL:\n";
    print "  1: {$lid} 2: {$key}\n";
    
    
    Error: Illegal name variable/number
    

0 个答案:

没有答案