@DbCommand and SELECT

Hi! Can anybody help me, please?I have two fields. In first I have Names, in second I need have surname from DB Oracle.

So, I’m using next code(in “Choices” of the field):

@DbCommand( “ODBC” : “NoCache” ; “ForMyDb” ; “logon” ; “password” ;

“SELECT name1 FROM names.names WHERE name2=@GetField(‘FirstName’)”)

But, @GetField(‘FirstName’) doesn’t work here. So, my questin is:

How can I put Value of “FirstName” into my require “SELECT name1 FROM names.names WHERE name2=???”

Subject: @DbCommand and SELECT

Make your life easier use { instead of " and break out the statement:

sql:={SELECT name1 FROM names.names WHERE name2=‘}+@GetField(“FirstName”)+{’};

@DbCommand( “ODBC” : “NoCache” ; “ForMyDb” ; “logon” ; “password” ;sql)

You can use an @prompt([Ok];sql) to verify if your sql statement looks proper.

Subject: RE: @DbCommand and SELECT

It works! Thanks a lot Rami Jundi!