<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Call a function in SQL LOAD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256771#M709951</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expect you can use the function in a SQL SELECT statement, not in a LOAD statement. SQL SELECT (or SQL EXECUTE) passes the query to the SQL server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just replace LOAD with SQL SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2011 12:56:42 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2011-10-18T12:56:42Z</dc:date>
    <item>
      <title>Call a function in SQL LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256770#M709950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I would&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;call a function&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sql&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for loading&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;fact table&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;For information,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;here is my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;example:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;S_ASSET_ASSET_NUM&lt;/P&gt;&lt;P&gt;S_ASSET_1_ASSET_NUM;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;"S_ASSET"."ASSET_NUM" as S_ASSET_ASSET_NUM&lt;/P&gt;&lt;P&gt;"S_ASSET_1"."ASSET_NUM" as S_ASSET_1_ASSET_NUM&lt;/P&gt;&lt;P&gt;FROM "siebeldb"."dbo"."S_ASSET" "S_ASSET"&lt;/P&gt;&lt;P&gt;LEFT OUTER JOIN "siebeldb"."dbo"."S_ASSET" "S_ASSET_1" ON "S_ASSET_1".ROOT_ASSET_ID IN ((select dbo.RootAssetId("S_ASSET".ROW_ID) from S_ASSET)) and "S_ASSET_1".ROW_ID = "S_ASSET_1".ROOT_ASSET_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Function dbo.RootAssetIdin SQL &lt;/P&gt;&lt;P&gt;FUNCTION dbo.RootAssetId (@IdAsset VARCHAR(20))&lt;/P&gt;&lt;P&gt;RETURNS VARCHAR(20)&lt;/P&gt;&lt;P&gt;BEGIN&lt;/P&gt;&lt;P&gt;declare @IdParent VARCHAR(20);&lt;/P&gt;&lt;P&gt;declare @nbEnregistrement INTEGER;&lt;/P&gt;&lt;P&gt;SET @nbEnregistrement = 0&lt;/P&gt;&lt;P&gt;WHILE (@nbEnregistrement=0)&lt;/P&gt;&lt;P&gt;BEGIN&lt;/P&gt;&lt;P&gt;SELECT @nbEnregistrement = (SELECT COUNT(*) FROM S_ASSET WHERE (@IdAsset = ROW_ID and ROW_ID = ROOT_ASSET_ID AND PAR_ASSET_ID is null))&lt;/P&gt;&lt;P&gt;SET @IdParent = (SELECT ROOT_ASSET_ID FROM S_ASSET WHERE ROW_ID = @IdAsset)&lt;/P&gt;&lt;P&gt;SET @IdAsset = (SELECT PAR_ASSET_ID FROM S_ASSET WHERE ROW_ID = @IdAsset)&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;RETURN @IdParent&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;My questions are:&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;-&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Is this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;possible?&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;- Where&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;do I report&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;my position&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;- Can I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;use it&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;as&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;rewriting&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;or&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in another&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;language.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;Thank you in advance&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for your help.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;cordially&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 12:34:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256770#M709950</guid>
      <dc:creator />
      <dc:date>2011-10-18T12:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function in SQL LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256771#M709951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expect you can use the function in a SQL SELECT statement, not in a LOAD statement. SQL SELECT (or SQL EXECUTE) passes the query to the SQL server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just replace LOAD with SQL SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 12:56:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256771#M709951</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-10-18T12:56:42Z</dc:date>
    </item>
    <item>
      <title>Call a function in SQL LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256772#M709952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; you can load afunction&amp;nbsp; from sql or oracle&amp;nbsp; in database like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*;&lt;/P&gt;&lt;P&gt;select &lt;/P&gt;&lt;P&gt;field1,&lt;/P&gt;&lt;P&gt;field2,&lt;/P&gt;&lt;P&gt;fild3,&lt;/P&gt;&lt;P&gt;fieeld4,&lt;/P&gt;&lt;P&gt;tablename.functionname(arg1,agr2.......) as calculationname&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from tablename&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;calculationname name return the output of function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 13:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256772#M709952</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2011-10-18T13:23:41Z</dc:date>
    </item>
    <item>
      <title>Call a function in SQL LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256773#M709953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I execute my call, I have the following message:&lt;/P&gt;&lt;P&gt;SQL##f - SqlState: 42000, ErrorCode: 229, ErrorMsg: [Microsoft][ODBC SQL Server Driver][SQL Server]EXECUTE permission denied on object 'RootAssetId', database 'siebeldb', owner 'dbo'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 13:52:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256773#M709953</guid>
      <dc:creator />
      <dc:date>2011-10-19T13:52:10Z</dc:date>
    </item>
    <item>
      <title>Call a function in SQL LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256774#M709954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Request the database administrator to grant execute previlages to the account with which your are connecting. If you have any other account with execute previlages then try with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 14:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-in-SQL-LOAD/m-p/256774#M709954</guid>
      <dc:creator />
      <dc:date>2011-10-19T14:56:56Z</dc:date>
    </item>
  </channel>
</rss>

