web stats
Problem with transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2007, 06:22 AM
orande orande is offline
Mirth Newb
 
Join Date: Jun 2007
Posts: 18
orande
Default Problem with transformer

I have a simple transformer:

# variable Mapping
0 identificador msg['identificador'].toString()
1 nombre msg['nombre'].toString()
2 valor JavaScript

Where, the code to 'valor' variable is:

var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('oracle.jdbc.OracleDriver', 'jdbcracle:thin:@dev-b05:1521:PRUEBAMIRTH', 'prueba', 'prueba');
var valor_origen = msg['valor'].toString();
var expression = "Select valor2 from mapeo where (valor1 like '" + valor_origen + "%')";
var result = dbConn.executeCachedQuery(expression);
result.next();
var returnval = result.getString(1);
result.close();
connectorMap.put('valor',returnval);
dbConn.close();

When i tried save a row into DB, i get a error:

FAILURE: Error writing to database:
SQLException
ORA-00911: invalid character
Query: INSERT INTO pruebamirth2 (identificador, nombre, valor) VALUES (?, ?, ?); Parameters: [1, Prueba, OTE]

How i can solve this?

Thanks!
Reply With Quote
  #2  
Old 10-22-2007, 12:10 PM
albertosaez albertosaez is offline
 
Join Date: Sep 2006
Location: Valladolid, Spain
Posts: 842
albertosaez is an unknown quantity at this point
Default Re:Problem with transformer

AFAIK the problem is not related to your trasformer, but your destination SQL writer. Perhaps you've forgotten the "'".
Reply With Quote
  #3  
Old 10-23-2007, 04:20 AM
orande orande is offline
Mirth Newb
 
Join Date: Jun 2007
Posts: 18
orande
Default Re:Problem with transformer

I can see that transformer work well.

When I filter errors, in mappings show a correct value (after transformation process).

I use the same line command when the variable is create with javascript transformation to insert into database writer:

INSERT INTO pruebamirth2 (identificador, nombre, valor) VALUES (${identificador}, ${nombre}, ${valor});

Why if i use variable mapper by connector it work well?.
Reply With Quote
  #4  
Old 10-23-2007, 05:37 AM
orande orande is offline
Mirth Newb
 
Join Date: Jun 2007
Posts: 18
orande
Default Re:Problem with transformer

Wow!. Ok.

In the line command i put a ";" at end. Without this, work it.

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transformer problem? cableops Support 4 09-19-2006 07:58 PM


All times are GMT -8. The time now is 12:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation