Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Help me write subquery in update query
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
mich  
View profile   Translate to Translated (View Original)
 More options 3 July, 20:58
From: mich <michaile...@gmail.com>
Date: Fri, 3 Jul 2009 12:58:30 -0700 (PDT)
Local: Fri 3 July 2009 20:58
Subject: Help me write subquery in update query
I want to execute such sql:

update blog_entry set comment_number = (select count(*) from
blog_comment where blog_comment.root = blog_entry.id)

How I can write such query in DQL? I tried:

        $q = Doctrine_Query::create()
            ->update('Blog_Entry Entry')
            ->set('Entry.comment_number', '(SELECT COUNT(Comment.id)
FROM Entry.Blog_Comment Comment WHERE Comment.root = Entry.id)')
            ->execute()
        ;

but it throws exception "Unknown component alias Comment".


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mich  
View profile   Translate to Translated (View Original)
 More options 6 July, 08:23
From: mich <michaile...@gmail.com>
Date: Mon, 6 Jul 2009 00:23:23 -0700 (PDT)
Local: Mon 6 July 2009 08:23
Subject: Re: Help me write subquery in update query
Anyone? What am I doing wrong?

On 3 июл, 22:58, mich <michaile...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
DerekP  
View profile   Translate to Translated (View Original)
 More options 7 July, 03:37
From: DerekP <derekrobertpr...@gmail.com>
Date: Mon, 6 Jul 2009 19:37:31 -0700 (PDT)
Local: Tues 7 July 2009 03:37
Subject: Re: Help me write subquery in update query
http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctr...
only report subquery support in FROM, SELECT, and WHERE statements.
Maybe it just plain doesn't work in SET, yet?

Derek

On Jul 6, 3:23 am, mich <michaile...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mich  
View profile   Translate to Translated (View Original)
 More options 7 July, 13:16
From: mich <michaile...@gmail.com>
Date: Tue, 7 Jul 2009 05:16:52 -0700 (PDT)
Local: Tues 7 July 2009 13:16
Subject: Re: Help me write subquery in update query
May be, I thought there are some core developers who have to know
this :)

Anyway, parseDqlQuery does it for me, but I can not find any
documentation about this method except API. I tried online docs, but
actually there is no good search. And PDF version is not avaiable (I
tried http://www.doctrine-project.org/documentation/manual/1_1/en/pdf
) . Can someone give me link to parseDqlQuery documentation or it's
prefered to use Doctrine_RawSql instead?

On 7 июл, 05:37, DerekP <derekrobertpr...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google