Variables from more than one SQLite table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • embine
    Forum Member
    • Oct 2004
    • 11

    Variables from more than one SQLite table

    I'm trying to select variables from more than one table.

    thumb_one = SQLite.QueryToTable(db_files, "SELECT * FROM files, ps_files WHERE files.file_id = ps_files.file.id AND ps_files.ps_sections_id_sub = 'factsheets'");

    But when I try and output one of the fields I get an error.
    Dialog.Message("Notice", thumb_one.Data[1].file_name, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    Any ideas anyone?
  • sside
    New Member
    • Dec 2003
    • 475

    #2
    Originally posted by embine
    I'm trying to select variables from more than one table.

    thumb_one = SQLite.QueryToTable(db_files, "SELECT * FROM files, ps_files WHERE files.file_id = ps_files.file.id AND ps_files.ps_sections_id_sub = 'factsheets'");

    But when I try and output one of the fields I get an error.
    Dialog.Message("Notice", thumb_one.Data[1].file_name, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    Any ideas anyone?
    Code:
    [B]thumb_one.Data[1]["file_name"][/B]
    Code:
    Dialog.Message("Notice", [B][COLOR=Red]thumb_one.Data[1]["file_name"][/COLOR][/B], MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    Comment

    • sside
      New Member
      • Dec 2003
      • 475

      #3
      Originally posted by embine
      I'm trying to select variables from more than one table.

      thumb_one = SQLite.QueryToTable(db_files, "SELECT * FROM files, ps_files WHERE files.file_id = ps_files.file.id AND ps_files.ps_sections_id_sub = 'factsheets'");

      But when I try and output one of the fields I get an error.
      Dialog.Message("Notice", thumb_one.Data[1].file_name, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

      Any ideas anyone?
      I see also that you want to perform a join and from where i see it i don't think is right (see in blue). Are the tables in the same database? If not you can't join that way.
      I assume that both tables are in the same database. This will change the outcome, it wold be something like this;
      Code:
      [B]thumb_one.Data[1]["tablename.file_name"][/B]
      Code:
      Dialog.Message("Notice", [B][COLOR=Red]thumb_one.Data[1]["tablename.file_name"][/COLOR][/B], MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

      Comment

      Working...
      X