DOS 选择跳转实现、dos + bcp 双击导入和导出数据
DOS 选择跳转实现、dos + bcp 双击导入和导出数据
- option.bat
@echo off
:Start2
cls
goto Start
:Start
title Frequently Used Websites
echo Please select a website from the list
echo with the corresponding key
echo --------------------------------------
echo [1] Google
echo [2] Wikipedia
echo [3] Facebook
echo [4] Youtube
echo [5] Yahoo
set input=
set /p input= Choice:
if "%input%" =="" goto N
if %input%==1 goto Z if NOT goto Start2
if %input%==2 goto X if NOT goto Start2
if %input%==3 goto C if NOT goto Start2
if %input%==4 goto V if NOT goto Start2
if %input%==5 goto B if NOT goto Start2
if %input% gtr 5 goto N :Z
cls
echo You have selected Google
pause
start www.google.com
exit
:X
cls
echo You have selected Wikipedia
pause
start www.wikipedia.com
exit
:C
cls
echo You have selected Facebook
pause
start www.facebook.com
exit
:V
cls
echo You have selected Youtube
pause
start www.youtube.com
exit
:B
cls
echo You have selected Yahoo
pause
start www.Yahoo.com
exit
:N
cls
echo Invalid Selection! Try again
pause
goto :start2
- Mantis0000225_ExportSalesOrder_Autosys.cmd
-
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2FuZ3pocHdhbmc=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
@cls
@echo OFF
@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"
@SETLOCAL ENABLEEXTENSIONS
@SETLOCAL ENABLEDELAYEDEXPANSION
@echo ...
@echo VALIDATE ENVIRONMENT VARIABLES ...
rem +--------------------------------------------------------------------------+
rem | VALIDATE ENVIRONMENT VARIABLES |
rem +--------------------------------------------------------------------------+ @set MSBACKUP=D:\SalesOrder_NEWDRM
@set MSLOG=D:\SalesOrder_NEWDRM
@set MSTMP=D:\SalesOrder_NEWDRM
@echo ...
@echo DECLARE ALL GLOBAL VARIABLES...
rem +--------------------------------------------------------------------------+
rem | DECLARE ALL GLOBAL VARIABLES. |
rem +--------------------------------------------------------------------------+ @set FILENAME=SALESORDER
@set DB_USERNAME=DRMPOS
@set DB_PASSWORD=DRMPOS
@set TNS_ALIAS=DRMPROD
@set LOGFILE=%MSLOG%\%FILENAME%_%TNS_ALIAS%.log
@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.dat
rem +--------------------------------------------------------------------------+
rem | WRITE EXPORT PARAMETER FILE. |
rem +--------------------------------------------------------------------------+
@echo ...
@echo MOVE OLD EXPORT (DUMP) FILE....
rem +--------------------------------------------------------------------------+
rem | MOVE OLD EXPORT (DUMP) FILE. |
rem +--------------------------------------------------------------------------+ @if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup") @if exist %DUMPFILE% (echo f|@xcopy /y %DUMPFILE% %DUMPFILE%.backup)
@if exist %LOGFILE% (echo f|xcopy /y %LOGFILE% "%LOGFILE%.%endfix%")
@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")
@if exist %LOGFILE% (del /q %LOGFILE%)
@echo ...
@echo PERFORM EXPORT...
rem +--------------------------------------------------------------------------+
rem | PERFORM EXPORT. |
rem +--------------------------------------------------------------------------+ rem exp parfile=%PARFILE%
@bcp " select * from drmpos.SALESORDER where orderdate >= convert(DATE,getdate()-10)" queryout %DUMPFILE% -T -c -t^| -d apoms -e %LOGFILE% @IF not EXIST %LOGFILE% GOTO end @echo ...error occured
@echo SCAN THE EXPORT LOGFILE FOR ERRORS...
rem +--------------------------------------------------------------------------+
rem | SCAN THE EXPORT LOGFILE FOR ERRORS. |
rem +--------------------------------------------------------------------------+
@echo ...
@echo Analyzing log file for errors...
@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%
@if errorlevel 1 (goto good1) else (goto exception)
:END
@echo ...
@echo finished WITHOUT errorlog
@exit /b 0
:good1
@echo ...
@echo Analyzing log file for MS-errors...
@findstr /I /C:"invalid" %LOGFILE%
@if errorlevel 1 (goto good2) else (goto exception) :good2
@echo ...
@echo Analyzing log file for warnings...
@findstr /I /C:"error" %LOGFILE%
@if errorlevel 1 (goto good3) else (goto exception) :good3
@echo ...
@echo Analyzing log file for warnings...
@findstr /I /C:"rows" %LOGFILE%
@if errorlevel 1 (cmd /c exit 0) else (goto exception)
@exit /b 0 :exception
@exit /b 1
- Mantis0000227_ImportSalesOrder_Autosys.cmd
@cls
@echo OFF
@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"
@SETLOCAL ENABLEEXTENSIONS
@SETLOCAL ENABLEDELAYEDEXPANSION
@echo ...
@echo VALIDATE ENVIRONMENT VARIABLES ...
rem +--------------------------------------------------------------------------+
rem | VALIDATE ENVIRONMENT VARIABLES |
rem +--------------------------------------------------------------------------+ @set MSBACKUP=D:\SalesOrder_NEWDRM
@set MSLOG=D:\SalesOrder_NEWDRM
@set MSTMP=D:\SalesOrder_NEWDRM
@echo ...
@echo DECLARE ALL GLOBAL VARIABLES...
rem +--------------------------------------------------------------------------+
rem | DECLARE ALL GLOBAL VARIABLES. |
rem +--------------------------------------------------------------------------+ @set FILENAME=SALESORDER
@set DB_USERNAME=DRMPOS
@set DB_PASSWORD=DRMPOS
@set TNS_ALIAS=DRMPROD
@set LOGFILE=%MSLOG%\IMP_%FILENAME%_%TNS_ALIAS%.log
@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.dat
rem +--------------------------------------------------------------------------+
rem | WRITE EXPORT PARAMETER FILE. |
rem +--------------------------------------------------------------------------+
@echo ...
@echo MOVE OLD EXPORT (DUMP) FILE....
rem +--------------------------------------------------------------------------+
rem | MOVE OLD EXPORT (DUMP) FILE. |
rem +--------------------------------------------------------------------------+ @if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup") @if exist %DUMPFILE% (echo f|@xcopy /y %DUMPFILE% %DUMPFILE%.backup)
@if exist %LOGFILE% (echo f|xcopy /y %LOGFILE% "%LOGFILE%.%endfix%")
@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")
@if exist %LOGFILE% (del /q %LOGFILE%)
@echo ...
@echo PERFORM EXPORT...
rem +--------------------------------------------------------------------------+
rem | PERFORM EXPORT. |
rem +--------------------------------------------------------------------------+ rem exp parfile=%PARFILE%
@bcp apoms.drmpos.SALESORDER in %DUMPFILE% -T -c -t^| -e %LOGFILE% @IF not EXIST %LOGFILE% GOTO end @echo ...error occured
@echo SCAN THE EXPORT LOGFILE FOR ERRORS...
rem +--------------------------------------------------------------------------+
rem | SCAN THE EXPORT LOGFILE FOR ERRORS. |
rem +--------------------------------------------------------------------------+
@echo ...
@echo Analyzing log file for errors...
@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%
@if errorlevel 1 (goto good1) else (goto exception)
:END
@echo ...
@echo finished WITHOUT errorlog
@exit /b 0 echo ...
echo Analyzing log file for errors...
findstr /I /C:"Import terminated unsuccessfully" %LOGFILE%
if errorlevel 1 (goto good1) else (goto exception) :good1
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"communication" %LOGFILE%
if errorlevel 1 (goto good2) else (goto exception) :good2
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"errors" %LOGFILE%
if errorlevel 1 (goto good3) else (goto exception) :good3
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"Snapshot" %LOGFILE%
if errorlevel 1 (goto good4) else (goto exception) :good4
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"TNS" %LOGFILE%
if errorlevel 1 (goto good5) else (goto exception) :good5
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"resource" %LOGFILE%
if errorlevel 1 (goto good6) else (goto exception) :good6
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"deadlock" %LOGFILE%
if errorlevel 1 (goto good7) else (goto exception) :good7
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"identifier" %LOGFILE%
if errorlevel 1 (goto good8) else (goto exception) :good8
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"maximum" %LOGFILE%
if errorlevel 1 (goto good9) else (goto exception) :good9
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"shutdown" %LOGFILE%
if errorlevel 1 (goto good10) else (goto exception) :good10
echo ...
echo Analyzing log file for warnings...
findstr /I /C:"unable" %LOGFILE%
if errorlevel 1 (cmd /c exit 0) else (goto exception) exit /b 0 :exception
exit /b 1
版权声明:本文博主原创文章,博客,未经同意不得转载。
DOS 选择跳转实现、dos + bcp 双击导入和导出数据的更多相关文章
- SQL使用bcp方式导入,导出数据2
select * from A_Account EXEC sp_configure 'allow_updates' GO EXEC sp_configure 'allow_updates',0; ...
- Dos简易基础及常用Dos命令
Dos简易基础及常用Dos命令 什么是cmd? cmd是command的缩写,意指操作系统中的命令行程序,一般说的都是Windows中的Dos系统. 如何打开cmd? 键盘操作:Win + R 输入c ...
- sqlserver中BCP命令导入导出
个人自用导出文本文件命令: bcp [xxDB].[dbo].[xx_tb_name] out d:\temp\xxx.txt -c -t "\t" -T bcp是SQL Serv ...
- from表单实现无跳转上传文件,接收页面后台数据
实现无跳转发送表单数据.文件,并能接收后台返回的数据. 主要技术要点: 1.form表单添加target属性,指定一个iframme的name:form表单提交后在iframe内嵌窗口接受响应,主页面 ...
- SQL Server BCP 资料导入导出
SQL Server BCP 导入导出使用 Bcp 导出导入数据高效,比使用SQL Server Management Stdio 提供的数据库导出导入要高效因为sql server 也没有提供提供类 ...
- 使用BCP批量导入数据
本文原创,转载请标明出处 BCP 工具的使用 The bulk copy program utility (bcp) bulk copies data between an instance of M ...
- WPF DataGrid 双击行 获得绑定数据
原文:WPF DataGrid 双击行 获得绑定数据 1)增加事件 2)增加对象获取 1)事件代码 Datagrid 增加事件 MouseDoubleClick="dataGrid_Mous ...
- SQL Server中bcp命令的用法以及数据批量导入导出
原文:SQL Server中bcp命令的用法以及数据批量导入导出 1.bcp命令参数解析 bcp命令有许多参数,下面给出bcp命令参数的简要解析 用法: bcp {dbtable | query} { ...
- sqlserver bcp命令导出数据
原文:sqlserver bcp命令导出数据 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net ...
随机推荐
- python查看删除你微信的账号
#应用环境:python2.7 #!/usr/bin/env python # coding=utf-8 from __future__ import print_function import os ...
- C语言中static关键字的作用
static的作用(精辟分析) 在C语言中,static的字面意思很容易把我们导入歧途,其实它的作用有三条. (1)先来介绍它的第一条也是最重要的一条:隐藏. 当我们同时编译多个文件时,所有未加sta ...
- React数据传递
React基础概念 React是基于组件化的开发,通过组件的组合,让web应用能够实现桌面应用的效果. React更有利于单页应用的开发. 并非MVC框架,只能算是V 具有单项数据流的特点 优势:代码 ...
- 纯CSS实现带小角的对话框式下拉菜单
最近公司首页样式重写,头部下拉菜单改为了带小角的对话框式下拉菜单: 很多人可能会用图片,事实上纯CSS就能够实现: HTML: <!DOCTYPE html> <html lang= ...
- ASP.NET优化性能方法之一禁用调试模式(转)
若要设置 ASP.NET 应用程序的调试模式,必须编辑应用程序的 Web.config 配置文件. 通常,ASP.NET 应用程序的 Web.config 文件与应用程序位于相同的 URL 位置上. ...
- 微软HoloLens虚拟现实可以开发了。
1.microsoft-hololens-now-available-to-developers 2.http://www.microsoft.com/microsoft-hololens/en-us ...
- 【7】用Laravel5.1开发一个简单的博客系统
声明: 本教程参考Jeffrey way 在laracasts.com上的视频教程,感谢Jeffrey way为大家带来的精彩教程,本教程如有侵权,请及时告知,联系邮箱wanglv93@gmail.c ...
- [转发]Gulp开发教程(翻译)
Building With Gulp =================== 转载出处 原文地址 翻译出处 对网站资源进行优化,并使用不同浏览器测试并不是网站设计过程中最有意思的部分,但是这个过程中的 ...
- DataTables给每一列添加下拉框搜索
$(document).ready(function() { $('#example').DataTable( { initComplete: function () { var api = this ...
- ASP.NET MVC DefaultModelBinder
转载自 Leo‘s Blog 看到很多ASP.NET MVC项目还在从request.querystring或者formContext里面获取数据,这实在是非常落后的做法.也有的项目建了大量的自定义的 ...