Answer the question
In order to leave comments, you need to log in
What is the best way to store SQL queries?
Good afternoon. Please share your experience where you store sql queries. I used to create interfaces or abstract classes in which I created String constants of the form
CREATE TABLE IF NOT EXISTS "post"
("_id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
"link" TEXT NOT NULL UNIQUE ,
"read" BOOL NOT NULL )
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(SomeClass.SQL_CREATE_TABLE);
}
Answer the question
In order to leave comments, you need to log in
I store it as a sql script, along with the source files of the program, under the CVS version control system.
Always store queries in the form of stored procedures (Stored Procedure) in the used DBMS.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question