drop procedure if exists p_hello_world;

create procedure p_hello_world()
begin
declare v_number int;
declare v_varchar varchar(32);
set v_number = 1;
set v_varchar = 'hello world'; -- for debug
select v_number;
select v_varchar;
end; call p_hello_world();

drop procedure if exists p_hello_world;

create procedure p_hello_world()
begin
    declare v_number int;
    declare v_varchar varchar(32);
    set v_number = 1;
    set v_varchar = 'hello world';

-- for debug
    select v_number;
    select v_varchar;
end;

call p_hello_world();

MySQL PLSQL Demo - 002.变量定义、赋值的更多相关文章

  1. Mysql储存过程2:变量定义与参数传递

    #储存过程 中的变量定义 declare 变量名 类型 可选类型 -- 跟建表差不多 create procedure p() begin ); ; select age+number; end$ / ...

  2. MySql 和SQLServer 申明变量以及赋值

    sql server中变量要先申明后赋值: 局部变量用一个@标识,全局变量用两个@(常用的全局变量一般都是已经定义好的): 申明局部变量语法:declare @变量名 数据类型:例如:declare ...

  3. 【MySQL】MySQL PLSQL Demo - 006.循环(WHILE DO and FOR LOOP)

    WHILE DO drop procedure if exists p_while_do; create procedure p_while_do() begin declare i int; ; d ...

  4. MySQL PLSQL Demo - 005.IF THEN ELSEIF THEN ELSE END IF

    drop procedure if exists p_hello_world; create procedure p_hello_world(in v_id int) begin ) then sel ...

  5. MySQL PLSQL Demo - 003.静态游标

    drop procedure if exists p_hello_world; create procedure p_hello_world() begin declare id integer; ) ...

  6. MySQL PLSQL Demo - 001.创建、调用、删除过程

    drop procedure if exists p_hello_world; create procedure p_hello_world() begin select sysdate(); end ...

  7. SQlServer 变量定义 赋值

    declare @id int declare @name char(10) ;注意:char(10)为10位,要是位数小了会让数据出错 set @id=1 select @id=1 select @ ...

  8. python基础学习1-变量定义赋值,屏幕输入输出

    一.变量定义赋值 输入输出屏幕显示 : name = input("input is your name") age =int( input("input is your ...

  9. MySQL中变量的定义和变量的赋值使用(转)

    说明:现在市面上定义变量的教程和书籍基本都放在存储过程上说明,但是存储过程上变量只能作用于begin...end块中,而普通的变量定义和使用都说的比较少,针对此类问题只能在官方文档中才能找到讲解. 前 ...

随机推荐

  1. filezilla

    中文网站:https://www.filezilla.cn/ 英文网站:https://filezilla-project.org/ FileZilla 客户端是一个快速可靠的.跨平台的FTP,FTP ...

  2. PC端模拟移动端访问 字体大小限制

    审查元素(F12),调整为移动端,如下图所示: 在字体大小小于12px时,font-size就不起作用了. 在真实移动端设备上是起作用的.

  3. tensorflow serving 打印调试log

    启动时添加环境变量 export TF_CPP_MIN_VLOG_LEVEL=1 ,这样可以打印VLOG(1)的log

  4. google打不开解决的方法

    14.5.27以来.谷歌又打不开了. 从网上找了些国内的googleserverIP,例如以下: const char* g_google_ips[18] = { "203.208.48.1 ...

  5. phpCAS library

    The phpCAS library provides a simple API for authenticating users against a CAS server. phpCAS is co ...

  6. js hasChildNodes()指针对元素节点子节点多个的话 true

    <select multiple size="2"> <option value="bj">北京</option> < ...

  7. bootstrap Validators

    地址:http://reactiveraven.github.io/jqBootstrapValidation/

  8. Android 应用开发者必看的 9 个 Tips

    去年,Android应用数量已经超过iOS成为全球最大的生态系统,不过在这多大百万的应用中,有些应用的下载量很大,赚的盆满钵满:另外一些应用就石沉大海.无人问津了. 拥有多年程序开发经验,最近在开发A ...

  9. MySQL 获取子分类ID的所有父分类ID和Name的集合

    CREATE DEFINER=`sa`@`%` PROCEDURE `proc_Product_leimu_ParentIds`( IN pID INT ) BEGIN ) vars, product ...

  10. js LINQ教程

    在说LINQ之前必须先说说几个重要的C#语言特性 一:与LINQ有关的语言特性 1.隐式类型 (1)源起 在隐式类型出现之前, 我们在声明一个变量的时候, 总是要为一个变量指定他的类型 甚至在fore ...