Monthly Archives: January 2011

Visual Studio – Add Double Quotes To Text

C# string sText = “This expample shows how to add double quotes to text.”; sText = “\”” + sText + “\””; Visual Basic Dim sText As String = “This expample shows how to add double quotes to text.” sText =

Tagged with: , , ,
Posted in Visual Studio Code Examples

SQL – Select Top N From

Select Top N from SQL Server Oracle RowNum pseudocolumn. SQL Server and Oracle allow you to run a Select Statement, but limit the number of rows returned. This is very useful if you just need to see a snapshot of

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Replace Statement

REPLACE STATEMENT The Replace Statement replaces all instances of a specified string value with a new value. Syntax: REPLACE(Field Name, Search String, New String) SQL Server: SELECT REPLACE(FIELD1,’/’,’-‘) FROM TABLE Oracle: SELECT REPLACE(FIELD1,’/’,’-‘) FROM TABLE;  

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Character Case Functions

Character Function – Returns the Character from a given character code SQL Server SELECT CHAR(65) + CHAR(66) + CHAR(67) Returns ABC Oracle: SELECT CHR(65) || CHR(66) || CHR(67) FROM dual; Returns ABC  

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Char Function

Character Function – Returns the Character from a given character code SQL Server SELECT CHAR(65) + CHAR(66) + CHAR(67) Returns ABC Oracle: SELECT CHR(65) || CHR(66) || CHR(67) FROM dual; Returns ABC  

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Concatenate

Concatenate Note, when joining two or more fields together, both fields must be a string value. If one of the fields is a numeric value, the numeric field must be converted to a string. SQL Server: SELECT Emp_LastName + ‘,

Tagged with: , , , ,
Posted in Oracle, SQL Server

SQL – Length Function

LENGTH FUNCTION The length function returns an integer value representing the length of the selected field or given value. SQL Server SELECT LEN(‘WORD’) Returns 4 Oracle SELECT LENGTH(‘WORD’) FROM DUAL; Returns 4  

Tagged with: , , , ,
Posted in Oracle, SQL Server