Searching Schemas

Dawid Mocke dawidmocke at gmail.com
Tue Jan 26 18:43:02 UTC 2021


Hello Das,
You are a lifesaver!!!  Thank you so much!!!

For your records, if you want to make use of the method in future.  I have
modified it to find a schema based on a column name that is passed as a
parameter into the method
;Declare parameter variable pColumnName

;  2021-01-26
;  *************************                START OF SECTION
 ************************************************
;  Structure of code supplied by: Das Goravani

Do lvSchemaList.$define(tvrsnfieldname)
Do tvFileRSNs.$define(tvfilename,tvrsnfieldname)
Do $schemas.$makelist($ref.$name) Returns lfileslist
Do lfileslist.$redefine(tvfilename)
Do lfileslist.$line.$assign(1)
Repeat
Do lfileslist.$loadcols()
Do $schemas.[tvfilename].$objs.$makelist($ref.$name,$ref.$coltype) Returns
lfieldslist
Do lfieldslist.$redefine(tvrsnfieldname,lfieldtype)
Do lfieldslist.$search(lfieldslist.tvrsnfieldname=pColumnName,1,0,1,1)
Returns #F
If flag true
Do lvSchemaList.$add(tvfilename)
End If
Do lfileslist.$line.$assign(lfileslist.$line+1)
Until lfileslist.$line>lfileslist.$linecount
Quit method lvSchemaList

;  *************************                    END OF SECTION
 ************************************************





On Tue, 26 Jan 2021 at 20:21, Das Goravani <goravanis at gmail.com> wrote:

>
> The code you need is buried in this sample. You can make a list of
> schemas, you can make a list of fields within one, and go down them and see
> if they are named the one you’re looking for. I wish this preserved
> indentation but oh well.
>
>
> Do tvFileRSNs.$define(tvfilename,tvrsnfieldname)
> Do $schemas.$makelist($ref.$name) Returns lfileslist
> Do lfileslist.$redefine(tvfilename)
> Do lfileslist.$line.$assign(1)
> Repeat
> Do lfileslist.$loadcols()
> Do $schemas.[tvfilename].$objs.$makelist($ref.$name,$ref.$coltype) Returns
> lfieldslist
> Do lfieldslist.$redefine(tvrsnfieldname,lfieldtype)
> Do lfieldslist.$search(lfieldslist.lfieldtype='sequence',1,0,1,1) Returns
> #F
> If flag true
> Do lfieldslist.$first(kTrue)
> Do lfieldslist.$loadcols()
> Do tvFileRSNs.$add()
> End If
> Do lfileslist.$line.$assign(lfileslist.$line+1)
> Until lfileslist.$line>lfileslist.$linecount
> Do tvFileRSNs.$line.$assign(1)
> Repeat
> Do tvFileRSNs.$loadcols()
> Calculate tvfilename as con('f',mid(tvfilename,2,30))
> Do tvFileRSNs.$assigncols()
> Do tvFileRSNs.$line.$assign(tvFileRSNs.$line+1)
> Until tvFileRSNs.$line>tvFileRSNs.$linecount
>
> > On Jan 26, 2021, at 10:17 AM, Dawid Mocke <dawidmocke at gmail.com> wrote:
> >
> > Hi Guys,
> > I am looking for a way to find all schemas in my Library with a column
> > called ClientNo.
> > I have not done Omnis programming in a looooong time, and I am seriously
> > rustic.
> > Could one of you wizards please help me out?
> >
> > I would like to dump the list of schema names into a list.
> >
> > thank you
> >
> > --
> >
> > Dawid Mocke
> > This message (and any associated files) is intended only for the use of
> the
> > individual or entity to which it is addressed and may contain information
> > that is confidential, subject to copyright or constitutes a trade secret.
> > If you are not the intended recipient you are hereby notified that any
> > dissemination, copying or distribution of this message, or files
> associated
> > with this message, is strictly prohibited. If you have received this
> > message in error, please notify us immediately by replying to the message
> > and deleting it from your computer.
> > _____________________________________________________________
> > Manage your list subscriptions at http://lists.omnis-dev.com
> > Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>


-- 

Dawid Mocke
This message (and any associated files) is intended only for the use of the
individual or entity to which it is addressed and may contain information
that is confidential, subject to copyright or constitutes a trade secret.
If you are not the intended recipient you are hereby notified that any
dissemination, copying or distribution of this message, or files associated
with this message, is strictly prohibited. If you have received this
message in error, please notify us immediately by replying to the message
and deleting it from your computer.


More information about the omnisdev-en mailing list