Skip to content

Allow creating just values & binds #10

@petdance

Description

@petdance

Sometimes you just want some values and binds, for cases like this:

    my $unshipped_sth = TW::DBI->prepare( <<"SQL" );
BEGIN
    $TEST_PACKAGE.createUnshippedTitlesList(
        :custid,
        :oam_id,
        :listid,
        :listname,
        :listdesc,
        :price_type,
        :order_exquoteid,
        :user_exquoteid,
        :cart_mode
    );
END;
SQL
            sqldo_exec_ok($unshipped_sth, {
                ':custid' => $user->custid,
                ':oam_id' => $oam_id,
                ':listid' => $listid,
                ':listname' => 'listutils.t',
                ':listdesc' => 'description',
                ':price_type' => $price_type,
                ':order_exquoteid' => $exquoteid,
                ':user_exquoteid'  => $exquoteid,
                ':cart_mode' => $user->cart_mode,
            });

We don't want to build the entire SQL statement because it's a proc and function call, but bulding up the names and the binds out of a hash would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions