Placing User Interface Data into an SQL queryI've found tons of creating user interface examples, but there aren't that many discussions explaining how to handle/manipulate user data. I'm struggling getting data from a text box (# of days) and using that in an expression On_OK. I also want to then use data as a string in an sql query for days. In the past i would set a global variable ::DATETIMESTUFF="10" and then i could put that into
WHERE A.SCANDATETIME>(SYSDATE-"|| ::DATETIMESTUFF || ")
ui = New Window( "Choose an option",
<<MODAL>(SYSDATE-"|| ::DATETIMESTUFF || ")
",
"Table1"
);
);</MODAL>
ScriptingRe: Placing User Interface Data into an SQL queryTry this. You need to put on_ok above the new window().
On_OK = Expr(
Open Database("DSN=xxx;UID=xxxxx;PWD=xxxxx;", sql_statement, "Table1");
);
ui = New Window( "Choose an option",
<<MODAL> (SYSDATE - ^current_days^)");
</MODAL>Re: Placing User Interface Data into an SQL queryIf i put the number 10 instead of ^current_days^ in your script, it works correctly.
But with the ^current_days^, it gives an Error ORA-00936 (missing expression)
So i still can't get the data from the text box and put it into the query