pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
UPDATE with database name  alias
9+ messages / 6 participants
[nested] [flat]

* UPDATE with database name  alias
@ 2005-09-19 18:08 andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 9+ messages in thread

From: andres@sayago.info @ 2005-09-19 18:08 UTC (permalink / raw)
  To: pgsql-jdbc

Hello friends.

I'm new in this list, but not in the database world. I have a question and
I need yout colaboration.

I am programming with JDeveloper 10g, and I want to use PostgreSQL
database. I'm using Oracle but I wanna do the migration. But, I have a big
problem: I use PostgreSQL with ADF and ADF uses aliasses for the database
name when it need to do a UPDATE. Example:

UPDATE conference_romms ConferenceRooms
SET ConferenceRooms.room_name = 'Golden'
WHERE ConferenceRooms.room_id = 57;

That sentence fail because the UPDATE clause don't support aliasses.

I'm thinking right? Or I am mistaked.

PostgreSQL don't support database name aliasses for the UPDATE option??

How can I do it??

Thanks,

Andrés Säyago
Bogotá D.C., Colombia



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name  alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
@ 2005-09-19 20:46 ` Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
  0 siblings, 1 reply; 9+ messages in thread

From: Dave Cramer @ 2005-09-19 20:46 UTC (permalink / raw)
  To: andres@sayago.info; +Cc: pgsql-jdbc

Don't use aliases ?

Dave
On 19-Sep-05, at 2:08 PM, andres@sayago.info wrote:

> Hello friends.
>
> I'm new in this list, but not in the database world. I have a  
> question and
> I need yout colaboration.
>
> I am programming with JDeveloper 10g, and I want to use PostgreSQL
> database. I'm using Oracle but I wanna do the migration. But, I  
> have a big
> problem: I use PostgreSQL with ADF and ADF uses aliasses for the  
> database
> name when it need to do a UPDATE. Example:
>
> UPDATE conference_romms ConferenceRooms
> SET ConferenceRooms.room_name = 'Golden'
> WHERE ConferenceRooms.room_id = 57;
>
> That sentence fail because the UPDATE clause don't support aliasses.
>
> I'm thinking right? Or I am mistaked.
>
> PostgreSQL don't support database name aliasses for the UPDATE  
> option??
>
> How can I do it??
>
> Thanks,
>
> Andrés Säyago
> Bogotá D.C., Colombia
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
>




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name  alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
@ 2005-09-19 20:47   ` andres@sayago.info
  2005-09-19 22:46     ` Re: UPDATE with database name  alias Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 9+ messages in thread

From: andres@sayago.info @ 2005-09-19 20:47 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc

It's a perfect idea, but I don't use alias, ADF use them.

With JDeveloper+ADF, ADF is who connect to the database, I dont do it.

JDeveloper use alias to UPDATE, an dthen, what can I do?

PostgreSQL don't use alias to UPATE? Never?

Thanks,

Andrés


> Don't use aliases ?
>
> Dave
> On 19-Sep-05, at 2:08 PM, andres@sayago.info wrote:
>
>> Hello friends.
>>
>> I'm new in this list, but not in the database world. I have a
>> question and
>> I need yout colaboration.
>>
>> I am programming with JDeveloper 10g, and I want to use PostgreSQL
>> database. I'm using Oracle but I wanna do the migration. But, I
>> have a big
>> problem: I use PostgreSQL with ADF and ADF uses aliasses for the
>> database
>> name when it need to do a UPDATE. Example:
>>
>> UPDATE conference_romms ConferenceRooms
>> SET ConferenceRooms.room_name = 'Golden'
>> WHERE ConferenceRooms.room_id = 57;
>>
>> That sentence fail because the UPDATE clause don't support aliasses.
>>
>> I'm thinking right? Or I am mistaked.
>>
>> PostgreSQL don't support database name aliasses for the UPDATE
>> option??
>>
>> How can I do it??
>>
>> Thanks,
>>
>> Andrés Säyago
>> Bogotá D.C., Colombia
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 4: Have you searched our list archives?
>>
>>                http://archives.postgresql.org
>>
>>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name  alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
@ 2005-09-19 22:46     ` Kris Jurka <books@ejurka.com>
  2005-09-19 22:59       ` Re: UPDATE with database name  alias John R Pierce <pierce@hogranch.com>
  2005-09-20 02:53       ` Re: UPDATE with database name alias Tom Lane <tgl@sss.pgh.pa.us>
  2005-09-20 12:57       ` Re: UPDATE with database name  alias Vadim Nasardinov <vadimn@redhat.com>
  0 siblings, 3 replies; 9+ messages in thread

From: Kris Jurka @ 2005-09-19 22:46 UTC (permalink / raw)
  To: andres@sayago.info; +Cc: Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc



On Mon, 19 Sep 2005 andres@sayago.info wrote:

> JDeveloper use alias to UPDATE, an dthen, what can I do?
>

Your only option would be to ajdust the postgresql backend grammar to 
allow an alias.

> PostgreSQL don't use alias to UPATE? Never?
>

Right, the SQL standard does not allow aliases on UPDATEs and neither does 
postgresql.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name  alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
  2005-09-19 22:46     ` Re: UPDATE with database name  alias Kris Jurka <books@ejurka.com>
