Case Statement Snippets


22 September, 2012   

Javascript code to convert a string to all upper or lowercase

An example PHP function return a value, use the return statement.

27 April, 2013   

PHP code for Fast Triangular Numbers

01 December, 2011   

The following code block shows how to run DML statements in PL/SQL. Basically they look similar to the SQL. Note that the SELECT statement retrieves the single-row value and store into a variable using INTO clause.

If we wanted to select only certain entries of our table, then we would use the WHERE clause .

Several hundred user notes on the str_replace page later, and we have a function that provides a variety of text highlighting options for plaintext or HTML strings.

16 November, 2013   

This function lets you check whether an date event should recur on a specified date. This is handy for calendar, billing and reminder applications.

In this example we will select everything in our table "example" and put it into a nicely formatted HTML table.

20 August, 2011   

Source code for C++ program printing various data to the console.

14 May, 2011   

This is a general code to use when updating an item from a MySQL database. This code isn't considered definitive and can be written in many varied ways. Note: This code requires you to connect to the MySQL database to work. Also, all field and table names need to be set up to match.

07 August, 2014   

All hints except /*+ rule */ cause the CBO to be used. Therefore, it is good practise to analyze the underlying tables if hints are used (or the query is fully hinted.

When creating a new object, pass the initial variables as an array. Then use this code to quickly assign the array vars to the class vars. This will mean importing large arrays into the object in three lines of code.

19 February, 2012   

Throwtest an application that demonstrates how to define, throw, and handle exceptions. This application doesn't do anything other than print out some text, but if you might want to study it and play around with it to learn more about how exceptions work in Java. See the usage instructions in the source code.

Note that to add a new column to the query, just add in an input box to the HTML, the PHP generates an insert for each field.

I would like to find the position of the last occurrence of a character in a string and print every thing after that.

23 January, 2013   

Adjusted for daylight saving or standard time as appropriate.

09 May, 2011   

This is a general code to use when inserting an item from a MySQL database. This code isn't considered definitive and can be written in many varied ways. An extention of this code would be to make sure the entry you are adding to the database doesn't already exist (to save dupicate entries). Note: This code requires you to connect to the MySQL...

Have you ever wanted to know how much memory one of your PHP scripts uses when it runs? You might want this information if your script has a memory leak or takes a long time to execute. If that's the case then there's a great built-in function called memory_get_usage, which will display the exact amount of memory being used by your script. This...

17 December, 2011   

We can use the following SELECT statement with AND & OR Operators

10 August, 2011   

Url Encode is a technique employed in order to convert a string used in a URL into a valid URL forma and decode url