(no subject)

"Prakash Jattani" <[email protected]> Mon, 15 Sep 2003 12:59:05 +0530
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
<html><div style='background-color:'><DIV>hi thomas,</DIV>
<DIV>&nbsp;</DIV>
<DIV>sorry to bother you again but i am still having 2 more problems. it would be grateful if you help me out.</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. The query below is selecting the max value from the table. The table can be blank so it will return me a null value which i need to set to 0. How do i do it?<BR>Here's a sample query i am using in Oracle :</DIV>
<DIV>&nbsp;</DIV>
<DIV>select (nvl(max(To_Number(vdocno)),0)) into ls_docno from ABC;</DIV>
<DIV>What is the keyword for nvl in sapdb.</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. I need to create a dynamic query which has to be executed in a procedure.How do i do it?<BR>Here's a sample i have created in sapdb : </DIV>
<DIV>set ls_sql&nbsp; = 'Insert into ' ||ls_tablename|| '(CTAGID,CREDIT) VALUES(' || '''' ||&nbsp; ls_tagid || '''' || ',' || '' ||&nbsp; li_credit || '' || ')';<BR>EXEC SQL EXECUTE IMMEDIATE :ls_sql;</DIV>
<DIV>&nbsp;</DIV>
<DIV>The error i am getting is </DIV>
<DIV>Syntax error or access violation;-5015 POS(1530) Missing keyword:WHILE,SELECT,IF,EXECUTE,CALL,SET,RETURN,FETCH,DECLARE.</DIV>
<DIV><BR>Regards,<BR>Prakash.</DIV></div><br clear=all><hr>The hottest things. The coolest deals. <a href="http://g.msn.com/8HMOENIN/2740??PS=">Get them online!</a> </html>