Android Forums

Go Back   These FORUMS ARE DISABLED!! OUR NEW FORUMS ARE AT http://androidforum.com/ > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 03-21-2010, 09:26 AM   #1
Junior Member
 
Join Date: Mar 2010
Posts: 1
Friends: 0
View cowboy's Profile   View cowboy's Photo Album   View cowboy's Blog   View Social Groups
Is it possible to use foreign key on Android OS? I ask this question because this code in my app finished with error when it started on emulator( eclipse did not show any error throw compiling):

Code:
 myDB.execSQL("CREATE TABLE IF NOT EXISTS "
    		  + categories
    		  + " (category_id PRIMARY KEY,FOREIGN KEY(parent_id) REFERENCES categories(category_id)),name text,amount float);"); 
      myDB.execSQL("CREATE TABLE IF NOT EXISTS "
    		  + accounts
    		  + " (account_id PRIMARY KEY, name text);");
myDB.execSQL("CREATE TABLE IF NOT EXISTS "
               + tranzactions+ 
               " (transaction_id PRIMARY KEY, FOREIGN KEY(account_id) REFERENCES accounts(account_id)), FOREIGN KEY(category_id) REFERENCES categories(category_id)),t_date date,amount float;");
i ve read that i have to use triggers for eliminate this error.Is it true?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes




Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 05:04 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.