Click here to Skip to main content
15,892,269 members
Home / Discussions / Database
   

Database

 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 0:05
Jay Royall22-Jan-09 0:05 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Wendelius22-Jan-09 0:13
mentorWendelius22-Jan-09 0:13 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 0:21
Jay Royall22-Jan-09 0:21 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Wendelius22-Jan-09 0:29
mentorWendelius22-Jan-09 0:29 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Ennis Ray Lynch, Jr.22-Jan-09 6:23
Ennis Ray Lynch, Jr.22-Jan-09 6:23 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 6:31
Jay Royall22-Jan-09 6:31 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Ennis Ray Lynch, Jr.22-Jan-09 6:36
Ennis Ray Lynch, Jr.22-Jan-09 6:36 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 9:38
Jay Royall22-Jan-09 9:38 
Thanks for your response. I understand your concern about cursors but unfortunately I don't think your idea is going to work. The reason is because the insert statement is inserting a record with a sequence which isn't a multiple of 10, i.e. 15, 25, 35 etc. This then means that the newly inserted record is in the right place accoring to sequence number. The cursor then gets all the records ordered by sequence, and updates them back to numbers divisible by 10, including the newly inserted record (obviously, the sequence doesn't have to be multiples of 10, it could of easily have been 2, but still).

Again, I realise that cursors are not a good idea but I don't see any other way around it (other than doing it from my VB.NET application with multiple database calls which definately isn't a good idea). Also, there are going to be at most 30 records in this table so I thought that using a cursor wouldn't be too much of a problem.

Like I said, I am fairly new to this so any other suggestions you may have are welcomed.
GeneralRe: Insert query and Cursor in same stored procedure Pin
Ennis Ray Lynch, Jr.22-Jan-09 9:46
Ennis Ray Lynch, Jr.22-Jan-09 9:46 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 9:52
Jay Royall22-Jan-09 9:52 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Wendelius22-Jan-09 9:50
mentorWendelius22-Jan-09 9:50 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 9:56
Jay Royall22-Jan-09 9:56 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Wendelius22-Jan-09 10:05
mentorWendelius22-Jan-09 10:05 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall22-Jan-09 21:31
Jay Royall22-Jan-09 21:31 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Wendelius22-Jan-09 21:36
mentorWendelius22-Jan-09 21:36 
AnswerRe: Insert query and Cursor in same stored procedure [modified] Pin
omlac21-Jan-09 23:35
omlac21-Jan-09 23:35 
GeneralRe: Insert query and Cursor in same stored procedure Pin
Jay Royall21-Jan-09 23:51
Jay Royall21-Jan-09 23:51 
QuestionReading html into a Sql Server Report Pin
omlac21-Jan-09 22:37
omlac21-Jan-09 22:37 
Questionconversion from access to oracle-select ? Pin
premprakashbhati21-Jan-09 22:09
premprakashbhati21-Jan-09 22:09 
AnswerRe: conversion from access to oracle-select ? Pin
Wendelius21-Jan-09 22:39
mentorWendelius21-Jan-09 22:39 
QuestionIIf In SQL Compact Edition 3.5 Pin
VinothRao21-Jan-09 20:54
VinothRao21-Jan-09 20:54 
AnswerRe: IIf In SQL Compact Edition 3.5 Pin
Ashfield21-Jan-09 20:59
Ashfield21-Jan-09 20:59 
GeneralRe: IIf In SQL Compact Edition 3.5 Pin
VinothRao21-Jan-09 21:17
VinothRao21-Jan-09 21:17 
GeneralRe: IIf In SQL Compact Edition 3.5 Pin
Ashfield21-Jan-09 22:56
Ashfield21-Jan-09 22:56 
QuestionSql Script to Pull Records Based on Specific Date within A Year Pin
dboy22121-Jan-09 3:10
dboy22121-Jan-09 3:10 

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.