外界如何给TIBQuery传参数,就是我们在窗体接收参数,如何通过TIBQuery传给存储过程
输入参数。然后得到我们想要的查询结果数据。可否把查询数据存入个临时表,要是可以
该如何实现。看看我写的存储过程有什么不合适。
CREATE PROCEDURE GET_PHO_PROP (
PHONEID CHAR(10),
PHONENO CHAR(16),
ZONEID SMALLINT,
LOCATION CHAR(255)
) RETURNS (
PHONE_NO CHAR(16),
INSTALLDATE DATE,
ZONE_ID SMALLINT,
LOCATION1 CHAR(255),
PHONE_ID CHAR(10),
ZONENAME CHAR(255),
P001 CHAR(6),
P002 CHAR(6),
P003 CHAR(6),
P004 CHAR(6),
P005 CHAR(6),
P006 CHAR(6),
P008 CHAR(6),
P009 CHAR(6),
P010 CHAR(6),
P011 CHAR(6),
P013 CHAR(6),
P014 CHAR(6),
P310 CHAR(4),
P311 CHAR(4),
P312 CHAR(4),
P313 CHAR(4),
P314 CHAR(4),
P200 CHAR(2),
P202 CHAR(2),
P203 CHAR(2),
P204 CHAR(2),
P205 CHAR(2),
P206 CHAR(2),
P300 CHAR(10),
P301 CHAR(6),
P302 CHAR(2),
P303 CHAR(2),
P305 CHAR(4),
P306 CHAR(2)
) AS
BEGIN
SELECT phone.PHONENO,phone.INSTALLDATE,phone.ZONEID,phone.LOCATION,phone.PHONEID,zone.ZONENAME,addup.P001,addup.P002,addup.P003,addup.P004,addup.P005,addup.P006,addup.P008,addup.P009,addup.P010,addup.P011,addup.P013,addup.P014,
phone.P310,phone.P311,phone.P312,phone.P313,phone.P314,
phone.p200,phone.p202,phone.p203,phone.p204,phone.p205,phone.p206,phone.P300,phone.P301,phone.P302,phone.P303,phone.P305,phone.P306
FROM phone,zone,addup
WHERE phone.PHONEID=addup.PHONEID
AND phone.ZONEID=zone.ZONEID
AND (phone.phoneid = : phoneid
OR phone.ZONEID = : zoneid
OR phone.PHONENO =
honeno
OR phone.LOCATION = :location)
INTO
HONE_NO,:INSTALLDATE,:ZONE_ID,:LOCATION1,
HONE_ID,:ZONENAME,
001,
002,
003,
004,
005,
006,
008,
009,
010,
011,
013,
014,
310,
311,
312,
313,
314,
200,
202,
203,
204,
205,
206,
300,
301,
302,
303,
305,
306;
SUSPEND;
END