Click here to register.
      
IRC banner


     Discuss > Etcetera

When is a wobject a wobject?

User philadev
Date 3/25/2008 2:23 pm
Views 724
Rating 5    Rate [
|
]
Previous · Next
User Message
philadev

That's a misleading question, kinda.

I'm testing a script against the database and I noticed that my newly added asset (Folder) has no 'description' in the wobject table.  Despite that I added a full description about ten minutes ago.

When is the data that is there end up there? 

I'm running:

SELECT assetData.url, wobject.description, wobject.assetId FROM assetData LEFT JOIN wobject ON assetData.assetId = wobject.assetId WHERE assetData.assetId='XXXX' GROUP BY url 

Anyone have a lead on this? 

--- (Edited on 3/25/2008 2:23 pm [GMT-0500] by philadev) ---



Back to Top
Rate [
|
]
 
 
preaction

You're not taking revisionDate into account. You need to grab the latest revisionDate, not just any random one. 

--- (Edited on 3/25/2008 2:43 pm [GMT-0500] by preaction) ---



Back to Top
Rate [
|
]
 
 
philadev

You are 100% right and in my original sequel I have it testing for the max revisionDate. Still, without max(whatever) i should get all of the rows related to assetId, right?

Unfortunately I'm getting one row and it has no description value. Contrary to the asset's appearance.

 

--- (Edited on 3/25/2008 3:19 pm [GMT-0500] by philadev) ---



Back to Top
Rate [
|
]
 
 
preaction
You have a GROUP BY clause. This causes all the rows to be collapsed based on whatever column you specify (in your case, url).

--- (Edited on 3/25/2008 3:33 pm [GMT-0500] by preaction) ---



Back to Top
Rate [
|
]
 
 
philadev

Correct again. I had to rework the sequel entirely. Thanks for your help.

 

This is what ended up with:

SELECT ad.url, wo.description, ad.assetId, ad.revisionDate 

FROM assetData ad, wobject wo

WHERE ad.assetId='XXX'

AND ad.assetId = wo.assetId 

AND ad.revisionDate = wo.revisionDate 

AND ad.revisionDate=(Select max(revisionDate) 

FROM assetData 

WHERE assetId = ad.assetId) 

 

 

--- (Edited on 3/26/2008 8:17 am [GMT-0500] by philadev) ---



Back to Top
Rate [
|
]
 
 
     Discuss > Etcetera



Recent Discussions Color Key

Design:

Development:

Et Cetera:

Install/Upgrade:  

Smoketest:

Template Group:


MIME::Parser::use_inner_files() by lrobinson - Fri @ 12:04pm

Re: Site paid for by advertizing by pwrightson - Fri @ 10:51am

Re: Site paid for by advertizing by Klaus - Fri @ 02:27am

Smoke Test for WebGUI (Stable) (2008-11-21) by botaction - Fri @ 12:37am

Re: Site paid for by advertizing by pwrightson - Thu @ 10:59am

Re: Site paid for by advertizing by JT - Thu @ 08:58am

Re: Regelmäßiger Termin für Usertreffen in der Rhein-Neckar-Region by Klaus - Thu @ 06:11am

Smoke Test for WebGUI (Stable) (2008-11-20) by botaction - Thu @ 12:00am

Smoke Test for SVN (2008-11-20) by botaction - Thu @ 12:00am

Re: Improving page layouts by fdillon - Wed @ 08:38pm

Re: Improving page layouts by knowmad - Wed @ 08:25pm

Re: Site paid for by advertizing by knowmad - Wed @ 08:07pm

Re: SSL Configuration? by knowmad - Wed @ 07:51pm

Re: The Death of the Collaboration System by preaction - Wed @ 07:39pm