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 ...
随机推荐
- LAMP环境CentOS6.4 PHP5.4随笔未整理
首先安装一些辅助的软件或者说是依赖的关系包. 1.安装libxml2: libxml是一个用来解析XML文档的函数库.它用C语言写成, 并且能为多种语言所调用,例如C语言,C++,XSH.C#, Py ...
- 江湖救急:webbrowser中js文件丢失问题~
页面中,有一个按钮,点击按钮通过js create 了一个 script标签 ,链接加载一个外部js文件,执行该js文件 $("#a").click(function(){ $.g ...
- Google Protocol Buffer 简单介绍
以下内容主要整理自官方文档. 为什么使用 Protocol Buffers .proto文件 Protocol Buffers 语法 编译.proto文件 Protocol Buffers API 枚 ...
- 关联规则之Aprior算法(购物篮分析)
0.支持度与置信度 <mahout实战>与<机器学习实战>一起该买的记录数占所有商品记录总数的比例——支持度(整体) 买了<mahout实战>与<机器学习实战 ...
- N-Queens leetcode
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens ...
- MySQL Python教程(4)
Class cursor.MySQLCursorBuffered 该类从Class cursor.MySQLCursorBuffered继承,如果需要,可以在执行完SQL语句后自动缓冲结果集合.imp ...
- 9 patch png 的上下左右
9 patch png 的上下左右 前言: 9 patch png 图片,扩展名为.9.png,是一个标准的PNG图像,它包括额外的1个像素的边界,通过对这个边界的描述来达到我们预期的拉伸效果.a ...
- 如何用C语言编写病毒‘
怎样用C语言编写病毒在分析病毒机理的基础上,用C语言写了一个小病毒作为实例,用TURBOC2.0实现.[Abstract] This paper introduce the charateristic ...
- dp水题 序列问题 (9道)
9道题.A了8道,A题看题解也没弄懂怎么维护m段子序列的,过一段时间再回来看看 dp试水 47:56:23 125:00:00 Overview Problem Status Rank ( ...
- EXTJS 动态改变Gird 列值
var me = this.getView('EditProProductQrcodePanel'); var grid = me.down("[name=mallQrcodeGrid] ...