Announcement

Collapse
No announcement yet.

executeCachedQuery issue - oracle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • executeCachedQuery issue - oracle

    hi there

    I am trying to retrieve nextvalue from an oracle sequence.

    but its failing at executecachedquery method. any pointers/suggestions highly appreciated.

    thanks in adavance

    code snippet below
    -------------------

    var sql = "select my_sequence.nextval as VAL from dual";

    var result = dbConn.executeCachedQuery(sql);

    result.next();

    var nextVal= result.getInt(1);

    logger.info("next value is->"+nextVal);


    error message below
    --------------------

    DETAILS: TypeError: Cannot find function executeCachedQuery in object [email protected]
    at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.evaluateScript(JavaScriptTransforme r.java:398)
    at com.mirth.connect.server.mule.transformers.JavaScr iptTransformer.transform(JavaScriptTransformer.jav a:296)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:487)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:266)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:225)
    at com.mirth.connect.connectors.vm.VMMessageReceiver. getMessages(VMMessageReceiver.java:221)
    at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:108)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:97)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1061)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :575)
    at java.lang.Thread.run(Thread.java:662)

  • #2
    never mind.. tried a different method and it worked. thanks !!.

    var sql = "select my_sequence.nextval as VAL from dual";
    var stmt = dbConn.createStatement();
    var result = stmt.executeQuery(sql);
    result.next();
    var nextVal= result.getInt(1);
    logger.info("next value is->"+nextVal);

    Comment

    Working...
    X