cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA SQL Error Codes 1281,I want to know how to solve it

Former Member
0 Kudos
1,085

here is my procedure

CREATE PROCEDURE SingelRoute1(IN STARTSTOP NVARCHAR(40),

IN ENDSTOP NVARCHAR(40),

OUT OUT_ROUTE ROUTE)

LANGUAGE SQLSCRIPT READS SQL DATA AS

BEGIN

OUT_ROUTE= SELECT DISTINCT

SR1.STOP AS "起始站点",

SR2.STOP AS "目的站点",

SR1.ROUTE AS "乘坐线路",

ABS(SR2.POS-SR1.POS) AS "经过的站点数"

FROM

STOP_ROUTE SR1,

STOP_ROUTE SR2

WHERE

SR1.ROUTE=SR2.ROUTE

AND SR1.STOP=:STARTSTOP

AND SR2.STOP=:ENDSTOP

UNION ALL

SELECT DISTINCT

SR3.STOP AS "起始站点",

SR4.STOP AS "目的站点",

SR3.ROUTE AS "乘坐线路",

ABS(SR4.POS-SR3.POS) AS "经过的站点数"

FROM

DTOP_ROUTE SR3,

DTOP_ROUTE SR4

WHERE

'SR3.ROUTE'='SR4.ROUTE'

AND SR3.STOP=:STARTSTOP

AND SR4.STOP=:ENDSTOP ;

END

and i used following code call the procedure

call "TRAFFIC"."SINGELROUTE"('安美居','任家口');

but i faced a problem with the error code 1281:

Wrong number or types of parameters in call

how should i solve this problem?

i need your help.thanks very much!

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Documentation to the rescue! CALL - SAP HANA SQLScript Reference - SAP Library


CREATE PROCEDURE SingelRoute1(IN STARTSTOP NVARCHAR(40),

IN ENDSTOP NVARCHAR(40),

OUT OUT_ROUTE ROUTE)...

Number of parameters defined: 3 (2 IN, 1 OUT).

call "TRAFFIC"."SINGELROUTE"('安美居','任家口');

Number of parameters provided in call: 2 (2 IN).

Error message says:

Wrong number or types of parameters in call

Solution: provide correct amount of parameters. In this case, add the OUT parameter.

call "TRAFFIC"."SINGELROUTE"('安美居','任家口', ?);

Tataaa!

Answers (0)