This content has been marked as final. Show 5 replies
... WHERE %Var1String LIKE %Var2String - This sintax doens work in TimesTen and Oracle DB.
These statements work correctly.
Could you please post the correct SQL statement?
Command> SELECT COUNT(1) cnt123 FROM DUAL WHERE 'd' LIKE '%Var2String'; < 0 > 1 row found. Command> SELECT COUNT(1) cnt123 FROM DUAL WHERE '%d' LIKE '%Var2String'; < 0 > 1 row found. Command>
Thank you for the response. I think I should be have being more clear before.
On Timesten command prompt the query shown below works fine.
SELECT COUNT(*) cnt123 FROM DUAL WHERE 'st1234' like 'str%'
But when the same is executed thorugh prepared statement, it throws the error..
SELECT COUNT(*) cnt123 FROM DUAL WHERE %Str1 like %Str2;
Here Str1 and Str2 are the varchar arguments...
Could you please post the code you use?
I was using an application which internally does a prepared statement call to Timesten. The below query worked against the Oracle Db but was failing against Timesten. Now I modifed the configuration in a way to get the result from Oracle rather than timesten which I used to do before and end up with error.
While TimesTen has a high degree of compatibility with Oracle DB SQL there are still some significant differences due to them being essentially different products from a different origin. For example, Timesten is not really compatible with Oracle in terms of the bind-mode. Oracle uses late bind-mode and prepares queries on the first execution. TimeTen employs early bind-mode and TimesTen needs the data type before preparing queries. Because of this, the query you mentioned has different behavior in Timesten and Oracle.
You can work around this in TimesTen using somethign like the following:
SELECT COUNT(*) cnt123 FROM DUAL WHERE CAST(%Str1 AS VARCHAR2(1000)) like CAST(%Str2 AS VARCHR2(1000));