Grid Lookup

Hi,
I need to change dynamically the sql script of automatic grid lookup and in particular I need to change the table name like:

select last, name from [table_name] where mail=’{address}’

I have tried, in test environment it ask me for [table_name] variable but when I execute the grid I obtain error.

Is it possible to something like this?

Thanks

Scriptcase is pretty static. The only way I can think of is using tricks like using temporary tables. That way you could use a control to fill your temp table depending on your arguments and then present the data in the form using this temp table. That way you create some ‘dynamics’. But it’s an awful solution, I agree.

You can use the attribute in
Grid->SQL->SQL Settings->Variable for Table to do the replacement.
[LIST=1]

  • Key in your SQL select statement in [B]Grid[/B]->[B]SQL[/B]->[B]SQL Settings[/B]->[B]SQL Select Statement [/B]field
    e.g.
    	select last,
    	       name
    	  from [I]actual_table_name[/I]
    	 where mail='{address}'
    	
    
  • Key in the [B]actual_table_name[/B] in the first field of the [B]Grid[/B]->[B]SQL[/B]->[B]SQL Settings[/B]->[B]Variable for Table [/B]attribute
  • Key in [B]G_TABLE_NAME [/B]in the second field of the [B]Grid[/B]->[B]SQL[/B]->[B]SQL Settings[/B]->[B]Variable for Table [/B]attribute
  • During execution it will ask for [B][G_TABLE_NAME][/B] variable value [/LIST]