Sunday, October 31, 2010

What is the Difference between Stored Procedure and Trigger ?

stored procedure
stored procedure is a block of code contains sql statements.
stored procedure is a precompiled block of code,which need not be compiled for every time calling.Stored procedure used to perform operation.Stored procedure can accept the parameters from users

Triggers
Triggers get invoked automatically when any operation (insertion,deletion and updation) is performed on particular table.
Triggers can't return any value.So user have no control over it's invocation.
Triggers need to define and can be enable and disable according to need.

How we get second highest salary in database. Please show me this coding.

1)Select max(salary) from employee where salary!=(select max(salary) from employee);
(OR)
2)Select max(salary)from employee where salary < (select max(salary) from employee)
OR)
3)Select max(sal) from employee where sal not in(select max(sal) from employee)

What are the advantages and disadvantages of primary key and foreign key in SQL?

1) primary key will not allow null values, foreign key will allow null values

2) primary key is unique key on which all the other candidate keys are functionally dependent. Foreign Key allows refrencing another table using the primary key for the other table

Friday, November 27, 2009

Cfimage tag functions

* ImageAddBorder()
* ImageBlur()
* ImageClearRect()
* ImageCopy()
* ImageCrop()
* ImageDrawArc()
* ImageDrawBeveledRect()
* ImageDrawCubicCurve()
* ImageDrawLine()
* ImageDrawLines()
* ImageDrawOval()
* ImageDrawPoint()
* ImageDrawQuadraticCurve()
* ImageDrawRect()
* ImageDrawRoundRect()
* ImageDrawText()
* ImageFlip()
* ImageGetBlob()
* ImageGetBufferedImage()
* ImageGetEXIFTag()
* ImageGetHeight()
* ImageGetIPTCTag()
* ImageGetWidth()
* ImageGrayscale()
* ImageInfo()
* ImageNegative()
* ImageNew()
* ImageOverlay()
* ImagePaste()
* ImageRead()
* ImageReadBase64()
* ImageResize()
* ImageRotate()
* ImageRotateDrawingAxis()
* ImageScaleToFit()
* ImageSetAntialiasing()
* ImageSetBackgroundColor()
* ImageSetDrawingColor()
* ImageSetDrawingStroke()
* ImageSetDrawingTranspare()
* ImageSharpen()
* ImageShear()
* ImageShearDrawingAxis()
* ImageTranslate()
* ImageTranslateDrawingAxi()
* ImageWrite()
* ImageWriteBase64()
* ImageXORDrawingMode()