<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged schema</title>
<link>https://overflow.efficy.io/?qa=tag/schema</link>
<description>Powered by Question2Answer</description>
<item>
<title>DB Upgrade - missing database schema</title>
<link>https://overflow.efficy.io/?qa=3763/db-upgrade-missing-database-schema</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;For a customer we changed the DB User name, in order to make it worked, we have : &lt;br&gt;
1- change the DB Schema (following the post : &lt;a rel=&quot;nofollow&quot; href=&quot;https://overflow.efficy.com/?qa=807/mssql-server-how-to-change-owner-name&quot;&gt;https://overflow.efficy.com/?qa=807/mssql-server-how-to-change-owner-name&lt;/a&gt; )&lt;br&gt;
2- change the Efficy Admin name in ACC_ACCOUNTS&lt;br&gt;
3- change the login in Alias manager&lt;/p&gt;

&lt;p&gt;We then kill the com+ and we tried to do an upgrade DB but we encountered issues with the SQL function because they are not prefixed with the schema.&lt;/p&gt;

&lt;p&gt;We look at a local DBUpgrade script and in my local environnment the function are prefixed for instance below we can see &lt;strong&gt;ADMINR14832.&lt;/strong&gt;GET&lt;em&gt;OPPORTUNI&lt;/em&gt;COMPETITORS_VAL ... on the customer database we dont have the prefix. &lt;/p&gt;

&lt;p&gt;So my question is how the UpgradeDb.exe tool is retrieving the database Schema, in order for us to check if we missed something in DB ?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;create view R_OPPORTUNITIES as select OPPORTUNITIES.*,
(select FULLNAME from ACC_ACCOUNTS L1 where L1.K_USER=OPPORTUNITIES.MANAGER) as R_MANAGER,
(select STATUS from LK_OPPO_STATUS L2 where L2.K_OPPO_STATUS=OPPORTUNITIES.STATUS) as R_STATUS,
(select NATURE from LK_OPPO_NATURE L3 where L3.K_OPPO_NATURE=OPPORTUNITIES.NATURE) as R_NATURE,
ADMINR14832.GET_OPPORTUNI_COMPETITORS_VAL(COMPETITORS) as R_COMPETITORS,
(select COMPETITOR from LK_OPPO_COMPET L4 where L4.K_OPPO_COMPET=OPPORTUNITIES.LOSTAGAINST) as R_LOSTAGAINST,
(select CODE from LK_CURRCY L5 where L5.K_CURRCY=OPPORTUNITIES.CURRCY) as R_CURRCY from OPPORTUNITIES
go
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3763/db-upgrade-missing-database-schema</guid>
<pubDate>Mon, 17 Dec 2018 16:53:03 +0000</pubDate>
</item>
<item>
<title>CUSTOM Views And Function on CHILD DB</title>
<link>https://overflow.efficy.io/?qa=124/custom-views-and-function-on-child-db</link>
<description>&lt;p&gt;When doing standard SQL queries we use the following code to get the right user in DB which is good when using Child Database :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;#TABLE name='COMPANIES'&amp;gt; COMP
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But do we have such example when we have a call to a Custom Function ?&lt;/p&gt;

&lt;p&gt;for instance : Scalar function CUSTOM&lt;em&gt;GET&lt;/em&gt;NB&lt;em&gt;PROJECT&lt;/em&gt;PER&lt;em&gt;COMPANY(K&lt;/em&gt;COMPANY) &lt;br&gt;
should be call like this :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[databaseuser].CUSTOM_GET_NB_PROJECT_PER_COMPANY(K_COMPANY) 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Can we replace automatically in Efficy the [databaseuser]. like the table name?&lt;/p&gt;

&lt;p&gt;Best Regards,&lt;br&gt;
Stéphane RONCIN&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=124/custom-views-and-function-on-child-db</guid>
<pubDate>Thu, 11 Dec 2014 15:22:18 +0000</pubDate>
</item>
</channel>
</rss>