lft and rgt colum null

Post Reply
thenetstriker
Posts: 54
Joined: 05 Jul 10 19:24

lft and rgt colum null

Post by thenetstriker » 29 May 18 11:52

For some reason I have several rows in the idProp table where the lft and rgt column are null. Is there a way to rebuild these values?

Hert
Posts: 6811
Joined: 13 Sep 03 7:24

Re: lft and rgt colum null

Post by Hert » 29 May 18 12:21

These columns are not used anymore (for years already).
This is a user-to-user forum. If you need product support then please send a message

thenetstriker
Posts: 54
Joined: 05 Jul 10 19:24

Re: lft and rgt colum null

Post by thenetstriker » 29 May 18 20:45

Hert wrote:
29 May 18 12:21
These columns are not used anymore (for years already).
Thanks for the info. I'am currently using those columns in my Android app to calculate the photo count for each property. For this I export my SQL Database to SQLITE and load the database on the Android app. But sadly the v_prop view cannot be exported to SQLITE. Can you send me the newest version of the v_prop view that is SQLITE compatible so that I can include this in my app?

Hert
Posts: 6811
Joined: 13 Sep 03 7:24

Re: lft and rgt colum null

Post by Hert » 30 May 18 10:22

You can get that by opening the Photo Supreme database in a SQLite tool(e.g. SQL Expert)

Code: Select all

CREATE VIEW v_prop AS 
SELECT p.*, 
       ( 
              SELECT Count(1) 
              FROM   ( 
                                     SELECT DISTINCT d.catalogitemguid 
                                     FROM            idcatalogitemdefinition d, 
                                                     ( WITH recursive lowerparent(guid, parentguid) AS
                                                     ( 
                                                            SELECT px.guid, 
                                                                   px.parentguid 
                                                            FROM   idprop px 
                                                            WHERE  px.guid = p.guid 
                                                            UNION ALL 
                                                            SELECT px.guid, 
                                                                   px.parentguid 
                                                            FROM   idprop px, 
                                                                   lowerparent lp 
                                                            WHERE  px.parentguid = lp.guid ) 
                                              SELECT guid 
                                              FROM   lowerparent lp ) AS lp 
                                              WHERE  d.guid = lp.guid ) AS idtmp1 ) AS idphotocount,
       ( WITH recursive higherparent(idlevel, guid, parentguid)         AS 
       ( 
              SELECT 0 AS idlevel, 
                     px.guid, 
                     px.parentguid 
              FROM   idprop px 
              WHERE  px.guid = p.guid 
              UNION ALL 
              SELECT idlevel-1 AS idlevel, 
                     hp.guid, 
                     px.parentguid 
              FROM   idprop px, 
                     higherparent hp 
              WHERE  px.guid = hp.parentguid ) 
SELECT   hp.parentguid 
FROM     higherparent hp 
WHERE    hp.guid = p.guid 
ORDER BY hp.idlevel limit 1 ) AS categoryguid 
FROM     idprop p;
This is a user-to-user forum. If you need product support then please send a message

thenetstriker
Posts: 54
Joined: 05 Jul 10 19:24

Re: lft and rgt colum null

Post by thenetstriker » 31 May 18 12:04

Hert wrote:
30 May 18 10:22
You can get that by opening the Photo Supreme database in a SQLite tool(e.g. SQL Expert)

Code: Select all

CREATE VIEW v_prop AS 
SELECT p.*, 
       ( 
              SELECT Count(1) 
              FROM   ( 
                                     SELECT DISTINCT d.catalogitemguid 
                                     FROM            idcatalogitemdefinition d, 
                                                     ( WITH recursive lowerparent(guid, parentguid) AS
                                                     ( 
                                                            SELECT px.guid, 
                                                                   px.parentguid 
                                                            FROM   idprop px 
                                                            WHERE  px.guid = p.guid 
                                                            UNION ALL 
                                                            SELECT px.guid, 
                                                                   px.parentguid 
                                                            FROM   idprop px, 
                                                                   lowerparent lp 
                                                            WHERE  px.parentguid = lp.guid ) 
                                              SELECT guid 
                                              FROM   lowerparent lp ) AS lp 
                                              WHERE  d.guid = lp.guid ) AS idtmp1 ) AS idphotocount,
       ( WITH recursive higherparent(idlevel, guid, parentguid)         AS 
       ( 
              SELECT 0 AS idlevel, 
                     px.guid, 
                     px.parentguid 
              FROM   idprop px 
              WHERE  px.guid = p.guid 
              UNION ALL 
              SELECT idlevel-1 AS idlevel, 
                     hp.guid, 
                     px.parentguid 
              FROM   idprop px, 
                     higherparent hp 
              WHERE  px.guid = hp.parentguid ) 
SELECT   hp.parentguid 
FROM     higherparent hp 
WHERE    hp.guid = p.guid 
ORDER BY hp.idlevel limit 1 ) AS categoryguid 
FROM     idprop p;
Thanks, the problem is that I only have the MS SQL version of PhotoSupreme and the views of the MS SQL database are not compatible with SQLite. Can you also send me the view v_PropCategory or is there another way that I can get the views?

Hert
Posts: 6811
Joined: 13 Sep 03 7:24

Re: lft and rgt colum null

Post by Hert » 31 May 18 21:24

You can install the Single version. Start it and you’ll have the database in your app data folder, Catalog.
This is a user-to-user forum. If you need product support then please send a message

thenetstriker
Posts: 54
Joined: 05 Jul 10 19:24

Re: lft and rgt colum null

Post by thenetstriker » 04 Jun 18 16:40

Hert wrote:
31 May 18 21:24
You can install the Single version. Start it and you’ll have the database in your app data folder, Catalog.
Thanks for the hint. I didn't know that the database is generated before the trial exired error message shows. I will update my app soon.

Post Reply