/*================================================================= Copyright (C) 2013 BizStation Corp All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =================================================================*/ var TYPE_DDF = 1; var TYPE_BDF = 0; var READ_ONLY = -2; var OPEN_NORMAL = 0; var AUTO_CREATE_TABLE = true; var OWNER_NAME = ""; var DIR=""; var fn_id = 0; var fn_user = 1; var S_NOWAIT_LOCK = 200; var M_NOWAIT_LOCK = 400; var CCURR_T_BIAS = 1000; var trans_bias = S_NOWAIT_LOCK + CCURR_T_BIAS; // field type var ft_string = 0; var ft_integer = 1; var ft_float = 2; var ft_date = 3; var ft_time = 4; var ft_decimal = 5; var ft_money = 6; var ft_logical = 7; var ft_numeric = 8; var ft_bfloat = 9; var ft_lstring = 10; var ft_zstring = 11; var ft_note = 12; var ft_lvar = 13; var ft_uinteger = 14; var ft_autoinc = 15; var ft_bit = 16; var ft_numericsts = 17; var ft_numericsa = 18; var ft_currency = 19; var ft_timestamp = 20; var ft_blob = 21; var ft_reserve22 = 22; var ft_reserve23 = 23; var ft_reserve24 = 24; var ft_wstring = 25; var ft_wzstring = 26; var ft_guid = 27; var ft_datatime = 30; var ft_varchar = 40; var ft_varbinary = 41; var ft_wvarchar = 42; var ft_wvarbinary = 43; var ft_char = 44; var ft_wchar = 45; var ft_mydate = 46; var ft_mytime = 47; var ft_mydatetime = 48; var ft_mytimestamp = 49; var ft_mytext = 50; var ft_myblob = 51; //key flag var key_duplicate = 0; var key_changeable = 1; var key_allnullkey = 3; var key_desc = 6; var key_extend = 8; var key_anynullkey = 9; var key_incase = 10; var changeCurrentNcc = 1; var USE_NONE = 0; var USE_TRAN = 1; var USE_BULKINSERT = 2; var USE_SNAPSHOT = 4; /*--------------------------------------------------------------------------------*/ WScript.quit(main()); /*--------------------------------------------------------------------------------*/ function showTableError(tb, TableName) { if (tb.stat != 0) WScript.Echo(TableName + " error No." + tb.stat); } /*--------------------------------------------------------------------------------*/ function openTable(db, tableName) { var ret = db.OpenTable(tableName, OPEN_NORMAL, AUTO_CREATE_TABLE,OWNER_NAME,DIR); if (ret == null) WScript.Echo(tableName + " open erorr:No" + db.stat); return ret; } /*--------------------------------------------------------------------------------*/ function write(tb, start, end) { tb.KeyNum = 0; for (var i=start;i< end;i++) { tb.ClearBuffer(); tb.Vlng(fn_id) = i; tb.Text("name") = i; tb.Insert(changeCurrentNcc); if (tb.Stat != 0) { WScript.Echo(tb.Stat); return false; } } return true; } /*--------------------------------------------------------------------------------*/ function deleteAll(db,tb, start, end) { db.BeginTrn(trans_bias); for (var i=start;i=", st).And("id", "<", en); tb.SetQuery(qb); tb.Vlng(fn_id) = st; tb.SeekGreater(true/*orEqual*/); for(var i=st;i