Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to cast a Javascript String to SQL LongText
    primarykey
    data
    text
    <p>I am facing a problem for an hour or so with a <code>LongText</code> column in SQL. I am currently working on a web project where at some point we have a search form which allows user to search through numerous fields. Due to the customer's users being forced to use IE 9, we had to create a javascript... script, that parse the whole form and only takes what's needed in order not to exceed the 2k characters limit IE has.</p> <p>So far so good, the script was working fine until we added a <code>textarea</code> field which represents a <code>LongText</code> column in our DB. The problem seems to come from the fact SQL won't take a simple <code>String</code> in an SQL statement as a LongText.</p> <p>Here is what the query looks like:</p> <pre><code>SELECT * FROM SONORA.CF_CPR_CASE WHERE CASEFOLDERID != 2 and CMF_VLM_APPLICATION like '%CPR%' and CPR_DESCRIPTION='rererere' and CMF_TYPE_CASE_FK like '%LC_130125_074927_000001_60%' </code></pre> <p>But I get this error:</p> <pre><code>EJBException:; nested exception is: javax.ejb.EJBException: The data types ntext and varchar are incompatible in the equal to operator.S_EXCP(204); nested exception is: javax.ejb.EJBException: The data types ntext and varchar are incompatible in the equal to operator.S_EXCP(204) Found in FmsQuery: SELECT * FROM {{DBTABLEPREFIX}}CF_CPR_CASE WHERE CASEFOLDERID != 2 and CMF_VLM_APPLICATION like '%CPR%' and CPR_DESCRIPTION='ztztztztz' and CMF_TYPE_CASE_FK like '%LC_130125_074927_000001_60%' </code></pre> <p>We are using CASE360 which is not so known but still doesn't matter much, we are building the "where clause" of the SQL statement through javascript and then send it to the CASE360 processor which will take this all and execute the query. This part works fine, it's just the LongText column which is giving me a hard time.</p> <p>If you guys have any idea what this SQL Query should look like to be successfully interpreted then I'd be infinitely happy!</p> <p>Thank you for your help in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload