Tuesday, March 31, 2009

Excel: Placing the given values in Randomly

1. Enter the number of values in the Column A in rows [A1 to A10].
2. In Column B add random number by inserting the formula =Rand () in
each row up to Column A values [B1 to B10].
3. Select the Both Column
4. In Menu Bar, go to Data>Sort.
5. Sort by Column B, where by the random numbers

You will get the random series values from A1 to A10 in Excel

Javascript code for placing the Array values series in Randomly

<SCRIPT LANGUAGE="JavaScript">
<!--
//Javascript code for placing the Array values series in Randomly
function randno()
{
return (Math.floor(Math.random() * 100));
}

function sortMultiDimensional(a,b)
{
// this sorts the array using the second element
return ((a[1] < b[1]) ? -1 : ((a[1] > b[1]) ? 1 : 0));
}

function randomArrayset(inputValue){
//input Array value
//var inputValue=[0,1,2,3,4,5];

// dynamic 2 dimension array creation
var randomSeries=new Array();
for (i=0; i <inputValue.length; i++)
randomSeries[i]=new Array(1);

for (j=0; j <inputValue.length; j++)
{
//storing the input array values
randomSeries[j][0]=inputValue[j];
//storing the Random values
randomSeries[j][1]=randno();
}

randomSeries.sort(sortMultiDimensional); // sort using our custom function

for (j=0; j <inputValue.length; j++)
{
//storing random sorted to an array
inputValue[j]=randomSeries[j][0];
}

return (inputValue);
}

//intialise the Array to input
var myValue=[0,1,2,3,4,5];
document.write(randomArrayset(myValue));

//-->
</SCRIPT>

Saturday, March 28, 2009

Run PL/SQL statement in SQL*Plus

If you want to run a single PL/SQL statement in SQL*Plus, you need to use
the EXECUTE command as shown in the following tutorial example:

SQL> SET SERVEROUTPUT ON

SQL> EXECUTE DBMS_OUTPUT.PUT_LINE('Welcome to globalguideline!')
Welcome to globalguideline!

PL/SQL procedure successfully completed.

Adobe News