Click here to Skip to main content
15,909,051 members
Home / Discussions / Database
   

Database

 
GeneralRe: Schema in SQL2005 Pin
Mike Dimmick29-Jun-06 2:50
Mike Dimmick29-Jun-06 2:50 
QuestionComplete mySQL Database Backup!!! Pin
Rana Muhammad Javed Khan28-Jun-06 0:43
Rana Muhammad Javed Khan28-Jun-06 0:43 
AnswerRe: Complete mySQL Database Backup!!! Pin
Reza Raad28-Jun-06 1:32
Reza Raad28-Jun-06 1:32 
GeneralRe: Complete mySQL Database Backup!!! Pin
Rana Muhammad Javed Khan28-Jun-06 2:24
Rana Muhammad Javed Khan28-Jun-06 2:24 
AnswerRe: Complete mySQL Database Backup!!! Pin
Reza Raad28-Jun-06 2:31
Reza Raad28-Jun-06 2:31 
AnswerRe: Complete mySQL Database Backup!!! Pin
Aby Thomas Varghese28-Jun-06 7:38
Aby Thomas Varghese28-Jun-06 7:38 
GeneralRe: Complete mySQL Database Backup!!! Pin
Rana Muhammad Javed Khan28-Jun-06 18:37
Rana Muhammad Javed Khan28-Jun-06 18:37 
QuestionJava function code to SQL Server function Pin
GBal27-Jun-06 21:37
GBal27-Jun-06 21:37 
Hi every body,
i got the java code for generation of some code based on 2 inputs..i need to
convert into sql server function..?? i was tried but getting some syntax errors..pls have a look below...and thanks in advnace..
------------------------------------------------------------------------------
CREATE FUNCTION getGridNum (@ref1 bigint,@ref2 bigint)
RETURNS bigint AS
BEGIN
declare @gridA bigint
DECLARE @gridB bigint
DECLARE @osGridNum1 bigint
DECLARE @osGridNum2 bigint
DECLARE @osGridReference bigint



--@osGridNum1 = @REF1 -- for use later to get number section of the grid ref
--@osGridNum2 = @REF2 -- for use later to get number section of the grid ref

/*get the first number of the number of the
grid reference and concat '00000' so it can be c
compared in the lookup table - unless it is '0'*/


--if (gridA.length < 5)
if len(@REF1)<5


begin
-- @REF1 ='0' + @REF1
@REF1 = '0' + CAST(@REF1 AS VARCHAR(10))
--- gridA = @REF1.substring(0,1)
@REF1 = substring(@REF1,0,1)
end
else
begin
if (gridA != '0')
gridA = gridA + '00000'
end


/*get the second number of the number of the
grid reference and concat '00000' so it can be c
compared in the lookup table - unless it is '0'*/

-- if (gridB.length < 5)
if len(gridB)<5
begin
gridB ='0' + gridB
-- gridB = gridB.substring(0,1)
gridB = substring(gridB,0,1)


end
else
begin
if (gridB != '0')
gridB = gridB + '00000'
end


-- send substringed letter to searchLetter function to find the corresponding OS grid letters

oSgridLetter = searchLetters(gridA, gridB)

/*The next if statements take the oringinal numbers and substring them to get
valid numbers for the OS grid format. Of five numbers it is the middle 3*/


--if (osGridNum1.length < 5)
if len(osGridNum1) < 5

begin
osGridNum1 = '0' + osGridNum1
-- osGridNum1 = osGridNum1.substring(1,4)
osGridNum1 = Substring(osGridNum1,1,4)
end

--if (osGridNum2.length < 5)
if len(osGridNum2) < 5

osGridNum2 = '0' + osGridNum2
-- osGridNum2 = osGridNum2.substring(1,4)
osGridNum2 = substring(osGridNum2,1,4)

-- Now concatinate the Letters and the the OS letters and the two sets of os grid numbers together to get the correct formate

osGridReference = oSgridLetter + osGridNum1 + osGridNum2
return osGridReference

end
END
----------------------------------------------------------------------

Server: Msg 170, Level 15, State 1, Procedure getGridNum, Line 26
Line 26: Incorrect syntax near '@REF1'.
Server: Msg 170, Level 15, State 1, Procedure getGridNum, Line 33
Line 33: Incorrect syntax near 'gridA'.
Server: Msg 170, Level 15, State 1, Procedure getGridNum, Line 44
Line 44: Incorrect syntax near 'gridB'.
Server: Msg 170, Level 15, State 1, Procedure getGridNum, Line 53
Line 53: Incorrect syntax near 'gridB'.
Server: Msg 170, Level 15, State 1, Procedure getGridNum, Line 69
Line 69: Incorrect syntax near 'osGridNum1'.
Server: Msg 170, Level 15, State 1, Procedure getGridNum, Line 77
Line 77: Incorrect syntax near 'osGridNum2'.
AnswerRe: Java function code to SQL Server function Pin
Colin Angus Mackay27-Jun-06 22:12
Colin Angus Mackay27-Jun-06 22:12 
GeneralRe: Java function code to SQL Server function Pin
GBal27-Jun-06 23:44
GBal27-Jun-06 23:44 
GeneralRe: Java function code to SQL Server function Pin
Colin Angus Mackay28-Jun-06 5:47
Colin Angus Mackay28-Jun-06 5:47 
QuestionSQL Script Pin
Subramaniam s.V.27-Jun-06 19:44
Subramaniam s.V.27-Jun-06 19:44 
AnswerRe: SQL Script Pin
Igor Sukhov27-Jun-06 20:35
Igor Sukhov27-Jun-06 20:35 
AnswerRe: SQL Script Pin
Colin Angus Mackay27-Jun-06 20:58
Colin Angus Mackay27-Jun-06 20:58 
GeneralRe: SQL Script Pin
Subramaniam s.V.27-Jun-06 21:44
Subramaniam s.V.27-Jun-06 21:44 
GeneralRe: SQL Script Pin
Colin Angus Mackay27-Jun-06 21:49
Colin Angus Mackay27-Jun-06 21:49 
AnswerRe: SQL Script Pin
Edbert P28-Jun-06 13:30
Edbert P28-Jun-06 13:30 
QuestionNeed a way to jump to record. Pin
PyroManiak27-Jun-06 10:29
PyroManiak27-Jun-06 10:29 
AnswerRe: Need a way to jump to record. [modified] Pin
PyroManiak27-Jun-06 10:41
PyroManiak27-Jun-06 10:41 
GeneralRe: Need a way to jump to record. Pin
Alexander Wiseman27-Jun-06 11:51
Alexander Wiseman27-Jun-06 11:51 
GeneralRe: Need a way to jump to record. [modified] Pin
PyroManiak27-Jun-06 13:10
PyroManiak27-Jun-06 13:10 
GeneralRe: Need a way to jump to record. [modified] Pin
PyroManiak27-Jun-06 13:39
PyroManiak27-Jun-06 13:39 
GeneralOT Pin
Colin Angus Mackay27-Jun-06 20:51
Colin Angus Mackay27-Jun-06 20:51 
GeneralRe: OT Pin
PyroManiak28-Jun-06 6:24
PyroManiak28-Jun-06 6:24 
QuestionStored proc call - passing a parameter [modified] Pin
IMC200627-Jun-06 7:15
IMC200627-Jun-06 7:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.