Saturday 24 June 2017

Number to word convert

Q : Write a program to convert a number into its equivalent word without using character array?

/* ##########################################
     Girfa : Student Help
     Program : Number to word converter
     for more program visit :
   ##########################################*/
#include<stdio.h>
#include<conio.h>
void single(int);
int reverce(int);
void ten(int);
void hundred(int);
void printhundred(int);
void main()
{

Thursday 22 June 2017

Looping With Cursor SQL Server

Cursor is an database object which is use when there is a need to process table record row by row . you can access each field of your table at record by record.In relational databases, operations are made on a set of rows. For example, a SELECT statement returns a set of rows which is called a result set. Sometimes the application logic needs to work with a row at a time rather than the entire result set at once. In T-SQL, one way of doing this is using a CURSOR. For example when we want to get record from one table and need to insert into another with performing some logic or some conditions .For example if we want to get value from one table row by row  and need to perform some logic over that and update /insert into another table then we can use cursors. Cursor basically works as for/While loop.

USE [Girfa_tportal]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter procedure [dbo].[GetStudentContact]
as
begin
Declare @phone as varchar(15)
Declare @email as varchar(50)

Wednesday 21 June 2017

Multiple Return SQL Server Function

Table value function

For return more than value from SQL-Server? To do so you need to make table value function.
A table value function use to return more than one value in the form of table.

USE [Girfa_portal]
GO
/****** Girfa Student Help ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

create FUNCTION [dbo].[getBookIssueFineDay]
(
       @roll int
)
RETURNS  TABLE
as

Tuesday 20 June 2017

SQL Server Function

Function declaration

USE [Girfa_Portal]
GO
/****** Girfa Student Help******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER FUNCTION [dbo].[getBookStock] (@bookcod varchar(50))

RETURNS int
AS