<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Parameter Passing in PassthruRdbQuery</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Parameter Passing in PassthruRdbQuery</description>
  <pubDate>Thu, 11 Jun 2026 16:35:28 -700</pubDate>
  <lastBuildDate>Wed, 17 Oct 2007 13:09:42 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=507</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Parameter Passing in PassthruRdbQuery : I believe you&#8217;re using a DbParameter...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=507&amp;PID=1679#1679</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 507<br /><strong>Posted:</strong> 17-Oct-2007 at 1:09pm<br /><br /><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT face="Times New Roman">I believe you’re using a DbParameter typed parameter in the PassthruRdbQuery.&nbsp; You must use the RdbParameter type via ParameterizedSql instead for remoting PassthruRdbQuery.&nbsp; See RdbParameter’s help:<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;remarks&gt;<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> An </SPAN><SPAN style="COLOR: gray">&lt;b&gt;</SPAN><SPAN style="COLOR: green">RdbParameter</SPAN><SPAN style="COLOR: gray">&lt;/b&gt;</SPAN><SPAN style="COLOR: green"> is essentially a </SPAN><SPAN style="COLOR: gray">&lt;see cref="DbParameter"/&gt;</SPAN><SPAN style="COLOR: green"> that is marshalled by<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> value rather by reference when passed to a remote Business Object Server.&nbsp; The remoting channel<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> used by the client does not allow two-way communication with the remote server, which a<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> DbParameter as a MarshalByRefObject requires.<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;para&gt;<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> Use an </SPAN><SPAN style="COLOR: gray">&lt;b&gt;</SPAN><SPAN style="COLOR: green">RdbParameter</SPAN><SPAN style="COLOR: gray">&lt;/b&gt;</SPAN><SPAN style="COLOR: green"> when adding parameters to a </SPAN><SPAN style="COLOR: gray">&lt;b&gt;</SPAN><SPAN style="COLOR: green">StoredProcRdbQuery</SPAN><SPAN style="COLOR: gray">&lt;/b&gt;</SPAN><SPAN style="COLOR: green"> or<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;b&gt;</SPAN><SPAN style="COLOR: green">PassthruRdbQuery</SPAN><SPAN style="COLOR: gray">&lt;/b&gt;</SPAN><SPAN style="COLOR: green">.<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;/para&gt;<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp; <SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green"> </SPAN><SPAN style="COLOR: gray">&lt;/remarks&gt;<o:p></o:p></SPAN></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT face="Times New Roman">Try this for your query and see if it works.<o:p></o:p></FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #2b91af">RdbKey</SPAN> key = (<SPAN style="COLOR: #2b91af">RdbKey</SPAN>)mPm.GetDataSourceKey(<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: #2b91af">DB_PERSONS</SPAN>));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: blue">string</SPAN> lastName = <SPAN style="COLOR: #a31515">"LAST_NAME"</SPAN>;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: blue">string</SPAN> parmName = key.AdoHelper.FormatParameterName(lastName);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #2b91af">RdbParameter</SPAN> param = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">RdbParameter</SPAN>(parmName, <SPAN style="COLOR: #2b91af">DbType</SPAN>.String);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; param.Value = <SPAN style="COLOR: #a31515">"Anacker1%"</SPAN>;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: blue">string</SPAN> select = <SPAN style="COLOR: #2b91af">String</SPAN>.Format(<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #a31515">"select * from \"DB_ADM\".\"DB_PERSONS\""</SPAN> +<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #a31515">"&nbsp; where ((id &lt;&gt; 0) and (upper({0}) like upper({1}))) and (ROWNUM &lt;= 500)"</SPAN>,<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lastName, parmName);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #2b91af">ParameterizedSql</SPAN> sql = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">ParameterizedSql</SPAN>(select, param);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="COLOR: #2b91af">PassthruRdbQuery</SPAN> query = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">PassthruRdbQuery</SPAN>(<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: #2b91af">DB_PERSONS</SPAN>), sql);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT face="Times New Roman">Let us know the result. Thanks<o:p></o:p></FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>]]>
   </description>
   <pubDate>Wed, 17 Oct 2007 13:09:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=507&amp;PID=1679#1679</guid>
  </item> 
  <item>
   <title>Parameter Passing in PassthruRdbQuery : When we use 3-tier deployment...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=507&amp;PID=1678#1678</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=20" rel="nofollow">Customer</a><br /><strong>Subject:</strong> 507<br /><strong>Posted:</strong> 17-Oct-2007 at 1:06pm<br /><br /><P =Ms&#111;normal><SPAN lang=EN-US style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">When we use 3-tier deployment and the client executes a PassthruRdbQuery with parameters like<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN lang=EN-US style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">select * from "DB_ADM"."DB_PERSONS" where ((id &lt;&gt; 0) and (upper("DB_ADM"."DB_PERSONS"."LAST_NAME") like upper(:v0))) and (ROWNUM &lt;= 500) Params: :v0=Anacker1%,<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN lang=EN-US style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">we get the following error:<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN lang=EN-US style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">"Type 'Oracle.DataAccess.Client.OracleParameter' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute."<o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN lang=EN-US style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p></o:p></SPAN></P><P =Ms&#111;normal><SPAN lang=EN-US style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">How should we avoid this error? This problem is rather urgent.<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Wed, 17 Oct 2007 13:06:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=507&amp;PID=1678#1678</guid>
  </item> 
 </channel>
</rss>