Ejemplo n.º 1
0
function db_trans_query($connection, $sql)
{
    // TRANSLATION: do NOT translate these since error messages need to stay in English for technical support
    $sql = preg_replace("/([,\\(=])[\r\n\t ]*''/", '\\1NULL', $sql);
    $result = pg_query($connection, $sql);
    if ($result === false) {
        db_trans_rollback($connection);
        db_show_error($sql, "DB Transaction Execute Failed.");
    }
    return $result;
}
Ejemplo n.º 2
0
function db_trans_query($connection, $sql)
{
    global $DatabaseType;
    if ($DatabaseType == 'oracle') {
        $parse = ociparse($connection, $sql);
        if ($parse === false) {
            db_trans_rollback($connection);
            db_show_error($sql, "DB Transaction Parse Failed.");
        }
        $result = OciExecute($parse, OCI_DEFAULT);
        if ($result === false) {
            db_trans_rollback($connection);
            db_show_error($sql, "DB Transaction Execute Failed.");
        }
        $result = $parse;
    } elseif ($DatabaseType == 'postgres') {
        $sql = ereg_replace("([,\\(=])[\r\n\t ]*''", '\\1NULL', $sql);
        $result = pg_query($connection, $sql);
        if ($result === false) {
            db_trans_rollback($connection);
            db_show_error($sql, "DB Transaction Execute Failed.");
        }
    }
    return $result;
}
Ejemplo n.º 3
0
function db_trans_query($connection, $sql)
{
    global $DatabaseType;
    // TRANSLATION: do NOT translate these since error messages need to stay in English for technical support
    if ($DatabaseType == 'oracle') {
        $parse = ociparse($connection, $sql);
        if ($parse === false) {
            db_trans_rollback($connection);
            db_show_error($sql, "DB Transaction Parse Failed.");
        }
        $result = OciExecute($parse, OCI_DEFAULT);
        if ($result === false) {
            db_trans_rollback($connection);
            db_show_error($sql, "DB Transaction Execute Failed.");
        }
        $result = $parse;
    } elseif ($DatabaseType == 'postgres') {
        $sql = preg_replace("/([,\\(=])[\r\n\t ]*''/", '\\1NULL', $sql);
        $result = pg_query($connection, $sql);
        if ($result === false) {
            db_trans_rollback($connection);
            db_show_error($sql, "DB Transaction Execute Failed.");
        }
    }
    return $result;
}