Hello,
Thank you very much for your e-mail.
Your code is incorrect. First thing you should do is to use
DEBUGGER so you can see what you are doing and where you are making mistakes.
And use string variable to hold entire statement and display it in the DEBUGGER.
Correct code is:
Using double quotes:
keyword = "Processing shrimps";
SQLStatement = "Select MATCH( var1, var2, var3) AGAINST \"" + keyword + "\" IN BOOLEAN MODE) as Score From myTable where isin=\"" + Name() + "\"";
odbcGetValueSQL( SQLStatement );
Using single quotes:
keyword = "Processing shrimps";
SQLStatement = "Select MATCH( var1, var2, var3) AGAINST '" + keyword + "' IN BOOLEAN MODE) as Score From myTable where isin='" + Name() + "'";
odbcGetValueSQL( SQLStatement );
Best regards,
Tomasz Janeczko
amibroker.com
Thank you Tomasz.
I want to pass a keyword in SQL statement: "Processing Shrimps" (Along with the Double Quotes)
So, i am writing it with \"
fts_keyword = " +\"Processing Shrimps\" +export ";
1) But how to pass the variable fts_keyword in below SQL statement?
score = odbcGetValueSQL("select MATCH(var1, var2, var3) AGAINST ( ' fts_keyword ' IN BOOLEAN MODE) as score from mytable where isin='"+Name()+"' ");
If we pass it the way I did above, it's not working. I also did '+fts_keyword+' that also does not work.How to fix it?
2) Another qts is I want to define the fts_keyword through paramstring as below:
fts_keyword = ParamStr( ''keyword', ''default'' );
When the Parameter Popup windows comes: what should i enter for the Parameter keyword:
Should i enter: +\"Processing Shrimps\" +export
Or should i enter like: " +\"Processing Shrimps\" +export "
Which will be same as
fts_keyword = " +\"Processing Shrimps\" +export ";
as in qts 1) above?
THe Objective of qts 2) is I want to pass the variable fts_keyword to the SQL statement through a parameter.
Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon