Click here to Skip to main content
15,905,781 members
Home / Discussions / Database
   

Database

 
GeneralRe: Fetching records based on Boolean operators Pin
sumit703414-Mar-08 0:55
sumit703414-Mar-08 0:55 
GeneralRe: Fetching records based on Boolean operators Pin
GDMFSOB14-Mar-08 1:07
GDMFSOB14-Mar-08 1:07 
QuestionTable change Watch In SQL 2000 Pin
GDMFSOB14-Mar-08 0:39
GDMFSOB14-Mar-08 0:39 
GeneralRe: Table change Watch In SQL 2000 Pin
sumit703414-Mar-08 1:01
sumit703414-Mar-08 1:01 
GeneralRe: Table change Watch In SQL 2000 Pin
GDMFSOB14-Mar-08 1:08
GDMFSOB14-Mar-08 1:08 
QuestionHow to call Unmanaged Code from SQL CLR. Pin
ivix4u14-Mar-08 0:18
ivix4u14-Mar-08 0:18 
GeneralRe: How to call Unmanaged Code from SQL CLR. Pin
Mark J. Miller14-Mar-08 6:20
Mark J. Miller14-Mar-08 6:20 
GeneralProblem with Cursor Pin
Vimalsoft(Pty) Ltd13-Mar-08 22:19
professionalVimalsoft(Pty) Ltd13-Mar-08 22:19 
Good Morning All

i have the Following Cursor that Displays data , like this

<br />
SET NOCOUNT ON<br />
Declare @Property_ID int ,<br />
@Lis_key Varchar(12),<br />
@Effective_DAte Datetime,<br />
@Func_key Varchar(12),<br />
@Property_ID2 int ,<br />
@Lis_key2 Varchar(12),<br />
@Effective_DAte2 Datetime,<br />
@Func_key2 Varchar(12)<br />
<br />
Declare Find_Val  Cursor for <br />
select p.Property_ID, p.Lis_key,v.Effective_Date,<br />
p.Func_key from Valuation v<br />
Inner Join Property p <br />
on p.Property_ID = v.Property_ID<br />
where V.Effective_date ='2002/07/01'<br />
And v.Val_Status_ID  = 2<br />
And v.Archive_Date is NUll<br />
And p.Archive_Date is Null<br />
<br />
Open Cursor Find_Val<br />
<br />
FETCH NEXT FROM Find_Val INTO<br />
@Property_ID,<br />
@Lis_key,<br />
@Effective_DAte,<br />
@Func_key<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
SELECT @Property_ID,@Lis_key , @Effective_Date , @Func_key<br />
<br />
--Declare<br />
DECLARE Second_cursor CURSOR FOR <br />
select V.Property_ID, P.Lis_key,v.Effective_Date,<br />
p.Func_key from Valuation v, Property p<br />
where v.Property_ID = @Property_ID<br />
And EFFECTIVE_DATE = '2008/07/01'<br />
<br />
OPEN Second_cursor<br />
<br />
FETCH NEXT FROM Second_cursor INTO<br />
<br />
@Property_ID2,<br />
<br />
@Lis_key2,<br />
<br />
@Effective_DAte2,<br />
<br />
@Func_key2<br />
<br />
IF @@FETCH_STATUS <> 0 <br />
<br />
WHILE @@FETCH_STATUS = 0<br />
<br />
BEGIN<br />
<br />
SELECT @Property_ID2,<br />
<br />
@Lis_key2,<br />
<br />
@Effective_DAte2,<br />
<br />
@Func_key2<br />
<br />
<br />
FETCH NEXT FROM product_cursor INTO <br />
<br />
@Property_ID2,<br />
<br />
@Lis_key2,<br />
<br />
@Effective_DAte2,<br />
<br />
@Func_key2<br />
<br />
END<br />
<br />
CLOSE Second_cursor<br />
<br />
DEALLOCATE Second_cursor<br />
<br />
FETCH NEXT FROM Find_Val into<br />
@Property_ID,<br />
<br />
@Lis_key,<br />
<br />
@Effective_DAte,<br />
<br />
@Func_key<br />
<br />
End <br />
<br />
CLOSE Find_Val<br />
<br />
DEALLOCATE Find_Val<br />


And when i run this Cursor i get the Following Error

Msg 156, Level 15, State 1, Line 21
Incorrect syntax near the keyword 'Cursor'.


And this Points to this line

Open Cursor Find_Val

Thanks

Vuyiswa Maseko,

Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding

VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za


GeneralRe: Problem with Cursor Pin
pmarfleet13-Mar-08 22:31
pmarfleet13-Mar-08 22:31 
GeneralRe: Problem with Cursor Pin
Vimalsoft(Pty) Ltd13-Mar-08 22:42
professionalVimalsoft(Pty) Ltd13-Mar-08 22:42 
General[Message Deleted] Pin
Member 387988113-Mar-08 20:31
Member 387988113-Mar-08 20:31 
GeneralRe: number of days between a given date and current date Pin
soni uma13-Mar-08 20:37
soni uma13-Mar-08 20:37 
GeneralRe: number of days between a given date and current date Pin
flash66513-Mar-08 20:40
flash66513-Mar-08 20:40 
GeneralRe: [Message Deleted] Pin
Colin Angus Mackay14-Mar-08 1:05
Colin Angus Mackay14-Mar-08 1:05 
GeneralRe: [Message Deleted] Pin
Paul Conrad14-Mar-08 15:11
professionalPaul Conrad14-Mar-08 15:11 
GeneralI need query for the employees who joined a weak ago Pin
Satish - Developer13-Mar-08 19:55
Satish - Developer13-Mar-08 19:55 
GeneralRe: I need query for the employees who joined a weak ago Pin
Syed Mehroz Alam13-Mar-08 20:01
Syed Mehroz Alam13-Mar-08 20:01 
GeneralRe: I need query for the employees who joined a weak ago Pin
soni uma13-Mar-08 20:27
soni uma13-Mar-08 20:27 
GeneralRe: I need query for the employees who joined a weak ago Pin
Khawar Abbas113-Mar-08 20:40
Khawar Abbas113-Mar-08 20:40 
Generaladd 30 days from a given date Pin
Member 387988113-Mar-08 19:34
Member 387988113-Mar-08 19:34 
GeneralRe: add 30 days from a given date Pin
Syed Mehroz Alam13-Mar-08 19:57
Syed Mehroz Alam13-Mar-08 19:57 
GeneralRe: add 30 days from a given date Pin
Khawar Abbas113-Mar-08 20:12
Khawar Abbas113-Mar-08 20:12 
GeneralRe: add 30 days from a given date Pin
Member 387988113-Mar-08 20:32
Member 387988113-Mar-08 20:32 
QuestionReference integrity on external ID? Pin
Roger Alsing13-Mar-08 11:07
Roger Alsing13-Mar-08 11:07 
GeneralIgnoring SQL Errors Pin
#realJSOP13-Mar-08 10:44
professional#realJSOP13-Mar-08 10:44 

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.