CodePudding user response:
In pb, USES importfile is the fastest way to import, you can put the file into several, then direct importCodePudding user response:
With processing can also be directly@ echo off
Set the path=D: \
The set ls_dbn=% ~ n1
The set ls_server COMPUTERNAME=% %;
Connection string: : databasename ls_dbn=% %; Server=% ls_server %;
The set ls_connstr=userid=dba; Password=SQL; Databasefile=% 1;
The set ls_left=dbisqlc12 - c % ls_connstr % - q
: : set the separators and character set
The set ls_end=DELIMITED BY ', 'ENCODING' utf-8 '
: : echo start the engine and open the database...
: : dbisqlc12 - q "START ENGINE as' % % ls_server STARTLINE 'dbeng12 - c 8 m'"
: : dbisqlc12 - q "start as % ls_dbn % on the database % 1 '% % ls_server AUTOSTOP OFF"
Echo start the engine and connect to the database...
Dbisqlc12 AutoStop ls_connstr - c % %=OFF; - q "select 1
"Echo the delete from SALE_BARCODE...
% % ls_left "delete from SALE_BARCODE"
: : % ls_left % "LOAD TABLE SALE_BARCODE (BC_BARCODE1 BC_CLOTHNO, BC_COLOR, BC_SIZE, BC_UPDATETIME, BC_UPDATEMAN) FROM ls_end % % 2%"
: : echo the LOAD TABLE SALE_CLOTH
% % ls_left "LOAD TABLE SALE_CLOTH (CT_ID, CT_STYLEID CT_NAME, CT_SIZETYPE, CT_PRICE, CT_QH, CT_UPDATETIME, CT_UPDATEMAN) FROM ls_end % % 3%"
: : stop database
: : dbstop12 ls_dbn - y % %
: : dbisqlc12 - q "stop ls_dbn database % % on '% ls_server %'"
: : dbisqlc12 - q "stop ENGINE '% ls_server %'"
Dbstop12 ls_connstr - c % %
CodePudding user response:
@ xiajinxian: hello, this is just the way I want, but don't quite understand, the meaning of each parameter and fill method can you explain it in detail, thank you, for example, % 2 is said to import file path and file name in detailCodePudding user response: