I am having a stored procedure as follows:
INSERT INTO bakersfun.orderhead
(order_id,order_dt, customer_id, route_id, routenum, ordertype, create_station_id, create_stationtype, create_time,create_user_id,tran_time, tran_user_id,station_id)
values
(nextval('bakersfun.orderhead_order_id_seq'),$1, $2, $3, $4, $5, $6, $7, LOCALTIMESTAMP, $8,
default, default,$9)
returning order_id;
While executing I am getting error as follows:
new.sql:15: ERROR: syntax error at or near "returning"
LINE 15: returning order_id;
PostgreSQL version : PostgreSQL 8.1.23
I noticed it works on PostgreSQL 8.4.20
What is the alternative so it could work on PostgreSQL 8.1.23.