Click here to Skip to main content
16,004,919 members
Home / Discussions / Database
   

Database

 
GeneralRe: text to ntext Pin
Mike Dimmick7-Jul-04 5:56
Mike Dimmick7-Jul-04 5:56 
GeneralSQL Help. Pin
brdavid4-Jul-04 14:59
brdavid4-Jul-04 14:59 
GeneralRe: SQL Help. Pin
Hesham Amin4-Jul-04 22:50
Hesham Amin4-Jul-04 22:50 
GeneralRe: SQL Help. Pin
brdavid6-Jul-04 4:49
brdavid6-Jul-04 4:49 
GeneralRe: SQL Help. Pin
Grimolfr6-Jul-04 9:58
Grimolfr6-Jul-04 9:58 
GeneralRe: SQL Help. Pin
brdavid6-Jul-04 14:00
brdavid6-Jul-04 14:00 
GeneralEditing Pre-existing Queries Pin
brdavid4-Jul-04 14:56
brdavid4-Jul-04 14:56 
GeneralVariable in SQL Query Pin
brdavid4-Jul-04 2:01
brdavid4-Jul-04 2:01 
Is it possible to list a field value as a value in an SQL query? For example.

instead of this
<br />
SQL.Format("SELECT * FROM TABLE1;");<br />
if(query(SQL) is ok)<br />
{<br />
   GetField("DatabaseTable", Table);<br />
   SQL.Format("SELECT * from %s;", Table);<br />
   if(query(SQL) is ok)<br />
   {<br />
     ...<br />
   }<br />
}<br />

I want this
<br />
SQL.Format("SELECT * FROM [SELECT DatabaseTable FROM TABLE1] t1");<br />
if(query(SQL) is ok)<br />
{<br />
   ...<br />
}<br />


that is if I have a field in TABLE1 that has for its value a table name, how can use that table name automatically without parsing one SQL query for that field then making a whole new query on the DatabaseTable. Using a current database design doing what I am doing which is example 1, bogs down the program since it is making 100's of these calls. I would like to keep down the SQL queries if possible.

If not, does anyone know another possible solution? In a sense, I make probably 500 SQL calls in a single function thanks to this database design. If I can't come with a solution, then the database design needs to change so my SQL calls go down.

The reason this is, is because I allow a user to define custom tables to represent subskills in skills. That is they can define a skill with either a set list of subskills in a SUBSKILL table or define a table. I do this because I have some skills with 100's of subskills and separating the content seemed easier to tackle and handle in a database than shoving it all into the SUBSKILLS table.

Thanks!
GeneralRe: Variable in SQL Query Pin
Colin Angus Mackay4-Jul-04 2:27
Colin Angus Mackay4-Jul-04 2:27 
GeneralRe: Variable in SQL Query Pin
brdavid4-Jul-04 5:46
brdavid4-Jul-04 5:46 
Generalrunning mysql_install_db on windows Pin
Hesham Amin4-Jul-04 0:43
Hesham Amin4-Jul-04 0:43 
GeneralRe: running mysql_install_db on windows Pin
michanne4-Jul-04 18:00
michanne4-Jul-04 18:00 
GeneralRe: running mysql_install_db on windows Pin
Hesham Amin4-Jul-04 22:23
Hesham Amin4-Jul-04 22:23 
GeneralRe: running mysql_install_db on windows Pin
michanne15-Jul-04 6:29
michanne15-Jul-04 6:29 
GeneralRe: running mysql_install_db on windows Pin
Grimolfr6-Jul-04 10:05
Grimolfr6-Jul-04 10:05 
Generaldataview Pin
Member 11412663-Jul-04 0:41
Member 11412663-Jul-04 0:41 
QuestionWhat is the main advantage of subqueries? Pin
wgdesigner2-Jul-04 22:31
wgdesigner2-Jul-04 22:31 
GeneralStored Procedure call yields RecordSet error Pin
Peter Weyzen2-Jul-04 8:29
Peter Weyzen2-Jul-04 8:29 
GeneralRe: Stored Procedure call yields RecordSet error Pin
Steven Campbell2-Jul-04 11:19
Steven Campbell2-Jul-04 11:19 
GeneralRe: Stored Procedure call yields RecordSet error Pin
Peter Weyzen2-Jul-04 11:52
Peter Weyzen2-Jul-04 11:52 
GeneralCould use an extra brain... Pin
brdavid2-Jul-04 6:31
brdavid2-Jul-04 6:31 
GeneralRe: Could use an extra brain... Pin
Steven Campbell2-Jul-04 11:15
Steven Campbell2-Jul-04 11:15 
GeneralRe: Could use an extra brain... Pin
brdavid2-Jul-04 14:53
brdavid2-Jul-04 14:53 
GeneralSQL query required Pin
Imtiaz Murtaza1-Jul-04 23:02
Imtiaz Murtaza1-Jul-04 23:02 
GeneralRe: SQL query required Pin
wgdesigner2-Jul-04 22:23
wgdesigner2-Jul-04 22:23 

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.