@ 2005-09-19 22:59       ` John R Pierce <pierce@hogranch.com>
  2 siblings, 0 replies; 9+ messages in thread

From: John R Pierce @ 2005-09-19 22:59 UTC (permalink / raw)
  To: pgsql-jdbc

> Right, the SQL standard does not allow aliases on UPDATEs and neither 
> does postgresql.

amusing aside, a bit of googling (since I didn't know what ADF was) has 
some suit from Oracle Inc.  boasting how ADF works with any "SQL 
Compatible" database.  Last Q&A on this page: 
http://www.itwriting.com/jdev1.php




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
  2005-09-19 22:46     ` Re: UPDATE with database name  alias Kris Jurka <books@ejurka.com>
@ 2005-09-20 02:53       ` Tom Lane <tgl@sss.pgh.pa.us>
  2005-09-20 03:01         ` Re: UPDATE with database name alias Dave Cramer <pg@fastcrypt.com>
  2005-09-20 04:29         ` Re: UPDATE with database name alias John R Pierce <pierce@hogranch.com>
  2 siblings, 2 replies; 9+ messages in thread

From: Tom Lane @ 2005-09-20 02:53 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: andres@sayago.info; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

Kris Jurka <books@ejurka.com> writes:
> On Mon, 19 Sep 2005 andres@sayago.info wrote:
>> JDeveloper use alias to UPDATE, an dthen, what can I do?

> Your only option would be to ajdust the postgresql backend grammar to 
> allow an alias.

Isn't it an option to point out to the JDeveloper authors that they are
emitting SQL that is illegal per spec?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
  2005-09-19 22:46     ` Re: UPDATE with database name  alias Kris Jurka <books@ejurka.com>
  2005-09-20 02:53       ` Re: UPDATE with database name alias Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-09-20 03:01         ` Dave Cramer <pg@fastcrypt.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Dave Cramer @ 2005-09-20 03:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Kris Jurka <books@ejurka.com>; andres@sayago.info; pgsql-jdbc

It's an option, but it's an Oracle product, chances are they would  
ignore it.

Dave
On 19-Sep-05, at 10:53 PM, Tom Lane wrote:

> Kris Jurka <books@ejurka.com> writes:
>
>> On Mon, 19 Sep 2005 andres@sayago.info wrote:
>>
>>> JDeveloper use alias to UPDATE, an dthen, what can I do?
>>>
>
>
>> Your only option would be to ajdust the postgresql backend grammar to
>> allow an alias.
>>
>
> Isn't it an option to point out to the JDeveloper authors that they  
> are
> emitting SQL that is illegal per spec?
>
>             regards, tom lane
>
>




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
  2005-09-19 22:46     ` Re: UPDATE with database name  alias Kris Jurka <books@ejurka.com>
  2005-09-20 02:53       ` Re: UPDATE with database name alias Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-09-20 04:29         ` John R Pierce <pierce@hogranch.com>
  1 sibling, 0 replies; 9+ messages in thread

From: John R Pierce @ 2005-09-20 04:29 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-jdbc

Tom Lane wrote:
> Kris Jurka <books@ejurka.com> writes:
> 
>>On Mon, 19 Sep 2005 andres@sayago.info wrote:
>>
>>>JDeveloper use alias to UPDATE, an dthen, what can I do?
> 
> 
>>Your only option would be to ajdust the postgresql backend grammar to 
>>allow an alias.
> 
> 
> Isn't it an option to point out to the JDeveloper authors that they are
> emitting SQL that is illegal per spec?
> 

JDeveloper and ADF are from Oracle.  you expected something different?



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: UPDATE with database name  alias
  2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
  2005-09-19 20:46 ` Re: UPDATE with database name  alias Dave Cramer <pg@fastcrypt.com>
  2005-09-19 20:47   ` Re: UPDATE with database name  alias andres@sayago.info
  2005-09-19 22:46     ` Re: UPDATE with database name  alias Kris Jurka <books@ejurka.com>
@ 2005-09-20 12:57       ` Vadim Nasardinov <vadimn@redhat.com>
  2 siblings, 0 replies; 9+ messages in thread

From: Vadim Nasardinov @ 2005-09-20 12:57 UTC (permalink / raw)
  To: pgsql-jdbc

On Monday 19 September 2005 18:46, Kris Jurka wrote:
> > JDeveloper use alias to UPDATE, an dthen, what can I do?
> >
> 
> Your only option would be to ajdust the postgresql backend grammar
> to allow an alias.

In practical terms, you're right.

In theory, this may also be addressed by using a wrapper JDBC driver
like P6Spy (but not as buggy) that would sit between the application
and the real PostgreSQL JDBC driver.  The wrapper driver would have
the opportunity to rewrite UPDATE statements in a spec-compliant
manner before passing them on to the real driver.

 http://sourceforge.net/projects/p6spy/
 http://www.google.com/search?q=antlr+SQL+grammar
 http://www.google.com/search?q=JavaCC+SQL+grammar



^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2005-09-20 12:57 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-19 18:08 UPDATE with database name  alias andres@sayago.info
2005-09-19 20:46 ` Dave Cramer <pg@fastcrypt.com>
2005-09-19 20:47   ` andres@sayago.info
2005-09-19 22:46     ` Kris Jurka <books@ejurka.com>
2005-09-19 22:59       ` John R Pierce <pierce@hogranch.com>
2005-09-20 02:53       ` Re: UPDATE with database name alias Tom Lane <tgl@sss.pgh.pa.us>
2005-09-20 03:01         ` Re: UPDATE with database name alias Dave Cramer <pg@fastcrypt.com>
2005-09-20 04:29         ` Re: UPDATE with database name alias John R Pierce <pierce@hogranch.com>
2005-09-20 12:57       ` Vadim Nasardinov <vadimn@redhat.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox