LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  What is correct syntax for JDBS Execute node?

    Employee
    Posted 05-29-2011 23:14

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: MingZhao

    I have a line of script in a JDBC Execute node as below that failed to execute:
    sqlSelect(1, "select * from DBO.PPLOAD_LINEITEMDETAILVALUE where IDENT = :1", ID)

    The node has 1 input and 1 output, and the data columns do exist in the database and input pin. I confirmed all parameters are correct by running a JDBC Query node successfully on script:
    select * from DBO.PPLOAD_LINEITEMDETAILVALUE

    I checked the syntax is the same as in a DB Execute node.

    Thus I cannot figure out what is wrong in the script for JDBS Execute.

    The node created the following error message:

    Installing log (05/30/2011 15:37:50) ...
    2011-05-30 15:37:50; Level: 3; Type: 0; Desc: "error on row 0. java.sql.SQLException: Incorrect syntax near '1'."; File: "SQLRunner.java"; Line: 217; Context: "nodeMain"
    Uninstalling log (05/30/2011 15:37:50) ...

    Error: property ls.brain.node.java.logLevel set incorrectly (set to 2)Error: Allowed values are Critical, Error, Warning, Info, DebugError: Using Warning

    Any assistance is appreciated.

    Ming Zhao


  • 2.  RE: What is correct syntax for JDBS Execute node?

    Employee
    Posted 05-30-2011 05:37

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    The SQL syntax varies by vendor. DBO leads me to believe this might be a MS-SQL server.
    Try this:

    sqlSelect(1, "select * from DBO.PPLOAD_LINEITEMDETAILVALUE where IDENT = ?", ID)


  • 3.  RE: What is correct syntax for JDBS Execute node?

    Employee
    Posted 05-31-2011 19:33

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: MingZhao

    Hi Stony,

    Thanks for your reply. Yes it is MS SQL. I tried your suggested format but it doesn't work. The error message is the same as before. Also I tried ?1 and 1? and hit with the same error.

    More assistance please.

    Ming


  • 4.  RE: What is correct syntax for JDBS Execute node?

    Employee
    Posted 06-01-2011 18:03

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: MingZhao

    Further on my previous enquiry, I attach a sample graph here for you to check. You can see the nodes to load or query the whole table work okay; and okay with an explicit text parameter for select. But none of the other nodes work. That includes using input pin as parameter, truncate table, and insert into the table.

    because some nodes worked, the connection problem can be ruled out.

    I am really stuck with this graph. Please assist. Thank you.
    Attachments:
    Loading_PCMAT.brg
    Loading_PCMAT.brp
    Loading_PCMAT_run4de6ccc3290c5bb8.brs
    Loading_PCMAT.brx


  • 5.  RE: What is correct syntax for JDBS Execute node?

    Employee
    Posted 06-09-2011 13:22

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    You are using the syntax for DB Execute, which uses sqlSelect. In the JDBC Execute node, you don't use sqlSelect, you just put the select statement in the block (with ? for bindings), and list the fields for the bindings in the SqlQueryFieldBindings parameter.

    Cheers
    Rich


  • 6.  RE: What is correct syntax for JDBS Execute node?

    Employee
    Posted 06-09-2011 19:32

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: MingZhao

    Thanks Rich for your reply. Mario helped fix this issue. Thank you Mario as well.