lft and rgt colum null
-
- Posts: 56
- Joined: 05 Jul 10 18:24
lft and rgt colum null
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?
Re: lft and rgt colum null
These columns are not used anymore (for years already).
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
-
- Posts: 56
- Joined: 05 Jul 10 18:24
Re: lft and rgt colum null
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?
Re: lft and rgt colum null
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 have suggestions, requests or need support then please send a message
-
- Posts: 56
- Joined: 05 Jul 10 18:24
Re: lft and rgt colum null
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 wrote: 30 May 18 9: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;
Re: lft and rgt colum null
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 have suggestions, requests or need support then please send a message
-
- Posts: 56
- Joined: 05 Jul 10 18:24
Re: lft and rgt colum null
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.Hert wrote: 31 May 18 20:24 You can install the Single version. Start it and you’ll have the database in your app data folder, Catalog.