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 ...
随机推荐
- JMS基本概念和模型
------------------------------------------------------------------------------------------- JMS是什么 J ...
- R中的name命名系列函数总结
本文原创,转载请注明出处,本人Q1273314690 R中关于给行列赋名称的函数有 dimnames,names,rowname,colname,row.names 这五个函数,初学的时候往往分不清楚 ...
- 基于C++/Lua的游戏服务器如何实现?
1.首先要自己实现一个网络库,或者选择已经开源的网络库.比如:muduo.libevent.boost的asio等.2.实现核心功能:连接管理,消息管理,定时器,事件机制,Lua脚本引擎,程序模块管理 ...
- 软件测试-----Graph Coverage作业
/******************************************************* * Finds and prints n prime integers * Jeff ...
- 学C++50条建议
1.把C++当成一门新的语言学习(和C没啥关系!真的.): 2.看<Thinking In C++>,不要看<C++变成死相>: 3.看<The C++ Programm ...
- memcache安装
windows下访问 http://pecl.php.net/package/memcache/3.0.8/windows 下载对应版本memcache的dll文件添加到php目录ext下 PHP.i ...
- CSU 1333 Funny Car Racing (最短路)
题目链接: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1333 解题报告:一个图里面有n个点和m条单向边,注意是单向边,然后每条路开a秒关闭b秒 ...
- hiberante学习笔记
1.配置文件(hibernate映射文件): 让hibernate知道该怎么样去load,store持久化对象: 1.1 数据库忌讳的字段名 1) User 2) index 2.数据库表中一对多,多 ...
- flask 链接 url_for()
通常html的文件都放在template里面,那么静态的文件放在哪呢?staitc里面 调用 url_for('static', filename='css/styles.css', _externa ...
- bootstrap框架-----可见 隐藏
可见框架-像素选择 -block-inline :块内联元素 -inline-block将对象呈递为内联对象,但是对象的内容作为块对象呈递.旁边的内联对象会被呈递在同一行内,允许空格 可以设置宽度和 ...