Hi Aparna,

What exactly are you trying to do with Mifos?

Regards,
Vishwas

P.S: For your insert scripts to work, both foreign key and primary key
would need to be of the same data type (dno in both dept and emp tables)


On 26 March 2013 19:19, aparna rao B S <[email protected]> wrote:

> Respected Sir/Madam,
>
> I installed mifos for the first time . Then I wrote the following
> commands......................
> .....
>
> use test
> create table dept_021(dept_no numeric(2) primary key,dept_name
> char(30),dept_location char(20));
>
> then
>
>
>  insert into dept_021 values(10,"Acccounts","New York");
>
> insert into dept_021 values(20,"Research","Dallas");
>
> insert into dept_021 values(30,"Sales","Chicago");
>
> insert into dept_021 values(40,"Operations","Boston");
>
>
> then
>
> create table emp_021(emp_no int(5) primary key,
>                     emp_name varchar(30) not null,
>                     desi char(10) not null,
>                     mgr int(5),
>                     date_of_join date not null,
>                     salary numeric(9,2),
>                     comm numeric(6,2),
>
>                     dno int(2),
>                     check (salary>=3000),
>                     foreign key(dno) references dept_021(dept_no),
>                     foreign key(mgr) references emp_021(emp_no));
>
>
> This gave error...............
> Later I just wrote alter table emp_021 add foreign key(mgr) references
> emp_021(emp_no);
>
> This worked.....................BUT...........................
>
> alter table emp_021 add foreign key(dno) references dept_021(dept_no);
>
> This didn't work. It gave the error : can't create table
> 'test.#sql-13c4_a' (errno:150)
>
> What is the problem? What should I write to make foreign keys work?
>
> Also I couldn't make changes in my.ini file as it displayed "Access
> denied" when I tried to save file after making changes.................What
> should I do?
>
> Please help me..............
>
> Thanking you,
> Yours faithfully,
> B S Aparna Rao
> Student
> India
>
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Mifos-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mifos-users
>
>
------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Mifos-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-users

Reply via email to