Click here to Skip to main content
15,892,298 members
Everything / Cursor

Cursor

cursor

Great Reads

by Bertus Bever
Suppressing key and mouse events while loading
by DiponRoy
Creating or using cursor in SQL-Server, Oracle, MySQL, PostgreSQL databases
by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
by Ed Gadziemski
An updated version of the WTL BmpView sample application using an OLE Picture object to handle multiple image types

Latest Articles

by DiponRoy
Creating or using cursor in SQL-Server, Oracle, MySQL, PostgreSQL databases
by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
by Bertus Bever
Suppressing key and mouse events while loading
by Ed Gadziemski
An updated version of the WTL BmpView sample application using an OLE Picture object to handle multiple image types

All Articles

Sort by Score

Cursor 

10 Feb 2012 by Bertus Bever
Suppressing key and mouse events while loading
25 Oct 2011 by OriginalGriff
The problem is not that you need to offset anything, it is that you are doing it at the wrong time. This is a bit difficult to get your head round, but fundamentally you either need to know how the .NET framework (and Windows) works a bit better, or change the way you are doing things.The...
18 Dec 2011 by Sergey Alexandrovich Kryukov
You should use System.Console.ReadKey(true), but in a separate thread, that's it. This call will block the calling thread until some key is hit, and no feedback will be shown, thanks to this method's parameters. Another thread will show output without pause. Pretty simple.I'm not sure...
26 Sep 2012 by Santhosh Kumar Jayaraman
why cant you just say insert into newtable( field1,field2) select field1,field2 from inserted
16 Feb 2015 by Richard MacCutchan
At a brief glanceico == Icon.FromHandle(bmp.GetHicon); // error should not be "=="// should be ico = Icon.FromHandle(bmp.GetHicon);However, your title mentions Visual Basic so there may be other issues. Please edit your question and explain exactly what error you see.
14 Sep 2015 by Member 11377180
Please check my below procedure. Expected output is 14 rows. I get it when I run the inner query(inside cursor). But when I run the entire procedure,it gives 28 rows,i.e one set 1 to 14 again same result set from 1 to 14. Expected set of 14 rows is shown twice one below other.Pls suggest the...
27 May 2019 by DiponRoy
Creating or using cursor in SQL-Server, Oracle, MySQL, PostgreSQL databases
11 Feb 2024 by Ralf Meier
When seeing your Solution I want to suggest you some little modifications : Private Sub Button7_Click(sender As System.Object, e As System.EventArgs) Handles Button7.Click Cursor.Position = GetCenterOfControl(Button6) End Sub ...
5 Sep 2012 by prashant patil 4987
Hii,I think you forgot to select declaration part of this cursor, thats why error occured.You must select All cursor and then excecute.it will excecute successfully.Becoz i had done this it was run successfuly.Good luck
5 Jun 2013 by Maciej Los
Try this (no cursor):DECLARE @tbl TABLE(id INT, [CurentStock] DECIMAL(8,2), UnitPrice DECIMAL(8,2))INSERT INTO @tbl (id, [CurentStock], UnitPrice)SELECT 16 AS id, 20.00 AS [CurentStock], 0.25 AS UnitPriceUNION ALL SELECT 16, 120.00, 0.32UNION ALL SELECT 16, 30.00, 0.35SELECT...
24 Oct 2013 by Mike Meinz
The Fetch retrieves the data. You do not want to use the data until within the While loop in case there is no data returned. Also, you need a FETCH NEXT at the bottom of the While loop.DECLARE trancur cursor FAST_FORWARD For SELECT t.ExpCom*t2.SplitPerc, ...
6 Jan 2014 by Jörgen Andersson
You can't, a cursor is a read only pointer to a result set, so you're creating a new cursor (pointer to a result set) every time you open itOne way around is to use a union and create and execute it as a string like:x := 'open cur for 'loop x := x || 'Select something from dual ' x...
28 Sep 2014 by Adnan Malikk
You can create a Temp table for keeping the company ID. And then can use a while loop for looping to every ID in there. Please refer this link for more detailshttp://www.sqlbook.com/SQL/Avoiding-using-SQL-Cursors-20.aspx
25 Apr 2016 by Dave Kreskowiak
First, the hardware has to support it.Second, Windows does not support multiple mouse pointers itself. Your code CAN support multiple mice but your code has to handle all of the raw mouse messages coming from the drivers, handle all of the mouse position tracking, handle all of the mouse...
25 Apr 2016 by Philippe Mori
This question was asked on Stack overflow:Multiple mouse cursors on Windows 7 - Stack Overflow[^]One option is: Welcome to MultiPoint Mouse SDK[^]You can download it here: Download Windows MultiPoint Mouse Software Development Kit 1.5.1 from Official Microsoft Download Center[^]By...
23 May 2016 by CHill60
As @ZafaSultan has pointed out, there is an error with PRINT 'in cursor MsgId : ' + (VARCHAR(50), @msgid)Quote:'VARCHAR' is not a recognized built-in function name.It should readPRINT 'in cursor MsgId : ' + CAST(@msgid AS VARCHAR)You are saying it is "unresponsive" but you only have PRINT...
21 Jul 2022 by Maciej Los
If i'm not wrong, you should use OnToolMouseMove(MapViewMouseEventArgs e) event with _trackingMouseMove = TrackingState.TrackingMove More: MouseMove Event - ArcGIS Resources[^]
12 Jul 2011 by Roliking
Hello All, I want to set a cursor to a stored procedure which executes my select statement instead of directly setting it to a select statement, how can i do this?I want to have only one cursor and set it to different stored procedures depending on some condition, there are two ways...
12 Jul 2011 by Reiss
I am not sure what you actually want to achieve, but since you are using SQL2008 have you checked whether using a CTE is a better approach than a cursor? MSDN CTE[^]
20 Nov 2011 by sushant1125
I am using a stored procedure and in that procedure I am using a cursor to get some values from a table. can I use this cursor as out parameter in stored procedure. if yes then how can i get the values from this cursor into a java program? thank you.[Edited]Corrected Minor Spelling...
20 Nov 2011 by TorstenH.
You can set up a SelectionListener[^]. The SelectionListener will react on a click/doubleclick and provide via Event.getSource() the destination.Pretty simple, just read the tutorial I linked to.
1 Jan 2012 by ArunBose
I have a Stored Procedure with CURSOR which takes around 3 minutes to run. It works fine in the Management Studio, but not in my Application.I have increased its command timeout to 600. Now, Sometimes I gets full results into the Application(When I am executing the procedure 4 or 5 times)Can...
20 Dec 2011 by Al Moje
Hi,See this link if could help...How set CommandTimeout and ConnectionTimeoutRegards,
21 Dec 2011 by Wendelius
The problem may be insufficient indexing, possibly locking issues, badly formed SQL etc.Try to use SSMS Activity monitor to see that no locks interfere: http://msdn.microsoft.com/en-us/library/ms175518.aspx[^]And optimize the query and/or the underlying tables/indexes. Without seeing the...
1 Jan 2012 by AmitGajjar
Hi,if your cursor is Forward_Only(least restrictive) then you need to check something else. please let us know what you have written in your cursor,Please check Cursor Type and check which type of cursor is best suite in your logic. hope using proper type you can solve your...
27 Jan 2012 by chefsponk
I want to draw the default animated cursor (hourglass in XP, circle since vista) on a form.Theoretically, this is no problem using LoadCursor(NULL, IDC_WAIT) and DrawIconEx with the special parameter istepIfAniCur.My problem is: How to determine the number of frames of such a system cursor...
14 May 2012 by Sergey Alexandrovich Kryukov
No, you don't really need to move a cursor outside of the screen. Possible or not does not matter. If the cursor is "outside the screen" (what should it mean, by the way?), you should not use its location, so it does not matter if it's possible or not.However, if you think that you can...
25 Jul 2012 by Dave Kreskowiak
The numbers are wrong because you have Word Wrap turned on. A line in a TextBox is not the visible lines on the screen. A line is terminated by hitting Enter.Notice in Notepad that if View->Word Wrap is turned on, the Status Bar is turned off and it's probably for this very reason.The...
5 Sep 2012 by Rashid Choudhary
i have error massege in sql query.msg isMsg 137, Level 15, State 2, Line 1Must declare the scalar variable "@emp_name".Msg 137, Level 15, State 2, Line 3Must declare the scalar variable "@emp_name".Msg 137, Level 15, State 2, Line 4Must declare the scalar variable "@emp_add".Msg...
5 Sep 2012 by Arul R Ece
Hi Rashid,Please check the @emp_name,emp_add .I have try same query for another table.but i got answerPlease check.declare @taskid varchar(40)declare @asssto varchar(40)---define cursordeclare cursor_employee cursor forselect taskid,asssto from tasklist---open a...
5 Sep 2012 by Santhosh Kumar Jayaraman
The code is perfectly working. I believe you have forgot to include these lines when executing or commented it.declare @emp_name varchar(40)declare @emp_add varchar(40)
21 Sep 2012 by VIPR@T
Hi, You can user the cursor for your desired output.first create cursor to fetch all your employee.to fetch the latest record use top 1 order by date and use that data to increment.The following link will show you how to use...
26 Sep 2012 by Belial09
Hello,is there any chance of creating a trigger like this one:CREATE TRIGGER tri_Test ON TESTTABLE FOR UPDATE NOT FOR REPLICATION AS SET NOCOUNT ON BEGIN DECLARE @Field1 varchar(31) DECLARE @Field2 bigint SELECT @Field1 = Field1...
14 Oct 2012 by Anil Dalsaniya
I have database with filled records like :Sr ExpName Date Camt Tamt--- --------- ----------- ----- -----1 Pen 10-10-2012 10 102 abc 10-10-2012 30 453 xyz 11-10-2012 15 554 ggg 11-10-2012 20...
15 Oct 2012 by Member 8172875
set ANSI_NULLS ONset QUOTED_IDENTIFIER ONGOalterProcedure [dbo].[abcde](@pErrFlagChar(1) Output,@pErrDescVARCHAR(500) Output)ASBeginBeginTryDECLAREEMPCUR CURSOR FORSELECTPriority_No, Pay_Band, Grade_Pay, Basic_Pay, DA,...
15 Oct 2012 by Bhushan Shah1988
Please provide table structure of UCMS_PTECH_MED_SALARY.so we can find where the exact error comes.
15 Oct 2012 by MT_
Hi, You are trying to reinsert record with same priority_no.If you need a new record with all other values updated, don't mark priority_no as PK. You can add a new column ID and mark it alone (or along with priority_no as composite) PK.Else if you just need to udpate data other than...
15 Oct 2012 by AmitGajjar
Hi,What i believe is you are doing some calculation inside the cursor and then you need to update DA and Transp_Alwnc for that record. Here are some issues with your stored procedure,you do not need to insert new record instead you need to use update query to update DA and...
17 Oct 2012 by Anil Dalsaniya
this problem solved by myself :Cursor c = db.query("tb_expense", new String[] {DbHelper.C_Expno,"Group_Concat(ExpName) AS ExpName","Date","SUM(Camt) AS Camt"}, null, null, "Date", null, null);adapter = new SimpleCursorAdapter(this, R.layout.myrow1, c, new String[] ...
10 Nov 2012 by WajihaAhmed
My stored procedure is as follows, I have implemented it using stored procedures:ALTER PROCEDURE VIEW_RESULTS@formID INTASDECLARE @questionID INTDECLARE @applicantID INTDECLARE @applicantName varchar(MAX)DECLARE @qID INTDECLARE @NewLineChar AS CHAR(2) = CHAR(13) +...
21 Nov 2012 by ixashish
Hello I am using following procedure to update MASTER table from TEMP tableit takes 5 to 6 hrs to execute. Can you please help me to optimise time.TABLES USED :TEMP : select in CURSOR (COUNT: 1.5 CR)MASTER : to update from TEMP table using FOR LOOP (COUNT : 3 CR)ERROR_LOG : LOG...
7 Feb 2013 by Member 4295404
I have a text box with some string in it. when i double click inside it I want to get the cursor at that particular position .how can i do this.?
10 Feb 2013 by Valery Possoz
Hello,If you want to get the position of the cursor:private void textBox1_DoubleClick(object sender, EventArgs e){ MouseEventArgs mouseEventAgrs = (MouseEventArgs) e; Point nousePosition = mouseEventAgrs.Location;}If you want to get the character at the position where...
28 Feb 2013 by Kaizen202
I have created a custom combo box(Text box, button and List View).While typing in the text box, cursor disappears. How can I disable "Hiding cursor while typing" in my application.I goggled and found that it is the system behavior called SPI_SETMOUSEVANISH. It can be turned off but it...
5 Mar 2013 by Kaizen202
There is a solution.If we set ListView.Capture=true; we can keep the mouse pointer without hiding. While setting Capture property of ListView as true, It will capture the mouse events and mouse pointer wont be disappeared while typing in TextBox.Another Problem.I am using...
28 Mar 2013 by Hariharan Arunachalam
What you are asking for is close to impossible without sincere effort. Remember that since your program will have absolutely no connection with the target application which has rendered the word in the first place (your browser, notepad etc), you have to resort to different tactics than just a...
4 Apr 2013 by muneebalikiyani
I have a application that works at background , and when my application start the appstartingcursor blink once ( everytime ), and it is pretty annoying to see how cursor icon switches many times from normal arrow to appstart or “Working in background” hourglass with arrow.How can I make...
12 Apr 2013 by User 5887254
What type of application? (win form, console, win service, etc) If it's an entirely background solution, perhaps the service project type would eliminate the issue.This article may give some insight as well: Changing the Systems Cursor in VB.NET
5 Jun 2013 by Md. Shihab Uddin
I have a table, and i declare a cursor to get average price from the table,but cursor does not work correctly , please help me Tableid CurentSock UnitPrice16 20.00 0.2516 120.00 0.3216 30.00 0.35Cursor:declare @count intdeclare @sum decimal(18,2)declare...
7 Jun 2013 by Raju9959
TableAS.No. Name1 Name12 Name2... TableBDateOfBirth FatherName S.no10-2-1988 FatherName1 110-9-1989 FatherName2 2select name,fathername from tableainner join tableb ontablea.[s.no]=tableb.[s.no]Create a tables like this and to provide a...
13 Jun 2013 by CAS1224
Private Sub DataGridView1_CellMouseMove(sender As Object, e As EventArgs) Handles DataGridView1.CellMouseMove Dim columnIndex as Integer = e.ColumnIndex If DataGridView1.Columns(columnIndex).ReadOnly Then Cursor.Current = Cursors.IBeam Else Cursor.Current =...
19 Jun 2013 by Balu Balaji
source:CREATE PROCEDURE Balu_CursorAS BEGIN DECLARE @EmptypeID INT DECLARE @Name VARCHAR(50) DECLARE @Salary INT DECLARE @TempTable table( EmpID INT, Empname varchar, Salary numeric ) DECLARE cur_print...
19 Jun 2013 by snow_berry
Your temp table and parameters need to have the same data types.So:DECLARE @TempTable table(EmpID INT,Empname varchar(50),Salary INT)
20 Jun 2013 by DaMasta90
Hello,in my App I show a custom cursor, which is a rectangle and a few labels.When I run the program on a native client, there are no problems.However, when I run the program over RDP I can not see the cursor. In somecases the Remote-session disappears.Can anyone help me with...
29 Jul 2013 by Pro86
I want to write one query .for this i decided to use cursor.following are my criteria for thisfirst- i have to select some records from one table it should be n number of recordse.g select col1,col2 from table1second -i have to select maxid from another tablee.g select max(id)...
5 Aug 2013 by Sudhakar Shinde
Based on your inputs your code will be like as mentioned below..BEGIN // Add appropriate WHERE Condition SELECT MAX(id) INTO maxId FROM table2; // Add appropriate WHERE Condition in SELECT statement mentioned below FOR i IN (SELECT col1,col2 FROM table1) LOOP ...
14 Aug 2013 by Aamir Mitha
Hi, I am trying to write a script which populates a database.I have been told I need to use temporary tables and cursors to write the script.The instructions are to use a temporary table to store the "inputs" to your script, then use a cursor to iterate over those inputs and to generate...
3 Sep 2013 by Member 8764868
In an android application, I want to access the contacts to whom messages are sent most frequently in a particular period. By using servives and broadcast receiver, I have accessed outoging sms details: contact, time, no of messages sent(depending on length of message). Now I want to to get...
5 Sep 2013 by Ganesh KP
From your information, you are able to get the no. of messages each contact sent right?Here you can do in this way, 1.Create a class (FrequentContact) which contains a list of another class (ContactCount)2. ContactCount class contains ContactName,ContactNumber,Count properties.3....
29 Sep 2013 by Jorge J. Martins
I have small template I made a while ago for whenever I need a cursor.You have to adjust it to Your needs: DECLARE @VARA int DECLARE @VARB varchar(2) DECLARE @VARC datetime DECLARE MyPointer CURSOR FOR SELECT A, B, C FROM MyTable OPEN MyPointer -- Find first record FETCH...
16 Oct 2013 by Bernhard Hiller
Before you set your custom Cursor, you have to write the current cursor into some variable of your application (isn't there a function like GetSystemCursor?), and when your application stops (e.g. in the FormClosing event), you set it back to the original value which you stored above.
24 Oct 2013 by bassofa1
I have a cursor as follows:DECLARE trancur cursor FAST_FORWARD For SELECT t.ExpCom*t2.SplitPerc, t.TrNo FROM #TmpAgtTot2 t2 (NOLOCK) Inner Join #TmpTran t (NOLOCK) ON t.RepCode=t2.TranRepCode Where t.ASL in...
6 Jan 2014 by summerrain_90
i have a FOR LOOP in oracle and in each loop i want to add an record to out cursori try FOR reCord IN C LOOP open cur for select reCord.TONG_TIEN as "TONG TIEN", reCord.ID_PHIEUGUI as "ID PHIEU GUI", reCord.MA_BUUCUC_GOC as "MA BC GOC" from DUAL; ...
23 Jan 2014 by hansoctantan
I have a program that open encrypted INI files (used in my other program as a settings).In my Decrypt Exe (reading the INI file, decrypt it and able to edit the file and save as encrypted text). Other functionalities is Find.My problem is sometimes the selected text when finish clicking...
23 Jan 2014 by andrea contoli
' top left of screenfrmFind.Left = 0frmFind.Top = 0' or top left of current formfrmFind.Left = ME.LeftfrmFind.Top = ME.Top
15 Feb 2014 by Charlesirwin1810
i have an sp and passing values like 'xxx~yyy', '10~12~15', '1~2~7' ,etc... and i have to loop thru the data to get the resultseti need to loop thru like 1. xxx-10-12. xxx-10-23. xxx-10-74. xxx-12-15. xxx-12-26....
16 Feb 2014 by sohail awr
It is working...USE [DBNAME]GO/****** Object: StoredProcedure [dbo].[ohms_sp_add_services_list] Script Date: 02/16/2014 17:51:30 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER OFFGOCREATE PROCEDURE [dbo].[sp2_loop] @param1 varchar(1000)='xxx~yyy' ASSET NOCOUNT...
8 Jun 2014 by CodeChecker 5689
how to add the cursor file to your project and marked it as a resource ?
4 Aug 2014 by KarstenK
I would prefer the standard way of loading the cursor. It is not a real loading, because the reosurce is cached, you only get the system handle.Comparing HCURSOR handles is nonsense. The GetcursorInfo function provides info about it.Else you can open the dll as resource and fetch the id...
28 Sep 2014 by Torakami
Hii , Sometimes i required to insert a field into table which will be for per company , so i use cursor to insert row by row data for that company ..DECLARE @CompanyId intDECLARE AbsenceType_cursor CURSOR FOR select distinct companyid from ABCorder by companyidOPEN...
28 Sep 2014 by jaket-cp
An alternative of using a loop - Insert into Select Statement.Test Setup SQL:declare @ABC table( id int identity(1,1), companyid int)insert into @ABC values(1);insert into @ABC values(3);insert into @ABC values(5);insert into @ABC values(5);insert into @ABC...
18 Nov 2014 by rameshKumar1717
Hi, I have a sql server table say "table_student" as CREATE TABLE table_student ( StudentFirstName Varchar(200), StudentLastName Varchar(200), StudentEmail Varchar(50) ) and I have only one row in entire table for each corresponding column as,Insert into...
17 Nov 2014 by _Kapil
try this?create Procedure InsertStudentrecord As Begin declare @col varchar(255), @cmd varchar(max) DECLARE getinfo cursor FAST_FORWARD for SELECT c.name FROM sys.tables t JOIN sys.columns c ON t.Object_ID = c.Object_ID WHERE t.Name = 'table_student' OPEN...
17 Nov 2014 by /\jmot
i think..you want the columns with nulll value and you want to set the value to the corresponding field.am i right???so, just run a simple Sql Query to fetch the corresponding column which one you want to set with it's desired value and update the column.thats it.like...
4 Jan 2015 by Brian Holsen
I read a lot of articles that say "avoid using cursors in triggers"I have a table [Test]:ID int,Name nvarchar(20),Status nvarchar(20),....when delete happends, if Status!='normal', some data of the deleted records should be logged into another table.well it's just a simple...
4 Jan 2015 by King Fisher
Try this:CREATE TRIIGER trig_DoSomething ON [Test] AFTER DELETEASBEGINinsert into table1 (column1,column2,column3)select column1,column2,column3 from Inserted where Status!='normal';ENDAvoid using CURSOR ,you are trying to kill your System Performance .
4 Jan 2015 by Sumit Jawale
Hi ,Try this : CREATE TRIIGER trig_DoSomething ON [Test] AFTER DELETEASBEGIN declare @Col1 int;.. -- other columns in tabledeclare @status varchar (50); select @Col1 = d.Col1 from deleted d;.. -- other columns in tableselect @status = d.status from deleted...
28 Jan 2015 by Abhinanda2491
The below table is having the totalseatage capacity and venuename and If I want to select only 360 seats from the data how do I query using sql server cursor or using C#.net.TotalSeatageCapacity VenueName500 Accentech PU College120 sri ...
29 Mar 2015 by Member 11565634
create or replace procedure ref_div( pr_div_id OUT divisions.div_id%type, pr_divisions OUT divisions.divisions%type)ISbegin select div_id, divisions into pr_div_id, pr_divisions from divisions;end;
29 Mar 2015 by OriginalGriff
That isn't an "exact fetch" - it's a SELECT that doesn't have a WHILE clause, so it returns all the rows in the table.If that isn't what you wanted, then you need to decide what condition will reduce the rows to the ones you want only, and as a WHILE clause to restrict it.
2 Apr 2015 by Sergey Alexandrovich Kryukov
Here, you will find some explanation on why and where to use cursors: http://en.wikipedia.org/wiki/SQL_problems_requiring_cursors.See also: http://en.wikipedia.org/wiki/Cursor_(databases) (and pay attention for "disadvantages" section).And also, in PL/SQL documentation:...
16 Apr 2015 by Abbas Pirbhai
I have three columns exam_id,exam_date and receipt_no. The minimum value of exam_date is '2005-03-11' and the max date can be today's date. I want to write a cursor to generate receipt_no. The condition is that for every month the receipt_no should be reset to 1. and if the receipt_no is already...
11 Sep 2015 by Member 11377180
I have 3 tables. Please check my below code. I want to insert @OP in OP of HSR_OP_Bal. @OP is a temporary column for IF Else output. Im getting following errors:Incorrect syntax near '@OP'Incorrect syntax near the keyword 'end'..Stored procedure:USE [Shoper9HO]GO/******...
11 Sep 2015 by Wendelius
When assigning a value to a variable, use SET statement. INstead of @OP=Qty*1useSET @OP=Qty*1Also it looks like you have mismatched begin...end blocks so the code should probably be something like If ( @TransType=1100 or @Transtype=1300) Begin Declare @OP int ...
15 Sep 2015 by Wendelius
We don't have your data nor the knowledge about your tables. Because of this it's impossible t say what is logically wrong with the statements.However, what you can do is to run the cursor statement and see what is duplicated. For example take the statementSelect...
15 Sep 2015 by Member 11955024
I have two cursors inside try catch block ,my problem is that th eprocedure is ececuting but the data is not getting inserted inside table,its showing blank. Please refer the Below code and suggest corrections...thankuUSE [Shoper9Ho]GO/****** Object: StoredProcedure...
1 Dec 2015 by PJ Arends
Use a worker thread to transfer your data, or at least use PeekMessage to poll your message queue to see if there are any messages.
22 Feb 2016 by Member 10804091
I have around 60 databases that I am querying against that have the same tables; however, I want the result of my query to be inserted into a temp table so that I can create a well formatted report using the result stored in that temp table. How do I achieve that? Below is my query that loops...
22 Feb 2016 by Kuthuparakkal
Please try this way:DECLARE @c_db_names AS TABLE(ID INT IDENTITY(1,1),name sysname)DECLARE @Records AS TABLE(ID INT IDENTITY(1,1),name sysname,OrderID NVARCHAR(10), OrderStatus NVARCHAR(10), OrderDetails NVARCHAR(10), FulfillmentDate DATETIME, ShippingDate DATETIME,...
22 Mar 2016 by Member 10616864
I have data like this ClientID JumlahHadir Months Years 20001712 1 4 2015 20001712 2 5 2015 20001712 2 6 2015 20001712 2 7 2014 20001712 1 8 2014I want the data like thisClientID JumlahHadir SumTotal Bulan Tahun 20001712 1 ...
22 Mar 2016 by OriginalGriff
If you are using SQL 2012 or higher, then you can use LAG to access the previous row data: https://msdn.microsoft.com/en-GB/library/hh231256.aspx?f=255&MSPPError=-2147217396[^]
22 Mar 2016 by RickZeeland
Something like this, but this will be slower than using the LAG method:WITH CTE AS( SELECT rownum = ROW_NUMBER() OVER (ORDER BY a.clientID), a.JumlahClient FROM GroupAttendance a)SELECT CTE.JumlahClient JumlahHadir, prev.JumlahClient + CTE.JumlahClient SumTotalFROM CTE LEFT...
23 May 2016 by abdussalam143
Dear All I am stuck in bellow procedure please help me out.What I have tried:DECLARE @msgid AS BIGINT DECLARE cur CURSOR LOCAL FOR SELECT msgid FROM rawtTackHistory_A2Z rn WHERE rn.msgid > (178370450 ) ORDER BY ...
23 May 2016 by Simon_Whale
Personally I would change just a little bit of your code, for Debugging purposes only.DECLARE @msgid AS BIGINTDECLARE @selectMsg AS BIGINTselect top 1 @selectMsg = MsgID FROM HistoryMsgID--Now Here we can see what @selectMsg isprint @selectMsgDECLARE cur CURSOR LOCAL FOR ...
11 Dec 2017 by H.AL
I created a procedure in oracle database that returns data in a ref-cursor, and I want it to return the rowcount of this cursor also as an output variable. After testing, the P_count variable is filled correctly, but when I tried to open it an ORA-01002: fetch out of sequence error is fired. I...
28 Oct 2016 by Wendelius
If I understand the problem correctly, it looks like you're looping the result set in the procedure so when you try to continue fetching data on the calling side, you've already reached the end of the result set.If you need to loop the data inside the procedure and to return the data to the...
5 Nov 2016 by Patrice T
Quote:Is there software/tool or general algorithm to convert simple T-SQL query with cursor into set-based?Such a tool is very unlikely to exist, because it is non trivial.Converting a query from cursor to set-based is not a problem, the whole problem is with the code that handle the result of...
9 Dec 2016 by ridoy
The general pattern to test for a "valid" cursor is :if(cursor != null && cursor.getCount() > 0)
17 Feb 2017 by Member 13008204
I have managed to create custom cursor from div with jQuery, can I also change the cursor style for example: (styling animation keyframes) when hovering over div.Here is my html code that makes the custom cursor.PlunkerWhat I have tried:I search everywhere on how to animate the...
26 Mar 2017 by Member 13014278
I am developing a kinect application, and now I can set the mouse cursor to middle of screen when my hand is reconized by kinect sensor. However, this just happen when run the application. I want that this happen when hand is detected by the kinect sensor during execution. Somebody can help me?...