Topic: SQL query to find record throws error for expected ;

cbScene is a combobox which is linked to foreign key SceneCharacter.id_Scene, which points to Scene.id
txtNumber is an edit box

Here is my script: (inside the Closeup event for cbScene)

tablegrid1 := SELECT number FROM Scene WHERE Scene.ID = '{cbScene}';

When I run the program, I get the error: ';' exptect at 7:21. 

This query works fine if it is placed as the action for a command button.

Re: SQL query to find record throws error for expected ;

Hello,


In current version you can't get result from SQL query  to TableGrid by script.

I suggest you use button with action "SQL query" with SQL:

SELECT number FROM Scene WHERE Scene.id = {cbScene};

Inside the Closeup event for cbScene you can click on this button by script for execute query:

Form1.ButtonSQL.Click;
Dmitry.

Re: SQL query to find record throws error for expected ;

DriveSoft wrote:

Hello,


In current version you can't get result from SQL query  to TableGrid by script.

I suggest you use button with action "SQL query" with SQL:

SELECT number FROM Scene WHERE Scene.id = {cbScene};

Inside the Closeup event for cbScene you can click on this button by script for execute query:

Form1.ButtonSQL.Click;

Fair enough.  I also discovered that you can select a parent record from a grid, which gives me the flexibility I need for what I was trying to do.