<?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>Question Re: generic function coding issue in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842644#M4873487</link>
    <description>&lt;P&gt;SQL Anywhere will attempt to do automatic type conversion in all cases so you only need to write one procedure.&lt;/P&gt;
&lt;P&gt;FWIW: I'm not sure why you chose varchar(254) in your sample, but if you are unsure how long the string values will be you could easily change the parameters to long varchar and then you do not need to be concerned with string truncation errors.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2011 08:50:38 GMT</pubDate>
    <dc:creator>MarkCulp</dc:creator>
    <dc:date>2011-06-24T08:50:38Z</dc:date>
    <item>
      <title>generic function coding issue</title>
      <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaq-p/13842643</link>
      <description>&lt;P&gt;I am attempting to code a function to report changes in table column values as follows.  Is there the equivalent of the PowerBuilder "any" data type in SQL Anywhere or will automatic conversion handle old and new values provided they fit in a varchar(254) in this case?  The documentation alludes to SQL Anywhere performing automatic conversions of data types but makes no reference (that I have found) to whether or not this occurs on a stored procedure call.  While I do not like relying on automatic conversions -- this may be a case where the savings could be significant over coding multiple functions for every datatype I want to pass through this function.  I know the profiler can perform this function however there are issues with data volumes and preserving the actual execution sequence I have not been able to resolve as well as my desired potential to use common text diff utilities on the console log (saved to disk) as part of my testing procedures -- for matching the output of two separate runs. &lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;PROCEDURE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;data&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;p_display_diff&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;
    &lt;SPAN class="n"&gt;IN&lt;/SPAN&gt;      &lt;SPAN class="n"&gt;p_column&lt;/SPAN&gt;    &lt;SPAN class="n"&gt;varchar&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;62&lt;/SPAN&gt;&lt;SPAN class="p"&gt;),&lt;/SPAN&gt;
    &lt;SPAN class="n"&gt;IN&lt;/SPAN&gt;      &lt;SPAN class="n"&gt;p_old&lt;/SPAN&gt;       &lt;SPAN class="n"&gt;varchar&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;254&lt;/SPAN&gt;&lt;SPAN class="p"&gt;),&lt;/SPAN&gt;
    &lt;SPAN class="n"&gt;IN&lt;/SPAN&gt;      &lt;SPAN class="n"&gt;p_new&lt;/SPAN&gt;       &lt;SPAN class="n"&gt;varchar&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;254&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="k"&gt;BEGIN&lt;/SPAN&gt;

    &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'           UPDATE '&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_column&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="n"&gt;IF&lt;/SPAN&gt; &lt;SPAN class="p"&gt;((&lt;/SPAN&gt;&lt;SPAN class="n"&gt;p_old&lt;/SPAN&gt; &lt;SPAN class="n"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="ow"&gt;and&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;p_new&lt;/SPAN&gt; &lt;SPAN class="n"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;THEN&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'               BEFORE ({null})'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'               AFTER  ('&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_new&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;')'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="n"&gt;ELSEIF&lt;/SPAN&gt; &lt;SPAN class="p"&gt;((&lt;/SPAN&gt;&lt;SPAN class="n"&gt;p_old&lt;/SPAN&gt; &lt;SPAN class="n"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="ow"&gt;and&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;p_new&lt;/SPAN&gt; &lt;SPAN class="n"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="n"&gt;THEN&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'               BEFORE ('&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_old&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;')'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'               AFTER  ({null})'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="n"&gt;ELSEIF&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_old&lt;/SPAN&gt; &lt;SPAN class="o"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_new&lt;/SPAN&gt; &lt;SPAN class="n"&gt;THEN&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'               BEFORE ('&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_old&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;')'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="n"&gt;MESSAGE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STRING&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'               AFTER  ('&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;p_new&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;')'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="n"&gt;TYPE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;STATUS&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;CONSOLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;DEBUG&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ONLY&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="k"&gt;END&lt;/SPAN&gt; &lt;SPAN class="n"&gt;IF&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="k"&gt;END&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Jun 2011 08:18:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaq-p/13842643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-24T08:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: generic function coding issue</title>
      <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842644#M4873487</link>
      <description>&lt;P&gt;SQL Anywhere will attempt to do automatic type conversion in all cases so you only need to write one procedure.&lt;/P&gt;
&lt;P&gt;FWIW: I'm not sure why you chose varchar(254) in your sample, but if you are unsure how long the string values will be you could easily change the parameters to long varchar and then you do not need to be concerned with string truncation errors.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2011 08:50:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842644#M4873487</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2011-06-24T08:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: generic function coding issue</title>
      <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842645#M4873488</link>
      <description>&lt;P&gt;oops, I deleted the wrong comment by mistake; it contained a "thank you" from pasha19.&lt;/P&gt;
&lt;P&gt;And now here's my comment: NCHAR to CHAR will be lossy; are there any others like that? &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/datatypes-s-5442544.html"&gt;http://dcx.sybase.com/index.html#1201/en/dbreference/datatypes-s-5442544.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2011 12:21:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842645#M4873488</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2011-06-25T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: generic function coding issue</title>
      <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842646#M4873489</link>
      <description>&lt;P&gt;Hmmm, wouldn't it be nice to have an undo operation.... or at least an undelete... but sadly there isn't one (yet).&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2011 12:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842646#M4873489</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2011-06-25T12:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: generic function coding issue</title>
      <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842647#M4873490</link>
      <description>&lt;P&gt;Thanks - sounds good. - pasha19 (yesterday)&lt;/P&gt;
&lt;P&gt;(that was the comment I accidentally deleted... I just discovered it was still open in another tab in Chrome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2011 14:32:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842647#M4873490</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2011-06-25T14:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: generic function coding issue</title>
      <link>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842648#M4873491</link>
      <description>&lt;P&gt;It's working as indicated.  I will keep in mind the nchar issue but it is not applicable in my case -- thanks again to all.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2011 07:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/generic-function-coding-issue/qaa-p/13842648#M4873491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-30T07:58:23Z</dc:date>
    </item>
  </channel>
</rss>

