I think, you should read it again
what is : @PROJECT_ID INTEGER ? parameter in/out ?
look at samples :
(IN NUMBER INT, OUT PART_NAME CHAR(35))
------------------------------
Thank for all update/help
Best Regards, Guy Przytula
------------------------------
Original Message:
Sent: Mon May 24, 2021 04:37 AM
From: Narasimha Nannuri
Subject: DB2
I tried this to after reading this document. I wrote a new procedure.
CREATE PROCEDURE GetCarsByMake
@PROJECT_ID INTEGER
AS
BEGIN
SELECT *
FROM DONATES
WHERE PROJECT_ID = @PROJECT_ID
END
GO
Getting the below error.
QUERY: CREATE PROCEDURE GetCarsByMake @PROJECT_ID INTEGER AS BEGIN SELECT * FROM DONATES WHERE PROJECT_ID = @PROJECT_ID END GO ;
Error: [IBM][CLI Driver][DB2/NT64] SQL0104N An unexpected token "@PROJECT_ID INTEGER AS" was found following "DURE GetCarsByMake ". Expected tokens may include: "<space>". LINE NUMBER=3. SQLSTATE=42601</space>Number of Rows returned: undefined.
But thanks allot for your reply .
I am running in the visual studio code .after database sucess
view -> command Platte... -> DB2: Execute current sql file -> It its opening a box "Enter delimeter for SQL in the selected file". I am not entering any thing in the delimeter directly clk enter. I am getting the error.
------------------------------
Narasimha Nannuri
Original Message:
Sent: Mon May 24, 2021 04:13 AM
From: Guy Przytula
Subject: DB2
reading the doc is to first step if you have never created a proc
https://www.ibm.com/docs/en/db2/11.5?topic=statements-create-procedure-sql
CREATE PROCEDURE fetech
LANGUAGE SQL
BEGIN
declare tt date ;
SELECT current date into tt from sysibm.sysdummy1 ;
end@
DB20000I The SQL command completed successfully
------------------------------
Thank for all update/help
Best Regards, Guy Przytula
Original Message:
Sent: Mon May 24, 2021 03:50 AM
From: Narasimha Nannuri
Subject: DB2
Hi Guy,
Very thanks to response. I tried this too
CREATE PROCEDURE fetech()
LANGUAGE SQL
BEGIN
SELECT ID FROM DONATES;
END@
But getting the below error.
CREATE PROCEDURE fetech() LANGUAGE SQL BEGIN SELECT ID FROM DONATES ;
Error: [IBM][CLI Driver][DB2/NT64] SQL0104N An unexpected token "SELECT ID" was found following "ANGUAGE SQL BEGIN ". Expected tokens may include: "<space>". LINE NUMBER=4. SQLSTATE=42601
END@ ;
Error: [IBM][CLI Driver][DB2/NT64] SQL0104N An unexpected token "END-OF-STATEMENT" was found following "END@". Expected tokens may include: "JOIN
<joined_table>". SQLSTATE=42601</joined_table></space>
------------------------------
Narasimha Nannuri
Original Message:
Sent: Mon May 24, 2021 01:57 AM
From: Guy Przytula
Subject: DB2
the delimiter is used twice
after the END put another character like @ and change in VS the default delimiter
------------------------------
Thank for all update/help
Best Regards, Guy Przytula
Original Message:
Sent: Fri May 21, 2021 10:48 AM
From: Narasimha Nannuri
Subject: DB2
Hi ,
When i try to communicate with DB2 data base by using the procedure in the visual studio.
I am getting the below error.
Error: [IBM][CLI Driver][DB2/NT64] SQL0104N An unexpected token "DONATES" was found following "LECT * FROM XY87172.". Expected tokens may include: "END". LINE NUMBER=4. SQLSTATE=42601
I run by goin through the view command platte...
I installed db2 extension in the visual studio.
CREATE PROCEDURE fetech
LANGUAGE SQL
BEGIN
SELECT * FROM XY87172.DONATES;
END;
------------------------------
Narasimha Nannuri
------------------------------
#Db2