Select Into Statement - OracleConnections2024-03-28T18:53:45Zhttp://www.oracleconnections.com/forum/topics/select-into-statement?groupUrl=oracle-openworld&feed=yes&xn_auth=noWhen using decode, don't forg…tag:www.oracleconnections.com,2013-06-10:6612035:Comment:94722013-06-10T09:00:06.634ZLeoma Cheesmanhttp://www.oracleconnections.com/profile/LeomaCheesman
<p>When using decode, don't forget to add <br/> where rownum<2</p>
<p>because if there are multiple records in result set, inner query will throw an error.</p>
<p>When using decode, don't forget to add <br/> where rownum<2</p>
<p>because if there are multiple records in result set, inner query will throw an error.</p> Try using decode. tableName:…tag:www.oracleconnections.com,2013-06-10:6612035:Comment:93932013-06-10T08:59:40.516ZLeoma Cheesmanhttp://www.oracleconnections.com/profile/LeomaCheesman
<p>Try using decode.<br/> tableName: test</p>
<p>select decode((select testId from test),null,1,2) from dual;</p>
<p>If the record set is NULL, you will get 1 as output.<br/> Else you will get 2 as output.</p>
<p>for more info,<br/> <a href="http://eoracle11g.blogspot.com/" target="_blank">http://eoracle11g.blogspot.com/</a></p>
<p>Try using decode.<br/> tableName: test</p>
<p>select decode((select testId from test),null,1,2) from dual;</p>
<p>If the record set is NULL, you will get 1 as output.<br/> Else you will get 2 as output.</p>
<p>for more info,<br/> <a href="http://eoracle11g.blogspot.com/" target="_blank">http://eoracle11g.blogspot.com/</a></p> Thannks for the Suggestion...…tag:www.oracleconnections.com,2013-06-10:6612035:Comment:94692013-06-10T08:58:02.105ZFelix Morethttp://www.oracleconnections.com/profile/FelixMoret
<p>Thannks for the Suggestion...this will solve my problem</p>
<p>But i just want to know that...Isn't there is any other better way to do it.</p>
<p>Thanks</p>
<p>Thannks for the Suggestion...this will solve my problem</p>
<p>But i just want to know that...Isn't there is any other better way to do it.</p>
<p>Thanks</p> why not simply handle the exc…tag:www.oracleconnections.com,2013-06-10:6612035:Comment:96412013-06-10T08:55:16.986ZFrankie Alterhttp://www.oracleconnections.com/profile/FrankieAlter
<p>why not simply handle the exception ?</p>
<p>create procedure xxxx<br/> ...<br/> begin<br/> ....<br/> begin<br/> select whatever into wherever ....<br/> do_something();<br/> exception<br/> when no_data_found then do_something();<br/> when others then raise;<br/> end;<br/> end xxxx;<br/> /</p>
<p>why not simply handle the exception ?</p>
<p>create procedure xxxx<br/> ...<br/> begin<br/> ....<br/> begin<br/> select whatever into wherever ....<br/> do_something();<br/> exception<br/> when no_data_found then do_something();<br/> when others then raise;<br/> end;<br/> end xxxx;<br/> /</p>