Re: Error in Update and Set statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Sachin Srivastava <ssr(dot)teleatlas(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error in Update and Set statement
Date: 2016-01-20 10:41:48
Message-ID: CAFj8pRBpC0er74wTNoSd24RcT+L19CH4hLf5UbRT0_rpuo0zUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

2016-01-20 11:36 GMT+01:00 Sachin Srivastava <ssr(dot)teleatlas(at)gmail(dot)com>:

> Dear Folks,
>
> How to handle the below error, please suggest. I have migrated my database
> from oracle to postgres through Ora2PG then I am getting this error for
> function.
>
> If I am writing the code for every column which are within set (column
> name1, column name2, etc) then it's running successfully but if there are
> so many columns with set then how can I handle this because in below code
> there are 7 column with set statement and we have to write very big code
> for this. Please suggest how to handle this situation.
>
>
>
> ERROR: syntax error at or near "SELECT"
> LINE 2: ...LEAD_TIME,ITEM_NUMBER,ORDER_UOM_CODE,ORDER_QTY) =(SELECT LIN...
> ^
> ********** Error **********
>
>
> ERROR: syntax error at or near "SELECT"
> SQL state: 42601
> Character: 123
>
> Code as below:
>
> -------------------------------
>
> update ppo_master_detail set (LINE_STATUS,LINE_TYPE,PROMISE_DATE,
> LEAD_TIME,ITEM_NUMBER,ORDER_UOM_CODE,ORDER_QTY) =(SELECT LINE_STATUS,
>
> LINE_TYPE,PROMISE_DATE,LEAD_TIME,ITEM_NUMBER,ORDER_UOM_CODE,ORDER_QTY
> from ppo_master_detail where subscriber_id = 65 and
> row_number=supplierdetail.row_number
> and po_number=supplierdetail.po_number and
> company_id=supplierdetail.company_id )
> where po_number =PONum.po_number and company_id=PONum.company_id and
> subscriber_id = 65 and row_number=supplierdetail.row_number;
> --iRowCounter:=iRowCounter+1;
>
>
This Oracle's syntax is supported from 9.5.

Regards

Pavel

> --------------------------------------------
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sachin Srivastava 2016-01-20 10:45:31 Re: Error in Update and Set statement
Previous Message Nikhil 2016-01-20 10:41:00 BDR with postgres 9.5