Tuesday, April 2, 2013

HTML5 with Sql database


I have created the sql database in HTML5 page .  it supports latest browsers like ie ,chrome
It is very simple and useful


There are three core methods in the spec that I’m going to cover in this article:
openDatabase
transaction
executeSql

I’ve passed four arguments to the openDatabase method. These are:
Database name
Version number
Text description
Estimated size of database  -  size might be 5Mb to 500 Mb. it varies on browser

executeSql

This is the funnel of love for all your SQL goodness. executeSql is used for both read and write statements, includes SQL injection projection, and provides a callback method to process the results of any queries you may have written.
Once we have a transaction object, we can call executeSql:
var db = openDatabase('mydb', '1.0', 'my first database', 2 *1024 * 1024);
db.transaction(function (tx) {
  tx.executeSql('CREATE TABLE foo (id unique, text)');
});

Example is below









Status Message



Tuesday, March 19, 2013

prime number storedprocedure in SQL



Create procedure guna  @testprime int

as

begin

declare @i int
declare @reminder int
declare @messgae varchar(10)
set @messgae='Prime'
set @i=2

while (@i<@testprime)
begin

select  @reminder=@testprime%@i

if(@reminder=0)
begin
set @messgae='not prime'
break
end

set @i=@i+1
end

select @messgae

end



exec guna 4