Skip to Content
author's profile photo Former Member
Former Member

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

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 05, 2015 at 05:07 AM

    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!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.