Monday, 18 March 2013

PLSQL Operators

PL SQL Operators Relational operators compare two expressions or values and return a Boolean result. PL/SQL supports operators like =, <, >, <=, >=, <>, !=, ~=, ^=, IS NULL, LIKE, BETWEEN, IN Operator Meaning = equal to <>, !=, ~=, ^= not equal to < less than > greater than <= less than or equal to >= greater than or...

Tuesday, 12 March 2013

PLSQL Modulo 11 check...

What is Modulo 11 check? MSI was developed by the MSI Data Corporation, based on the original Plessey Code. MSI, also known as Modified Plessey, is used primarily to mark retail shelves for inventory control. MSI is a continuous, non-self-checking symbology. While the length of an MSI bar code can be of any length, a given application usually implements a fixed-length code.  A typical MSI bar code is MSI, and other symbologies based...

Monday, 11 March 2013

PLSQL backup time...

PL SQL package backup tutorial I started this project because i needed program that will easily back up my files from developer without clicking on package and exporting it to save my work... Second i wrote it because there is Bug in SQL DEVELOPER that causes lines to be messed up  when you have large code... Example: You have large code and export it with right click on package name and select save specs and body Real code is written like...

Sunday, 10 March 2013

PLSQL - Decoding time

 PL SQL Decode Function Some of my friends told me to write something about famous decode :) So here it goes .... What is decode? Decode is implemented function that has the functionality of an IF THEN ELSE statement. But there is one major difference between implementing these two functionality. DECODE can only work in select statement.You need to have in mind that DECODE is supported only in SQL Context so you don't really working with...

Friday, 8 March 2013

PLSQL check my email adress...

PL SQL Code for checking mail adress So you want to put some security check on you're mail input field... As you know mail can consist letters, numbers and dots.... It must contain only one @ sign... How would you check you're email? I do check on two different ways No1. Simple way of checking allowed signs in mail function f_emailok (i_email in varchar2) return boolean is  l_dot    NUMBER;  l_at     NUMBER;  l_length NUMBER;BEGIN  l_dot    := instr(i_email ,'.'); ...

PLSQL iso7064 MOD 97,10 check

What is iso7064? Check wikipedia It is standard for checking accounting number on Credit cards, Resident Identity Card etc.... Rules for checking Mod97,10 (iso7061) are: This scheme produces two digits as a check. And as a result, it catches just about every possible error. If you can afford the extra digit, this system is superior to the dihedral check. It also has an especially compact formula. The check digits are given by mod(98 - mod(data * 100, 97), 97) and the verification is just mod(data_check,97) == 1. In practice an alternate algorithm...

Thursday, 7 March 2013

PLSQL what day is it?

PLSQL what day is it Say that for some reason you need name of the day for certain reason... You can create function that will return name of the day of specified date.... function f_name_of_the day (i_date) return varchar2 asl_day varchar2(50):=null;begin   SELECT TO_CHAR( trunc(to_date( to_char(to_date(i_date,'YYYYMMDD')) )),'day') into l_day FROM DUAL;   return(day);end f_name_of_the day ; So what does this function do? You...

Wednesday, 6 March 2013

PLSQL numeric check

PL SQL numeric check Assuming that you need some function to check input from the front-end and you want to assure that input is numerical data, you can do it by simple function that has one input parameter and is returning false or true... So here it goes... Function F_numeric_val (i_value IN VARCHAR2) return boolean is l_num NUMBER; BEGIN          l_num := to_number(i_value);        ...