problem-record-mysql
#!/bin/bash # # Update_Problem - updates problem record in database ############################################################### # Determine sql location & set variable # MYSQL=`which mysql`" Problem_Task -u testuser" # ################################################################ # ] #Check if id number was passed. then # # Check if any unfinished records exist. # RECORDS_EXIST=`$MYSQL -Bse 'select id_number from problem_logger where fixed_date="0000-00-00" or prob_solutions=""'` # # if [ "$RECORDS_EXIST" != "" ] then echo echo "The following records need updating..." $MYSQL <<EOF select id_number,report_date,prob_symptoms from problem_logger where fixed_date="0000-00-00" or prob_solutions=""\G EOF fi echo echo "What is the ID number for the" echo -e "problem you want to update?:\c" read ANSWER ID_NUMBER=$ANSWER else ID_NUMBER=$ fi # ################################################################ # Obtain Solution (aka Fixed) Date # echo echo -e "Was problem solved today?[y/n] \c" read ANSWER # case ANSWER in y|Y|yes|Yes|yEs|yeS|YEs|yES|YeS|YES) FIXED_DATE=`date +%Y-%m-%d` ;; *) #if answer is anything but yes,ask for date echo echo -e "What was the date of resolution?[YYYY-MM-DD]\c" read ANSWER # FIXED_DATE=$ANSWER ;; esac # ############################################################### # Acquire problem solution # echo echo -e "Briefly describe the problem solution :\c" # read ANSWER PROB_SOLUTIONS=$ANSWER # ############################################################## # Update problem record # # echo echo "Problem record updated as follows:" echo $MYSQL <<EOF UPDATE problem_logger SET prob_solutions="$PROB_SOLUTIONS" fixed_date=$FIXED_DATE WHERE id_number=$ID_NUMBER # select * from problem_logger where id_number=$ID_NUMBER\G EOF # #END
problem-record-mysql的更多相关文章
- data structure assignment problem record
Question1: Similar to pause command in linux read -n 1 Question2 read : Illegal option -n 原因为ubuntu ...
- 学习笔记:The Best of MySQL Forum
http://mysql.rjweb.org/bestof.html I have tagged many of the better forum threads. 'Better' is based ...
- Centos 7 mysql Buffered warning: Changed limits: max_connections: 214 解决方法
Everytime I restart MySQL I have this warning: [Warning] Buffered warning: Changed limits: max_conne ...
- Snippet: Fetching results after calling stored procedures using MySQL Connector/Python
https://geert.vanderkelen.org/2014/results-after-procedure-call/ Problem Using MySQL Connector/Pytho ...
- mysql 区间锁 对于没有索引 非唯一索引 唯一索引 各种情况
The locks are normally next-key locks that also block inserts into the "gap" immediately b ...
- 如何将MongoDB数据库的数据迁移到MySQL数据库中
FAQ v2.0终于上线了,断断续续忙了有2个多月.这个项目是我实践的第一个全栈的项目,从需求(后期有产品经理介入)到架构,再到设计(有征询设计师的意见).构建(前端.后台.数据库.服务器部署),也是 ...
- MySQL的my-innodb-heavy-4G.ini配置文件的翻译
我根据MySQL配置文件的英文文档说明,在根据自己所学的知识,使用有道词典对不懂的单词进行了查询,一个一个翻译出来的.有的专业术语翻译的不好,我使用了英文进行标注,例如主机(master)和副机(sl ...
- 【MYSQL】MYSQLの環境構築
ダウンロード:https://dev.mysql.com/downloads/mysql/ 手順① 手順② mysql.iniの設定について [mysql]default-character-set= ...
- MySQL系统变量auto_increment_increment与auto_increment_offset学习总结
在MySQL中,系统变量auto_increment_increment与auto_increment_offset是与自增列相关的两个参数变量.在官方文档中,将其划分为Replication Mas ...
- MySQL高级配置
参考文章:http://www.jb51.net/article/47419.htm https://blog.csdn.net/waneto2008/article/details/52502208 ...
随机推荐
- shell学习之路:shell基础大全1
http://note.youdao.com/share/?id=a9d02257b639c94323c818bc38423919&type=note 别名命令alias:http://n ...
- hdu4982 Goffi and Squary Partition (DFS解法)
BestCoder Round #6 B http://acm.hdu.edu.cn/showproblem.php?pid=4982 Goffi and Squary Partition Time ...
- 使用MVVM框架(avalonJS)进行快速开发
背景 在运营活动开发中,因为工作的重复性很大,同时往往开发时间短,某些情况下也会非常紧急,导致了活动开发时间被大大压缩,同时有些活动逻辑复杂,数据或者状态变更都需要手动渲染,容易出错,正是因为这些问题 ...
- 如何申请https证书、搭建https网站
如何申请https证书.搭建https网站 随着国内搜索引擎巨头百度启用全站https加密服务,全国掀起了网站https加密浪潮.越来越多的站点希望通过部署https证书来解决“第三方”对用户隐私的嗅 ...
- Spring的问题解决记录
问题:在MyEclipse中项目工程重命名以后,例如 原来叫HttpService,改为GameApp,但是项目跑起来发现,tomcat服务器依旧为GameApp目录结构,访问也只能GameApp访问 ...
- Ubuntu 14 安装 Chrome/Chromium flash播放器
在命令终端中执行如下命令即可: sudo apt-get install pepperflashplugin-nonfree sudo update-pepperflashplugin-nonfree ...
- Junit基础整理
项目引进Junit包 对待测试类新建testcase testcase类分为:@RunWith() -----@RunWith(suite.class)测试套件类打包测试 -----@RunWith( ...
- ubutu之jdk安装
1.jdk下载 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2.解压jdk- ...
- Codeforces 260 C. Boredom
题目链接:http://codeforces.com/contest/456/problem/C 解题报告:给出一个序列,然后选择其中的一个数 k 删除,删除的同时要把k - 1和k + 1也删除掉, ...
- [codevs1022]覆盖
[codevs1022]覆盖 试题描述 有一个N×M的单位方格中,其中有些方格是水塘,其他方格是陆地.如果要用1×2的矩阵区覆盖(覆盖过程不容许有任何部分重叠)这个陆地,那么最多可以覆盖多少陆地面积. ...