| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | Blake McBride <blake1024(at)gmail(dot)com> |
| Cc: | Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, pgsql-jdbc(at)lists(dot)postgresql(dot)org |
| Subject: | Re: JDBC: ERROR: portal "C_2" does not exist |
| Date: | 2022-03-12 05:15:51 |
| Message-ID: | CAKFQuwYh56uwTpaPSf_Jp-_Kz9+vRbwBHVcHpHDJ=cVM20nTkQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
On Fri, Mar 11, 2022 at 8:47 PM Blake McBride <blake1024(at)gmail(dot)com> wrote:
>
> conn.setAutoCommit(false)
> PreparedStatement pstat = conn.prepareStatement(sql)
> pstat.setFetchSize(50)
> select all records in a large file
> for each record:
> read one field from the record
> through a second statement, add a record to a different table - XXX
> execute the second statement - YYY
> commit the change - ZZZ
> loop
>
> It seems I can do one or the other but not both - or can I?
>
>
Correct. What you are trying to do requires that you open two sessions to
the database (conn_read, conn_write) and execute the INSERT command on the
conn_write connection while looping through data on the conn_read one.
David J.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Blake McBride | 2022-03-13 19:39:59 | Re: JDBC: ERROR: portal "C_2" does not exist |
| Previous Message | Blake McBride | 2022-03-12 03:47:38 | Re: JDBC: ERROR: portal "C_2" does not exist |