var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SQL Help
I got a Table that holds Translations for my program. The problem is maintaining this table or keeping it up to date (+-3000 records).
The Columns are
and there is a unique constraint on MSG_ID and LANG.
What I doing now is basically selecting distinct all the LANG and then selecting the entire table where LANG = ENGLISH
Then I got a loop (in VB) that checks if each English MSG_ID is in the other LANGs and then I Insert it if it doesnt find anything.
Please help me find a faster way as this takes forever.
I could not understand your question, please tell what exactly you want to do with the existing table, do you want to create a new table with only msg in english ??
Re: SQL Help
This select will show you what is missing:
SELECT t.msg_id, l.lang
FROM Translations t, Languages l
SELECT t.msg_id, t.lang
FROM Tranlations t;
If you don't have a table of Languages, you could replace that in the FROM clause like this:
FROM Translations t, (SELECT DISTINCT lang FROM Translations) l
You could turn that into an INSERT statement, but where will it get the translated text from?
I only one table, UT_MESSAGES
The problem is that I can only maintain the English Translations in the table.
MSG_ID , TITLE , LANG
1 , Title, ENG
2 , Desc, ENG
1 , Titel, POR
Now, I need a select statement that will tell me that 1 POR translation is missing.
Andrewst, I tried that select statement but it returns no rows
This is what I meant:
SQL> select t.msg_id, l.lang
2 from ut_messages t, (select distinct lang from ut_messages) l
4 select t.msg_id, t.lang
5* from ut_messages t;
Sorry, it would have worked the first time. I am such a idiot, I forgot to hit Commit in TOAD when I insert the POR Translation.
I modified the SQL abit to
SELECT t.message_id, l.lang_id, t.description from ut_messages t, (select distinct lang_id from ut_messages) l
MINUS (select t.message_id, t.lang_id,t.description from ut_messages t);
and now it returns the TEXT for the translation as well (defaulted to English or which ever other langauge has it)
Thank you so much for the help