Click here to Skip to main content
15,906,329 members
Home / Discussions / Database
   

Database

 
AnswerRe: selecting maximum entry from sql server compact column Pin
paul4everyone24-Aug-13 2:38
paul4everyone24-Aug-13 2:38 
AnswerRe: selecting maximum entry from sql server compact column Pin
Eddy Vluggen24-Aug-13 2:43
professionalEddy Vluggen24-Aug-13 2:43 
AnswerRe: selecting maximum entry from sql server compact column Pin
paul4everyone24-Aug-13 2:47
paul4everyone24-Aug-13 2:47 
GeneralRe: selecting maximum entry from sql server compact column Pin
Mycroft Holmes24-Aug-13 13:31
professionalMycroft Holmes24-Aug-13 13:31 
GeneralRe: selecting maximum entry from sql server compact column Pin
Jörgen Andersson26-Aug-13 21:30
professionalJörgen Andersson26-Aug-13 21:30 
AnswerRe: selecting maximum entry from sql server compact column Pin
paul4everyone25-Aug-13 4:19
paul4everyone25-Aug-13 4:19 
GeneralRe: selecting maximum entry from sql server compact column Pin
Mycroft Holmes25-Aug-13 12:40
professionalMycroft Holmes25-Aug-13 12:40 
QuestionPL/MySQL - No data - zero rows fetched, selected, or processed Pin
noislude22-Aug-13 5:22
noislude22-Aug-13 5:22 
Hi. When I try to run the following code, I get the error I wrote in the subject.

CSS
delimiter //
   drop procedure if exists example_cursor;
   create procedure example_cursor() reads sql data
   begin
    -- declare variables
    declare var_wage numeric(8,2);
    declare var_employee_id int;
    declare var_department_id int;

    -- declarar done state
    declare done int default 0;

    -- create cursor for table
    declare cur1 cursor for
    select employee_id, salary, department_id from employees;

    -- set done to 1 if data wasn't found
    declare continue handler for not found set done = 1;

    -- open cursor
    open cur1;
    -- start loop
    emp_loop:loop
       -- get data from cursor
       fetch cur1 into var_employee_id, var_wage, var_department_id;
    if(done = 1) then
       leave emp_loop;
     end if;
    end loop emp_loop;
    -- close cursor
    close cur1;
end;
 //


SQL
CREATE TABLE `employees` (
  `EMPLOYEE_ID` int(11) NOT NULL auto_increment,
  `SURNAME` varchar(40) NOT NULL,
  `FIRSTNAME` varchar(40) NOT NULL,
  `ADDRESS1` varchar(40) NOT NULL,
  `ADDRESS2` varchar(40) NOT NULL,
  `ZIPCODE` varchar(6) NOT NULL,
  `DATE_OF_BIRTH` datetime NOT NULL,
  `PHONENO` varchar(12) NOT NULL,
  `MANAGER_ID` decimal(8,0) NOT NULL,
  `SALARY` decimal(8,0) NOT NULL,
  `STATUS` varchar(9) NOT NULL,
  `DEPARTMENT_ID` decimal(8,0) default NULL,
  `COMMENT_ID` decimal(8,0) default NULL,
  `DEPARTMENT_NAME` varchar(40) default NULL,
  `ADJUSTED_SALARY` decimal(8,0) default NULL,
  `HIRE_DATE` datetime default NULL,
  PRIMARY KEY  (`EMPLOYEE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

AnswerRe: PL/MySQL - No data - zero rows fetched, selected, or processed Pin
GuyThiebaut22-Aug-13 5:50
professionalGuyThiebaut22-Aug-13 5:50 
GeneralRe: PL/MySQL - No data - zero rows fetched, selected, or processed Pin
noislude22-Aug-13 10:10
noislude22-Aug-13 10:10 
QuestionALTER TABLE question Pin
Corporal Agarn22-Aug-13 1:29
professionalCorporal Agarn22-Aug-13 1:29 
AnswerRe: ALTER TABLE question Pin
Simon_Whale22-Aug-13 1:49
Simon_Whale22-Aug-13 1:49 
GeneralRe: ALTER TABLE question Pin
Corporal Agarn22-Aug-13 1:56
professionalCorporal Agarn22-Aug-13 1:56 
AnswerRe: ALTER TABLE question Pin
Shameel22-Aug-13 2:34
professionalShameel22-Aug-13 2:34 
QuestionXML Clause is not allowed Pin
iCanDivideByZero21-Aug-13 7:13
iCanDivideByZero21-Aug-13 7:13 
AnswerRe: XML Clause is not allowed Pin
Eddy Vluggen22-Aug-13 5:15
professionalEddy Vluggen22-Aug-13 5:15 
QuestionSQL Query Pin
heinthuwin20-Aug-13 20:54
heinthuwin20-Aug-13 20:54 
AnswerRe: SQL Query Pin
Bernhard Hiller20-Aug-13 21:59
Bernhard Hiller20-Aug-13 21:59 
AnswerRe: SQL Query Pin
NickPace21-Aug-13 5:24
NickPace21-Aug-13 5:24 
GeneralRe: SQL Query Pin
heinthuwin21-Aug-13 18:41
heinthuwin21-Aug-13 18:41 
AnswerRe: SQL Query Pin
PIEBALDconsult21-Aug-13 7:19
mvePIEBALDconsult21-Aug-13 7:19 
GeneralRe: SQL Query Pin
Tim Carmichael21-Aug-13 8:40
Tim Carmichael21-Aug-13 8:40 
GeneralRe: SQL Query Pin
PIEBALDconsult21-Aug-13 14:51
mvePIEBALDconsult21-Aug-13 14:51 
GeneralRe: SQL Query Pin
Mycroft Holmes21-Aug-13 12:37
professionalMycroft Holmes21-Aug-13 12:37 
QuestionConnecting Access database to SQL Azure with limited privileges Pin
Peter R. Fletcher19-Aug-13 15:15
Peter R. Fletcher19-Aug-13 15: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.