xml地图|网站地图|网站标签 [设为首页] [加入收藏]
MySQL: LEAVE Statement
分类:数据库

SQL 对大小写不灵动!

尽管使用sqlserver去调用服务接口的境况比少之又少,但也足以去掌握下相应的施用情状

 

数量操作语言 (DML卡塔尔(قطر‎:

意气风发、首先要开启组件的配置

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ole Automation Procedures';
GO

 

This MySQL tutorial explains how to use the LEAVE statement in MySQL with syntax and examples.

select - 从数据库表中获取数据

二、调用webservice

Description

In MySQL, the LEAVE statement is used when you want to exit a block of code identified by a label_name, such as a LOOP statement, WHILE statement, or REPEAT statement.

update - 更新数据库表中的多少

1、接口新闻拿到

调用webservice的时候建议接受fiddler去赢得一下发送数据进程用contenttype的项目以致调用接口的多少

图片 1

图片 2

Syntax

The syntax for the LEAVE statement in MySQL is:

LEAVE label_name;

delete - 从数据库表中删除数据

2、使用sqlserver调用对应的接口以至结果

declare @ServiceUrl as varchar(1000) 
set @ServiceUrl = 'http://localhost:19930/LoginWebService.asmx/Login'
DECLARE @data varchar(max);
set @data='username=8&password=7'                  

Declare @Object as Int
Declare @ResponseText AS  varchar(1000)   ;      
Exec sp_OACreate 'Msxml2.ServerXMLHTTP.3.0', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'POST',@ServiceUrl,'false'
Exec sp_OAMethod @Object, 'setRequestHeader', NULL, 'Content-Type','application/x-www-form-urlencoded'
Exec sp_OAMethod @Object, 'send', NULL, @data --发送数据
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
EXEC sp_OAGetErrorInfo @Object --异常输出
Select  @ResponseText 
Exec sp_OADestroy @Object
GO

图片 3

Parameters or Arguments

label_name
The name of the block of code (ie: LOOP, WHILE, REPEAT) to terminate.

insert into - 向数据库表中插入数据

三、调用webapi

 两个调用的主意基本如出风姿洒脱辙

Note

  • You use the LEAVE statement to terminate a block of code, such as a LOOP statement, WHILE statement, or REPEAT statement that is identified by a label_name.

数量定义语言 (DDL卡塔尔:

1、接口音信获取

相符接纳fiddler获取接口调用消息(因为该接口是GET就无需看所传的参数)

图片 4

Example

Let's look at an example that shows how to use the LEAVE statement in MySQL:

DELIMITER //

CREATE FUNCTION CalcIncome ( starting_value INT )
RETURNS INT

BEGIN

   DECLARE income INT;

   SET income = 0;

   label1: LOOP
     SET income = income + starting_value;
     IF income < 3000 THEN
       ITERATE label1;
     END IF;
     LEAVE label1;
   END LOOP label1;

   RETURN income;

END; //

DELIMITER ;

In this LEAVE example, we have created a loop called label1 using the LOOP statement.

The ITERATE statement would cause the loop to repeat while income is less than 3000. Once income is greater than or equal to 3000, the LEAVE statement would terminate the LOOP.

create database - 创设新数据库

2、接口调用以至结果

GET操作

declare @ServiceUrl as varchar(1000) 
set @ServiceUrl = 'http://xxxxx.com/beijing/139/1000000/TaxInfo?token=6d83d2adcff64594bd68614b6ae9e1c8'
DECLARE @data varchar(max);
set @data=''                  

Declare @Object as Int
Declare @ResponseText AS  varchar(8000)   ;      
Exec sp_OACreate 'Msxml2.ServerXMLHTTP.3.0', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'GET',@ServiceUrl,'false'
Exec sp_OAMethod @Object, 'send', NULL, @data --发送数据
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
EXEC sp_OAGetErrorInfo @Object --异常输出
Select  @ResponseText 
Exec sp_OADestroy @Object
GO

 图片 5

POST操作

declare @ServiceUrl as varchar(1000) 
set @ServiceUrl = 'http://xxxx.com/Feedback/Estimate'
DECLARE @data varchar(max);
--发送数据
set @data='CityName=SubmitSystemName=%E7%99%BE%E5%BA%A6%E5%8F%8D%E9%A6%88&OriginID=2d90660c-436c-4e12-bfa6-e849a06b2c51&Price=10000&IsAccurate=False&PriceType=1&UserKeyId=a669e4ec7bdc47a7b6c2c334ebe1a50c&signature=X8p3lIZT0Ba3LeiC6irm3%2FMnlE8%3D&time=1452735047291'                   

Declare @Object as Int
Declare @ResponseText AS  varchar(8000)   ;      
Exec sp_OACreate 'Msxml2.ServerXMLHTTP.3.0', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'POST',@ServiceUrl,'false'
Exec sp_OAMethod @Object, 'setRequestHeader', NULL, 'Content-Type','application/x-www-form-urlencoded'
Exec sp_OAMethod @Object, 'send', NULL, @data --发送数据
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
EXEC sp_OAGetErrorInfo @Object --异常输出
Select  @ResponseText 
Exec sp_OADestroy @Object
GO

  图片 6

 

alter database - 改善数据库

create table - 成立新表

alter table - 改造(改换)数据库表

drop table - 删除表

create index - 创制索引(搜索键)

deop index - 删除索引

 查

select 列名称,列名称 from 表名称

提示:星号(*)是选项全部列的飞速情势。

distinct 重回独一不相同的值:select distinct  列名称 from 表名称

where(有法规地从表中甄选数据卡塔尔(英语:State of Qatar):select  列名称 from 表名称 where 列 运算符 值(用单引号来围绕文本值,数值不选择引号卡塔尔

操作符 = <>(!=) > < >= <= between link
描述 等于 不等于 大于 小于 大于等于 小于等于 在某个范围内 搜索某种模式

 

本文由澳门新葡亰手机版发布于数据库,转载请注明出处:MySQL: LEAVE Statement

上一篇:如何在没有域的环境中搭建AlwaysOn,及索引视图与 下一篇:没有了
猜你喜欢
热门排行
精彩图文