[SOLVED] Sqlserver schemas

Author: alex.meyers@cevi.be (ceviame)

have a sqlserver database where tables are grouped in schemas so <select * from Reports.Definitions> in Uniface i have made a Model Reports with an Entity Definitions the generated sql is <select pk from Definitions where 1 = 0> which fails   Help ?   Alex

8 Comments

  1. Hi Alex, Application model name in Uniface has no impact on I/O, as you already discovered. To address your issue you should add a line in your assignment files in the [ENTITIES] section; something like:     *.Reports    $DEF:Reports.* First part means: all entities of "Reports" application model. Seconda parts means: name these entities with a prefix "Reports." followed by the name of each entity and assign those entities to path $DEF. You can also address a single entity or a group of entities with common names on one line having different prefixes.     myFirstEntity.Reports    $DEF:Printing.myAnotherEntity     mySecond*.Reports    $DEF:Extracting.mySecond* Take care those lines should be coordinated with other sections of your assignment file...path addressing as example. Hope this helps...


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  2. Hi, The generated sql  "<select pk from Definitions where 1 = 0>" is a table existence check; obviously 1=0 will always fail.  It's just to see that the table is there. These checks can be turned off in the UsysParams; they are seldom used in deployed versions of applications. To see more of what is happening when you try to retrieve data, set the following in [SETTINGS] of your assignment file: $ioprint=35 This tells Uniface to raise the level of information it provides - 35 should show you a little more of the SQL.  The number can be set between 0 and 255 (with some special settings above that for networks) - see the Uniface Help on $ioprint for details. Remember that you must restart Uniface when you change the assignment file - it is only read at the outset. Make sure that you have run "analyse model" (in Model Definitions, File or Edit menu); this will give you a little help if there is a problem with your model.


    Author: None (None)
  3. gianni said Hi Alex, Application model name in Uniface has no impact on I/O, as you already discovered. To address your issue you should add a line in your assignment files in the [ENTITIES] section; something like:     *.Reports    $DEF:Reports.* First part means: all entities of "Reports" application model. Seconda parts means: name these entities with a prefix "Reports." followed by the name of each entity and assign those entities to path $DEF. You can also address a single entity or a group of entities with common names on one line having different prefixes.     myFirstEntity.Reports    $DEF:Printing.myAnotherEntity     mySecond*.Reports    $DEF:Extracting.mySecond* Take care those lines should be coordinated with other sections of your assignment file...path addressing as example. Hope this helps...

    Hi Gianni, *.Reports    $DEF:Reports.* does not work myFirstEntity.Reports    $DEF:Printing.myFirstEntity works luckily there is only a limited number of tables and i can generate the asn lines from a query but will have to maintain the asn when creating new tables => PITA also tried USYS$MSS_PARAMS dbowner="OwnerName" in the hope that manual was wrong and forget to mention other objects than stored procs but to no avail Alex


    Author: ceviame (alex.meyers@cevi.be)
  4. *.Reports    $DEF:Reports.* does not work

    It MUST work...BUT you should coordinate it with the rest of your assignment file as already told... You should check what's happening raising the amount of log Uniface is generating into message frame with a temporary proper /pri=xxx value. Daveyex explained it already for you...

    and forget to mention other objects than stored procs but to no avail

    ???


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  5. gianni said
    *.Reports    $DEF:Reports.* does not work
    It MUST work...BUT you should coordinate it with the rest of your assignment file as already told... You should check what's happening raising the amount of log Uniface is generating into message frame with a temporary proper /pri=xxx value. Daveyex explained it already for you...

    0) asn paths [PATHS] $DBMS          MSS:UF96_Test:|| $BMD            MSS:ReportDB:|| $SYS            $DBMS $UUU            $DBMS $DEF            $DBMS $IDF            $DBMS $MSS            $BMD $DEF            $BMD 1) generic ASN, /pri=35 [ENTITIES] *.REPORT                $BMD:Reports.* select tnrreport from reports where 1=0 42S02 [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'reports'. 2) specific ASN, /pri=35 [ENTITIES] REPORT.REPORT                $BMD:Reports.Report select tnrreport from reports.report where 1=0 I/O function: S, mode: 0, on file/table: Reports.Report index: 1 >= select tnrreport,tnrtranslate,tnrcustomer,reportkey,nationalnumber,active from reports.report etc ... data   what coordination is missing ? Alex


    Author: ceviame (alex.meyers@cevi.be)
  6. Hi Alex, IMHO if the specific line (REPORT.REPORT) works the generic one (*.REPORT) should work either... From your short description is difficult to decode a mistake, but anyhow here some quick toughts: 0 - which MSS driver version are you using against which client & server version? 1 - are you generating those tables with Uniface MSS driver or have you inherited the tables from another non Uniface application? 2 - are tables names and schema using mixed case (upper & lower)? 3 - are you quoting or not quoting identifiers in the driver config (USYS$MSS_PARAMS)? 4 - could it be "report" is a keyword in your software stack? 5 - could you try to disable table existance checks in USYS$MSS_PARAMS? Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  7. Hi Alex *.REPORT                $BMD:Reports.* will cause Uniface to rename (at run-time) every entity in the REPORT model to the name Reports I think (although I am not sure) what you need to do is add a .* to the end giving  [ENTITIES] *.REPORT                $BMD:Reports.*.*  

    so just as 
    "*.model2 = $sol:model2_*.*" 
    adds the string "model2_" to the start of every entity name in the model "model2" 
    
    "*.REPORT  $BMD:Reports.*.*" 
    should add the string "Reports." to the start of every entity name in model REPORT.
    
    Good luck
    
     

    Author: Mike Taylor (michael.taylor@uniface.com)
  8. Alex,    Further to the other posts, there is another problem with your assignments.     In Uniface, it is essential that specifics are assigned before generics.  If you assign:  mytxt.txt = c:\personal\mytxt.txt  *.txt = c:\work\*.txt  means that mytxt.txt will go to the personal folder.  However,  *.txt = c:\work\*.txt  mytxt.txt = c:\personal\mytxt.txt with the global before the specific, means txt files will be sent to the folder c:\work, including mytxt.txt You must assign specific before generic.  I think, looking at what you said you had in your assignment files, that Uniface is reading generic then specific.   *.REPORT                $BMD:Reports.* followed by REPORT.REPORT                $BMD:Reports.Report In this particular case, I don't think it's too much of a problem, but it is, I think, worth noting for the future.  Obviously, the naming issue, as highlighted by Mike Taylor, is something you must resolve immediately for your assignments to work. regards, Dave


    Author: None (None)