O$5 (& O$10.2) Updating tables and column definitions from library updates via notation?

Gordon Wilson g_r_wilson at yahoo.com
Wed Mar 10 09:55:46 UTC 2021


 Does any one have a short script or detailed description of how to maintain changes to SQL (e.g. MySQL) tables and column definitions from within Omnis for library updates?
I am using Das's approach using the $file definitions to run SQL and have $files, $schema, $table objects within Omnis. I want to update columns from $files and using a checker on startup in case there are changes in the $files to update $schema, $tables and SQL server tables.
I guess something like...
Set reference to mrFile  to $clib.$files.$first()While mrFile 
    Calculate %%name as mrFile.$name
    Do mrFile mrObj.$objs.$makelist($ref.$name,$ref.$type,$ref.$subtype,$ref.$sublen) Returns mFileList    Set reference mrObj to $clib.$schemas.[con('s',mid(%%name,2,100)]    If not(mrObj)        Do $clib.$schemas.$add(con('s',mid(%%name,2,100)) Returns mrObj
        Do $cinst.$makeColumns(mFileList,myObj) Returns #F    Else        Do $cinst.$updateColumns(mFileList, mrObj) Returns #F    End if    Set reference mrObj to $clib.$tables.[con('s',mid(%%name,2,100)]
    If not(mrObj)        Do $clib.$ tables.$add(con('s',mid(%%name,2,100)) Returns mrObj
        Do $cinst.$makeColumns(mFileList, mrObj) Returns #F    Else        Do $cinst.$updateColumns(mFileList, mrObj) Returns #F    End if    ;  something similar here for server tables...?
    Set reference to mrFile  to $clib.$files.$next(mrFile)
End while

Comments and suggestions most welcome : )
I guess there will be coded errors and typos but hopefully you get the idea of what I am after...?
Also, if the line spacing goes wrong, I'll resend this...!@#$

Kind regards, Gordon.

 
    On Wednesday, 10 March 2021, 2:32:01 pm NZDT, Das's <goravanis at gmail.com> wrote:  
 
 
I pay NO IP.com <http://ip.com/> a small yearly fee and get email support, no ads, and it’s worked out great. I was a bit confused by their setup help, about a year ago.. but I got through it. 

Das
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
  


More information about the omnisdev-en mailing list