Oracle forms passing parameters to a ‘DEFAULT_WHERE’ clause

You may need to pass multiple parameters pragmatically prior executing a query with a block many times while users are provided with multiple parameter choices, here is an example explaining how deal with different kind of parameters(strings, numeric values & date)

if :ctrl.nulls_only = 'N' then
	
SET_BLOCK_PROPERTY('LINES',DEFAULT_WHERE, 
'ACCOUNTING_DATE BETWEEN NVL('||''''||:CTRL.START_DATE||''''||',ACCOUNTING_DATE) 
AND NVL('||''''||:CTRL.END_DATE||''''||',ACCOUNTING_DATE)' ||
' AND ATTRIBUTE1 IS NOT NULL AND ATTRIBUTE1=NVL('||''''||:CTRL.BEN_WHO||''''||',ATTRIBUTE1) 
AND MAIN_ACCOUNT=NVL('||''''||:CTRL.MAIN_ACCOUNT||''''||',MAIN_ACCOUNT)');

/* where string and date parameters are passed in as strings and numeric parameters are passed in as numeric values. If you have to do NVL with NUMERIC values, you must pass it as a string by enclosing single quotes around it. Check the MAIN_ACCOUNT example above*/
elsif :ctrl.nulls_only = 'Y' then

SET_BLOCK_PROPERTY('LINES',DEFAULT_WHERE, 
'ACCOUNTING_DATE BETWEEN NVL('||''''||:CTRL.START_DATE||''''||',ACCOUNTING_DATE) 
AND NVL('||''''||:CTRL.END_DATE||''''||',ACCOUNTING_DATE)' ||'AND ATTRIBUTE1 IS NULL');

end if;

GO_BLOCK('LINES');

EXECUTE_QUERY;

Passing parameters to DEFAULT_WHERE could become complex with additional scenarios when an in-line query should be passed in. Give it a try,  and we hope the above example gives a budding programmer a good starting.

Regards,

Rajesh

Windows 7 “no internet access” false message

We lost the count of discussions initiated through this blog, every time there was another “reason” for this false message with Windows 7. After using Windows 7 more than couple of years time, recently we noticed this false message being an annoyance once again with few of the dell desktop machines we started using at work.

Loads of googling around brought us to a topic which discussed about AVG blocking Windows network awareness service and further dwelling into the topic proved that, any Anti-virus with a built-in firewall capability could indirectly affect the above said service, thus causing “no Internet access” false message. At work we use symantec endpoint as corporate solution and Avast Internet security suite with few client systems which are dominantly used for Oracle development.

Somehow, Symantec end point suite always disliked Oracle forms developer suite(s) and we were forced to switch to Avast suite for those users who are into Oracle development.

Back to the topic, following a tip obtained from google search, we did the following

Avast -> settings -> Troubleshooting-> and checked “load avast services only after loading other services” and bingo! no more false messages, no more yellow triangle with network connection icon.