on 07-19-2018 1:27 PM
Hello Colleagues,
I faced here a issue, after a long time of Brushing up my coding skills and looks ugly .
PROCEDURE "HeatSensorWserv"(
SensorID NVARCHAR(250),
Event_Timestamp Timestamp,
RecordedHeat Decimal(6,2),
Current_ERecording DECIMAL(6,2),
Status NVARCHAR(250) )
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
BEGIN
DECLARE Maximum_Heat_Previously_recorded DECIMAL(6,2);
DECLARE Minimum_Heat_previously_recorded DECIMAL(6,2);
/*************************************
Write your procedure logic
*************************************/
select max(RecordedHeat) from "IND_IOT_PRJ.DBMODULE::CLIMRK.HeatSensorModuleMonitor" into :Maximum_Heat_Previously_recorded;
select min(RecordedHeat) from "IND_IOT_PRJ.DBMODULE::CLIMRK.HeatSensorModuleMonitor" into :Minimum_Heat_previously_recorded;
insert into "IND_IOT_PRJ.DBMODULE::CLIMRK.HeatSensorModuleMonitor" values
(:SensorID,:Event_Timestamp,:Minimum_Heat_previously_recorded,:Maximum_Heat_Previously_recorded,:RecordedHeat,:Current_ERecording,:Status);
END
RecordedHeat is a table column
Please help me here,where i am getting it wrong!!
Syntax error: "incorrect syntax near ":Maximum_Heat_Previously_recorded"" [8250009]
at "src/procedure/HeatSensorWserv.hdbprocedure" (1
Last question ? is it possible to pass blob files inside procedure ? i am using a post to post information into procedures that write in to HANA Tables.
Br,
Gabriel.
i can suggest a few things here:
1) the column names will be capitalized if they are not wrapped with double quotes. if you want case sensitive column name, then wrap them in "COL_NAME"
2) blobs are not allowed to be passed between procs - at least not on or before SP12 -- i have attempted that before but did not work for me
3) the error you have here related to incorrect syntax near your column.... I do not see an issue, except for.... if you exclude the column names in the insert statement, sometimes the column names are not on the same order as they appear in a table. this usually happens when the table is altered or its structure changes. See if specifying the column names in the same order they will show in your values ( ) clause solves your issue. Also, make sure the table name is specified correctly - the max(RecordHeat) -- you need to specify the column name instead of the table name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try INTO clause, before FROM clause as shown below.
select max(RecordedHeat) into :Maximum_Heat_Previously_recorded from "IND_IOT_PRJ.DBMODULE::CLIMRK.HeatSensorModuleMonitor";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.