<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Optional parameters in a called MS SQL stored procedure</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121245128" />
  <subtitle>Optional parameters in a called MS SQL stored procedure</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121245128</id>
  <updated>2026-05-24T17:02:06Z</updated>
  <dc:date>2026-05-24T17:02:06Z</dc:date>
  <entry>
    <title>RE: Optional parameters in a called MS SQL stored procedure</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121353672" />
    <author>
      <name>Alex TRICA</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121353672</id>
    <updated>2022-08-24T06:01:38Z</updated>
    <published>2022-02-07T14:43:37Z</published>
    <summary type="html">&lt;p&gt;HI !&lt;/p&gt;
&lt;p&gt;I  renew my request.&lt;/p&gt;
&lt;p&gt;No ideas about a solution concerning OPTIONAL PARAMETERS in a SQL
  procedure ?&lt;/p&gt;
&lt;p&gt;Many thanks for any usable information !&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;</summary>
    <dc:creator>Alex TRICA</dc:creator>
    <dc:date>2022-02-07T14:43:37Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Optional parameters in a called MS SQL stored procedure</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121317270" />
    <author>
      <name>Alex TRICA</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121317270</id>
    <updated>2022-08-24T06:01:38Z</updated>
    <published>2022-01-05T06:58:49Z</published>
    <summary type="html">&lt;p&gt;HI !&lt;/p&gt;
&lt;p&gt;No ideas about a solution concerning OPTIONAL PARAMETERS in a SQL
  procedure ?&lt;/p&gt;
&lt;p&gt;Many thanks for any usable information !&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;</summary>
    <dc:creator>Alex TRICA</dc:creator>
    <dc:date>2022-01-05T06:58:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Optional parameters in a called MS SQL stored procedure</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121260893" />
    <author>
      <name>Alex TRICA</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121260893</id>
    <updated>2022-08-24T06:01:38Z</updated>
    <published>2021-11-25T08:02:12Z</published>
    <summary type="html">&lt;p&gt;Thank you for answer.&lt;/p&gt;
&lt;p&gt;But it don't resolve the problem.&lt;/p&gt;
&lt;p&gt;I asked about 'OPTIONAL PARAMETERS'. &lt;/p&gt;
&lt;p&gt;This means that once I have to call the procedure with 1 parameter,
  another time I have to call it with 3 parameters and so on.&lt;/p&gt;
&lt;p&gt;My procedure has 11 parameters, only the first beeing mandatory. How
  to specify that params 2 ... 11 are OPTIONAL ?&lt;/p&gt;
&lt;p&gt;So, if you or other anybody has an idea, please post it.&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;</summary>
    <dc:creator>Alex TRICA</dc:creator>
    <dc:date>2021-11-25T08:02:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Optional parameters in a called MS SQL stored procedure</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121260662" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121260662</id>
    <updated>2021-11-25T07:11:00Z</updated>
    <published>2021-11-25T07:10:59Z</published>
    <summary type="html">&lt;p&gt;Hi , &lt;br /&gt; You can either use a Placeholder or QueryPos to include
  parameter in your Procedure&lt;/p&gt;
&lt;p&gt;Ex. &lt;br /&gt;  CALL somprocedue(? , ? );&lt;br /&gt;  CAL someprocdure([$PARAM1$],[$PARAM2])&lt;/p&gt;
&lt;p&gt;Then you can replace the placeholder in your finderimpl using string
  replace utility or use QueryPos&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;QueryPos qPos = QueryPos.getInstance(query);
qPos.add(param1);
qPos.add(param2);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2021-11-25T07:10:59Z</dc:date>
  </entry>
  <entry>
    <title>Optional parameters in a called MS SQL stored procedure</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121245127" />
    <author>
      <name>Alex TRICA</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121245127</id>
    <updated>2022-08-24T06:01:38Z</updated>
    <published>2021-11-15T08:35:37Z</published>
    <summary type="html">&lt;p&gt;Hi ! I have a MS SQL procedure called in Java - LIFERAY. It is a
  general procedure with many optional parameters.  &lt;/p&gt;
&lt;p&gt;1. How can define OPTIONAL PARAMETERS in default.xml?  &lt;/p&gt;
&lt;p&gt;2 How to call the procedure without a part of the optional parameters ?&lt;/p&gt;</summary>
    <dc:creator>Alex TRICA</dc:creator>
    <dc:date>2021-11-15T08:35:37Z</dc:date>
  </entry>
</feed>
