Please advise, how to select with variable

Dear all,
   

  1. There is a table as same as the following

t:( eid:1 2 3 4 5;name:ABCDEF)

  1. I have made a function which extract the first element of the list

f:{ x[0]}

a:f[“A1234567”]

  1. I try to execute a select statement with the variable a, but it give a incorrect result.

select eid from t where name=a

  1. I expect the result which is same as the below statement but it is not same as I expected

select eid from t where name=`A

Please help to advise what wrong with this statement.

Regards,

Nelson 

your input:

“A1234567”

Is a list of char, not a list of symbols. Your name column is a symbol type. So try

a:f[A1234567]

Hi manish,
   This is the requirement for data, I cannot change it. Thanks for your help.

Regards,

Nelson

ok, then just cast it?

… where name=`$a

(assuming a is an char atom)

Hi manish,

    Thank you.

Regards,

Nelson
On Monday, May 25, 2015 at 7:04:50 PM UTC+8, manish patel wrote:

ok, then just cast it?

… where name=`$a

(assuming a is an char atom)