getting all columns that match a name
Ivan Smahin
ivan_smahin at paradigmasoft.com
Thu May 23 04:10:43 CDT 2013
Hi,
On May 22, 2013, at 6:30 PM, George Parkinson <george at microtherapy.ca> wrote:
> hi bart,
>
> i was afraid it was going to be something like that (procedure + loop)
>
> thanks for your help
> george
>
>
There is one more way (a little bit tricky) - reading system tables directly.
Valentina keeps the schema in two system tables (hidden) - sysItem and sysItemDescription.
Here is some sketch - how it can be used:
SELECT
a1."Value" tblName
FROM
sysitem a1
WHERE
a1.ItemDescrPtr = 55
AND a1.ParentPtr->RecID IN (SELECT a2.ParentPtr->ParentPtr FROM sysitem a2 WHERE a2.ItemDescrPtr = 65 AND a2."Value" = 'fieldName')
-- Short explanation:
- a1.ItemDescrPtr = 55 - 55 is a table-name item (see select * from sysItemDescription where recid = 55)
- a2.ItemDescrPtr = 65 - 65 is a field-name item (see select * from sysItemDescription where recid = 65)
- a1.ParentPtr->RecID - Valentina extension - means "get RecID which is linked to the current record using ParentPtr link".
--
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com
--
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20130523/b13fc9ee/attachment.html>
More information about the Valentina
mailing list