#!/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的更多相关文章

  1. data structure assignment problem record

    Question1: Similar to pause command in linux read -n 1 Question2 read : Illegal option -n 原因为ubuntu ...

  2. 学习笔记:The Best of MySQL Forum

    http://mysql.rjweb.org/bestof.html I have tagged many of the better forum threads. 'Better' is based ...

  3. 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 ...

  4. 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 ...

  5. mysql 区间锁 对于没有索引 非唯一索引 唯一索引 各种情况

    The locks are normally next-key locks that also block inserts into the "gap" immediately b ...

  6. 如何将MongoDB数据库的数据迁移到MySQL数据库中

    FAQ v2.0终于上线了,断断续续忙了有2个多月.这个项目是我实践的第一个全栈的项目,从需求(后期有产品经理介入)到架构,再到设计(有征询设计师的意见).构建(前端.后台.数据库.服务器部署),也是 ...

  7. MySQL的my-innodb-heavy-4G.ini配置文件的翻译

    我根据MySQL配置文件的英文文档说明,在根据自己所学的知识,使用有道词典对不懂的单词进行了查询,一个一个翻译出来的.有的专业术语翻译的不好,我使用了英文进行标注,例如主机(master)和副机(sl ...

  8. 【MYSQL】MYSQLの環境構築

    ダウンロード:https://dev.mysql.com/downloads/mysql/ 手順① 手順② mysql.iniの設定について [mysql]default-character-set= ...

  9. MySQL系统变量auto_increment_increment与auto_increment_offset学习总结

    在MySQL中,系统变量auto_increment_increment与auto_increment_offset是与自增列相关的两个参数变量.在官方文档中,将其划分为Replication Mas ...

  10. MySQL高级配置

    参考文章:http://www.jb51.net/article/47419.htm https://blog.csdn.net/waneto2008/article/details/52502208 ...

随机推荐

  1. nginx下面server配置

    haomeiv配置 log_format www.haomeiv.com '$remote_addr - $remote_user [$time_local] "$request" ...

  2. Markdown 写作工具选择

    Markdown 写作工具选择 候选产品 参考了少数派网站 markdown 写作工具2015年度盘点 http://sspai.com/32483, Windows 下 Markdown 的编辑工具 ...

  3. [译]git clone

    git clone git clone命令copy一个已经存在的Git仓储. git clone有点像svn的checkout, 他的不同之处是这个copy也是一个完整的仓储-它有自己的历史纪录, 能 ...

  4. Request 传值 遇到的中文乱码问题

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="xxxx.aspx.cs&quo ...

  5. C++ Const引用详解

    (1)       在实际的程序中,引用主要被用做函数的形式参数--通常将类对象传递给一个函数.引用必须初始化. 但是用对象的地址初始化引用是错误的,我们可以定义一个指针引用. 1 int ival ...

  6. UESTC 1852 Traveling Cellsperson

    找规律水题... Traveling Cellsperson Time Limit: 1000ms Memory Limit: 65535KB This problem will be judged ...

  7. Jcrop+uploadify+php实现上传头像预览裁剪

    最近由于项目需要,所以做了一个上传头像预览并且可以预览裁剪的功能,大概思路是上传的图片先保存到服务器,然后通过ajax从服务器获取到图片信息,再利用Jcrop插件进行裁剪,之后通过PHP获取到的四个裁 ...

  8. PHP读取word文档

    在PHP中读取和写入WORD文档的代码 <? php // 建立一个指向新COM组件的索引 $word = new COM(”word.application”) or die(”Can't s ...

  9. 给Storyboard设置初始页面(Initial Controller)

    原文:https://developer.apple.com/library/ios/recipes/xcode_help-IB_storyboard/Chapters/SetInitialContr ...

  10. BZOJ4610——[Wf2016]Ceiling Functi

    水题一道,不是很懂为啥没人做... 1.题意:纠正一下..bzoj的题意不是很对...注意不是堆,是不平衡的二叉树,就是非旋转的treap, 另外...插入的时候,小于插在左边..大于等于插在右边 2 ...