主题:[讨论]急求 delphi 中sql存储过程的调用 代码
delphi存储过程如何调用
Alter Procedure GETPATH
@startname1 varchar(50),
@startname2 varchar(50)
As
Declare @next_EQUIPMENT_ID varchar(50)
Declare @next_EQUIPMENT_PORT varchar(50) --使用的中间变量,用于比较
Declare @searchname1 varchar(50)
Declare @searchname2 varchar(50) --使用的中间变量,用于查询
Select @next_EQUIPMENT_ID = @startname1
Select @next_EQUIPMENT_PORT = @startname2
-- 使用此语句创建一个结果存储表
IF EXISTS (SELECT * FROM sysobjects
WHERE name = 'result1' AND type = 'U')
DROP TABLE result1
Create Table result1
(
EQUIPMENT_ID varchar(50),
EQUIPMENT_PORT varchar(50)
)
While (@next_EQUIPMENT_ID is not NULL and @next_EQUIPMENT_PORT is Not NULL)
Begin
Insert into result1 values(@next_EQUIPMENT_ID, @next_EQUIPMENT_PORT)
Select @searchname1 = RTrim([END EQUIPMEENT_ID]) , @searchname2 = Rtrim(PHYSICS_END)
From equipment_connect
Where Rtrim(EQUIPMENT_ID) = @next_EQUIPMENT_ID and Rtrim(EQUIPMENT_PORT) = @next_EQUIPMENT_PORT
if(@next_EQUIPMENT_ID = @searchname1 and @next_EQUIPMENT_PORT = @searchname2)
Begin
Break
End
Set @next_EQUIPMENT_ID = @searchname1
Set @next_EQUIPMENT_PORT = @searchname2
if(@next_EQUIPMENT_ID = @startname1 and @next_EQUIPMENT_PORT = @startname2)
Break
if (@next_EQUIPMENT_ID is NULL or @next_EQUIPMENT_PORT Is NULL)
Begin
Break
End
end
Select * From Result1
想求救下 这个 存储过程在delphi中 如何调用
是有返回值的
不甚感激
Alter Procedure GETPATH
@startname1 varchar(50),
@startname2 varchar(50)
As
Declare @next_EQUIPMENT_ID varchar(50)
Declare @next_EQUIPMENT_PORT varchar(50) --使用的中间变量,用于比较
Declare @searchname1 varchar(50)
Declare @searchname2 varchar(50) --使用的中间变量,用于查询
Select @next_EQUIPMENT_ID = @startname1
Select @next_EQUIPMENT_PORT = @startname2
-- 使用此语句创建一个结果存储表
IF EXISTS (SELECT * FROM sysobjects
WHERE name = 'result1' AND type = 'U')
DROP TABLE result1
Create Table result1
(
EQUIPMENT_ID varchar(50),
EQUIPMENT_PORT varchar(50)
)
While (@next_EQUIPMENT_ID is not NULL and @next_EQUIPMENT_PORT is Not NULL)
Begin
Insert into result1 values(@next_EQUIPMENT_ID, @next_EQUIPMENT_PORT)
Select @searchname1 = RTrim([END EQUIPMEENT_ID]) , @searchname2 = Rtrim(PHYSICS_END)
From equipment_connect
Where Rtrim(EQUIPMENT_ID) = @next_EQUIPMENT_ID and Rtrim(EQUIPMENT_PORT) = @next_EQUIPMENT_PORT
if(@next_EQUIPMENT_ID = @searchname1 and @next_EQUIPMENT_PORT = @searchname2)
Begin
Break
End
Set @next_EQUIPMENT_ID = @searchname1
Set @next_EQUIPMENT_PORT = @searchname2
if(@next_EQUIPMENT_ID = @startname1 and @next_EQUIPMENT_PORT = @startname2)
Break
if (@next_EQUIPMENT_ID is NULL or @next_EQUIPMENT_PORT Is NULL)
Begin
Break
End
end
Select * From Result1
想求救下 这个 存储过程在delphi中 如何调用
是有返回值的
不甚感激