1. <small id='i5Hzt'></small><noframes id='i5Hzt'>

      2. <tfoot id='i5Hzt'></tfoot>
        <i id='i5Hzt'><tr id='i5Hzt'><dt id='i5Hzt'><q id='i5Hzt'><span id='i5Hzt'><b id='i5Hzt'><form id='i5Hzt'><ins id='i5Hzt'></ins><ul id='i5Hzt'></ul><sub id='i5Hzt'></sub></form><legend id='i5Hzt'></legend><bdo id='i5Hzt'><pre id='i5Hzt'><center id='i5Hzt'></center></pre></bdo></b><th id='i5Hzt'></th></span></q></dt></tr></i><div id='i5Hzt'><tfoot id='i5Hzt'></tfoot><dl id='i5Hzt'><fieldset id='i5Hzt'></fieldset></dl></div>

        <legend id='i5Hzt'><style id='i5Hzt'><dir id='i5Hzt'><q id='i5Hzt'></q></dir></style></legend>
        • <bdo id='i5Hzt'></bdo><ul id='i5Hzt'></ul>

        将参数传递给 MySQL 脚本命令行

        Pass parameter to MySQL script command line(将参数传递给 MySQL 脚本命令行)

            <bdo id='SoUJ3'></bdo><ul id='SoUJ3'></ul>
                  <tbody id='SoUJ3'></tbody>

                <small id='SoUJ3'></small><noframes id='SoUJ3'>

                <i id='SoUJ3'><tr id='SoUJ3'><dt id='SoUJ3'><q id='SoUJ3'><span id='SoUJ3'><b id='SoUJ3'><form id='SoUJ3'><ins id='SoUJ3'></ins><ul id='SoUJ3'></ul><sub id='SoUJ3'></sub></form><legend id='SoUJ3'></legend><bdo id='SoUJ3'><pre id='SoUJ3'><center id='SoUJ3'></center></pre></bdo></b><th id='SoUJ3'></th></span></q></dt></tr></i><div id='SoUJ3'><tfoot id='SoUJ3'></tfoot><dl id='SoUJ3'><fieldset id='SoUJ3'></fieldset></dl></div>
              1. <tfoot id='SoUJ3'></tfoot>
                <legend id='SoUJ3'><style id='SoUJ3'><dir id='SoUJ3'><q id='SoUJ3'></q></dir></style></legend>
                • 本文介绍了将参数传递给 MySQL 脚本命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  是否有任何选项可以将参数从命令行传递到 MySQL 脚本?

                  Is there any option to pass a parameter from the command line to MySQL script?

                  在这个例子中类似于@start_date:

                  Something like @start_date in this example:

                  mysql –uuser_id -ppassword –h mysql-host -A -e 
                  "set @start_date=${start_date}; source ${sql_script};" >${data_file};
                  

                  推荐答案

                  在网上找到了答案 此处.

                  基本上,假设我们要运行这个查询:

                  Basically, suppose that we want to run this query:

                  Select c_id, c_first_name,c_last_name, c_address,last_modified_date
                  from customer
                  where last_modified_date >=@start_date and last_modified_date <= @end_date;
                  

                  我们可以像这样传递 'start_date' 和 'end_date':

                  We can pass 'start_date' and 'end_date' like this:

                  /usr/bin/mysql –uuser_id -ppassword –h mysql-host -A \
                      -e "set @start_date=${start_date}; set @end_date=${end_date};\
                          source ${sql_script};" > ${data_file}
                  

                  这篇关于将参数传递给 MySQL 脚本命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Can#39;t Create Entity Data Model - using MySql and EF6(无法创建实体数据模型 - 使用 MySql 和 EF6)
                  MySQL select with CONCAT condition(MySQL选择与CONCAT条件)
                  Capitalize first letter of each word, in existing table(将现有表格中每个单词的首字母大写)
                  How to retrieve SQL result column value using column name in Python?(如何在 Python 中使用列名检索 SQL 结果列值?)
                  Update row with data from another row in the same table(使用同一表中另一行的数据更新行)
                  Exporting results of a Mysql query to excel?(将 Mysql 查询的结果导出到 excel?)

                        <tbody id='tHebj'></tbody>

                        <bdo id='tHebj'></bdo><ul id='tHebj'></ul>
                        • <tfoot id='tHebj'></tfoot>

                            <i id='tHebj'><tr id='tHebj'><dt id='tHebj'><q id='tHebj'><span id='tHebj'><b id='tHebj'><form id='tHebj'><ins id='tHebj'></ins><ul id='tHebj'></ul><sub id='tHebj'></sub></form><legend id='tHebj'></legend><bdo id='tHebj'><pre id='tHebj'><center id='tHebj'></center></pre></bdo></b><th id='tHebj'></th></span></q></dt></tr></i><div id='tHebj'><tfoot id='tHebj'></tfoot><dl id='tHebj'><fieldset id='tHebj'></fieldset></dl></div>

                            <small id='tHebj'></small><noframes id='tHebj'>

                            <legend id='tHebj'><style id='tHebj'><dir id='tHebj'><q id='tHebj'></q></dir></style></legend>