Help for this page

Select Code to Download


  1. or download this
    CREATE TABLE USER_BRANCH_XREF (
        USER    VARCHAR2(20)  NOT NULL  REFERENCES USERS(USERNAME)
       ,BRANCH  NUMBER        NOT NULL  REFERENCES BRANCHES(ID)
       ,CONSTRAINT PRIMARY KEY (USER, BRANCH)
    );
    
  2. or download this
    SELECT branches.id    AS value
          ,branches.name  AS branch
    ...
     WHERE users.username = ?
       AND user_branch_xref.user = users.username
       AND user_branch_xref.branch = branches.id
    
  3. or download this
    my $sql = <<__END_SQL__;
    SELECT branches.id    AS value
    ...
    $template->param(
        branches => $sth->fetchall_arrayref( {} ),
    );