Go to the first, previous, next, last section, table of contents.


Search table (search)



`Description'
This action is run after the search form was filled. A where clause is built on the basis of the query by example defined by the user, See section Search form (search_form). The records found are ordered using the order parameter. In addition to the query by example defined by the user, the limit expression limit the context of the search. It must be a valid where expression. The records found are displayed paginated, See section Multipage results template. The links_set parameter, if defined, is used to display records linked to each record found according to the relational specifications described in the relations.spec configuration file, See section Relational constraints. Please note that links_set may only refer to tables described in the relations.spec file. Each record found is displayed below the current record with a margin, as shown on the screen shot above. The generic syntax of links_set is a tree description using nested parentheses.
links_set: table or
           tree_spec

tree_spec: table or
           tree_spec,tree_spec or
           table(tree_spec)

table: name of a table
For instance let's pretend that you have a database with the following relational structure, properly described in the relations.spec file.
table1 ----------> table2 ----------> table4
       |
       |---------> table3
You would like to display the records from table2 for each record found in table1. The value of links_set you should use for this purpose will be:
links_set=table1(table2)

record1_table1
  record3_table2
  record10_table2
record2_table1
  record7_table2
record3_table1
  record5_table2
record4_table1
...

If you would like to display the records from table4 linked indirectly to table1 thru table2, the value of links_set you should use for this purpose will be:
links_set=table1(table2(table4))

record1_table1
  record3_table2
    record100_table4
  record10_table2
    record10_table4
    record7_table4
    record5_table4
record2_table1
  record7_table2
record3_table1
  record5_table2
    record23_table4
    record17_table4
record4_table1
...
If you would like to display the records from table2 and table3 both linked to table1, the value of links_set you should use for this purpose will be:
links_set=table1(table2,table3)

record1_table1
  record3_table2
  record10_table2
  record1_table3
record2_table1
  record7_table2
  record10_table3
  record27_table3
record3_table1
  record5_table2
record4_table1
...
When a table is linked to another in the relational specification, it is always possible to specify links in both ways. To continue the example above, all the following case would be legal, with different results, of course.
links_set=table4(table2(table1(table3)))
links_set=table2(table1,table4)
Whenever the exploration of the records dive deeper in the relational specification described in links_set, the _MARGIN_ tag becomes wider. Let's continue with the example above and a links_set set to table1(table2(table4)). When displaying the records from table1 the _MARGIN_ and _MARGINTABLE_ tags are the empty string. When displaying the records from table2 the _MARGIN_ tag is one (empty) cell table wide and _MARGINTABLE_ tag is one cell table wide, filled with the string table2. When displaying the records from table4 the _MARGIN_ tag is two (empty) cells table wide and _MARGINTABLE_ tag is two cells table wide, the last one filled with the string table4. The only, very important constraint, is that the first table mentioned in the links_set parameter must be the same as the value of the table parameter.
`Template file'
See section sqledit_search.html.
`Constraints'
See section SQL editor configuration file.
`Parameters'
`context (mandatory, search)'
`table (mandatory)'
`page (optional, default 1)'
`page_length (optional, default 10)'
`order (optional)'
The order clause of the generated SQL order.
`links_set (optional)'
Display tree specification of the form table1(table2,table3(table4),table5). The table must have the value table1.
`limit (optional)'
A valid where expression that will be added to the generated where expression using the and keyword.
`fct_name'
If set to select, the select link is added to the _LINKS_ tag. The associated action is to return to the calling cgi-bin with the primary key of the corresponding record.
`table parameters'
See section Database table parameters.


Go to the first, previous, next, last section, table of contents.