Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


        voltQueueSQL(getHoldingSummary, acct_id, symbol);
        VoltTable[] trade_type_hold = voltExecuteSQL();
       
        VoltTable trade_type = trade_type_hold[0];
        assert trade_type.getRowCount() == 1;
        VoltTableRow trade_type_row = trade_type.fetchRow(0);
       
        String type_name = trade_type_row.getString("TT_NAME");
        int type_is_sell = (int)(int)trade_type_row.getLong("TT_IS_SELL");
        int type_is_market = (int)trade_type_row.getLong("TT_IS_MRKT");
       
View Full Code Here


       
        VoltTable hold_sum = trade_type_hold[1];
        int hs_qty = 0;
        if (hold_sum.getRowCount() > 0) {
            assert hold_sum.getRowCount() == 1;
            hs_qty = (int)hold_sum.fetchRow(0).getLong("HS_QTY");
        }
       
        // frame 2: modifying the customer's holdings
       
        // first, some cusomer's account info
View Full Code Here

        // first, some cusomer's account info
        voltQueueSQL(getCustomerAccount, acct_id);
        VoltTable account = voltExecuteSQL()[0];
       
        assert account.getRowCount() == 1;
        VoltTableRow account_row = account.fetchRow(0);
       
        long broker_id = account_row.getLong("CA_B_ID");
        long cust_id = account_row.getLong("CA_C_ID");
        int tax_status = (int)account_row.getLong("CA_TAX_ST");
       
View Full Code Here

                }
               
                // modify existing holdings
                VoltTable hold_list = voltExecuteSQL()[0];
                for (int i = 0; i < hold_list.getRowCount() && needed_qty != 0; i++) {
                    VoltTableRow hold = hold_list.fetchRow(i);
                   
                    long hold_id = hold.getLong("H_T_ID");
                    int hold_qty = (int)hold.getLong("H_QTY");
                    double hold_price = hold.getDouble("H_PRICE");
                   
View Full Code Here

                }
               
                // modify existing holdings
                VoltTable hold_list = voltExecuteSQL()[0];
                for (int i = 0; i < hold_list.getRowCount() && needed_qty != 0; i++) {
                    VoltTableRow hold = hold_list.fetchRow(i);
                   
                    long hold_id = hold.getLong("H_T_ID");
                    int hold_qty = (int)hold.getLong("H_QTY");
                    double hold_price = hold.getDouble("H_PRICE");
                   
View Full Code Here

        if ((tax_status == 1 || tax_status == 2) && sell_value > buy_value) {
            voltQueueSQL(getTaxrate, cust_id);
            VoltTable tax_rate = voltExecuteSQL()[0];
           
            assert tax_rate.getRowCount() == 1;
            double tax_rates = tax_rate.fetchRow(0).getDouble(0);
            tax_amount = (sell_value - buy_value) * tax_rates;
           
            voltQueueSQL(updateTrade1, tax_amount, trade_id);
            voltExecuteSQL();
        }
View Full Code Here

        assert cust.getRowCount() == 1;
       
        VoltTableRow sec_row = sec.fetchRow(0);
        String s_ex_id = sec_row.getString("S_EX_ID");
        String s_name = sec_row.getString("S_NAME");
        int c_tier = (int)cust.fetchRow(0).getLong("C_TIER");
       
        voltQueueSQL(getCommissionRate, c_tier, type_id, s_ex_id, trade_qty, trade_qty); // limit to 1 row
        VoltTable comm = voltExecuteSQL()[0];
       
        assert comm.getRowCount() == 1;
View Full Code Here

       
        voltQueueSQL(getCommissionRate, c_tier, type_id, s_ex_id, trade_qty, trade_qty); // limit to 1 row
        VoltTable comm = voltExecuteSQL()[0];
       
        assert comm.getRowCount() == 1;
        double comm_rate = comm.fetchRow(0).getDouble("CR_RATE");
       
        // frame 5: recording the results
        double comm_amount = (comm_rate / 100) * (trade_qty * trade_price);
       
        voltQueueSQL(updateTrade2, comm_amount, trade_dts, st_completed_id, trade_price, trade_id);
View Full Code Here

       
        voltQueueSQL(getCustomerAccountBalance, acct_id);
        VoltTable bal = voltExecuteSQL()[0];
       
        assert bal.getRowCount() == 1;
        double acct_bal = bal.fetchRow(0).getDouble("CA_BAL");
       
        VoltTable ret_values = trade_result_ret_template.clone(64);
        ret_values.addRow(acct_bal);
       
        return new VoltTable[] {ret_values};
View Full Code Here

    public VoltTable[] run(long max_rows_to_return, long access_lob_flag, TimestampType start_day, String symbol) throws VoltAbortException {
        voltQueueSQL(getInfo1, symbol);
        VoltTable sec_detail = voltExecuteSQL()[0];
       
        assert sec_detail.getRowCount() == 1;
        long co_id = sec_detail.fetchRow(0).getLong("CO_ID"); // only co_id is really required
       
        voltQueueSQL(getInfo2, co_id);
        voltQueueSQL(getInfo3, co_id);
        voltQueueSQL(getInfo4, symbol, start_day);
        voltExecuteSQL(); // do not really need the results
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.