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.  Pass information through DB Execute

    Employee
    Posted 12-14-2007 15:00

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

    Originally posted by: robby123

    I am trying to pass information from an input file to my output of a DB execute node. It will work if the pass through info doesn't change but not otherwise. Is there a way to do this that I'm not thinking of?

    This one ( with the static data )works:
    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=4755dec834e55222
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    CODE:string,BLAH:string
    "67I3","BLAH_BLAH"
    "66H2","BLAH_BLAH"
    EOX
    editor:XY=470,50
    end:Static_Data

    node:Working_Pass
    bretype:core::DB Execute
    editor:Label=Working Pass
    editor:sortkey=4756f948276c0825
    input:4756f973091c0fff/in1=Static_Data.40fe6c55598828e5
    output:4756fa0a223e2593/1out=
    prop:CommitFrequency=1
    prop:DbInterface=OCI
    prop:DbPassword=mypassword
    prop:DbService=someDB
    prop:DbUser=myuserid
    prop:Script=<<EOX
    sqlSelect(1,strcat("Select ms.*, '", 'BLAH', "' as BLAH1 from multisec0 ms where PRODUCTCD = :1"),'CODE')
    EOX
    editor:XY=600,50
    end:Working_Pass

    This one which is more like what we would be needing this for does not work:
    node:NonWorking_Pass
    bretype:core::DB Execute
    editor:Label=Non-Working Pass
    editor:sortkey=4756f948276c0825_2
    input:4756f973091c0fff/in1=Static_Data_2.40fe6c55598828e5
    output:4756fa0a223e2593/1out=
    prop:CommitFrequency=1
    prop:DbInterface=OCI
    prop:DbPassword=mypassword
    prop:DbService=someDB
    prop:DbUser=myuserid
    prop:Script=<<EOX
    sqlSelect(1,strcat("Select ms.*, '", 'BLAH', "' as BLAH1 from multisec0 ms where PRODUCTCD = :1"),'CODE')
    EOX
    editor:XY=530,230
    end:NonWorking_Pass

    node:Static_Data_2
    bretype:core::Static Data
    editor:sortkey=4755dec834e55222_2
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    CODE:string,BLAH:string
    "67I3","BLAH_BLAH"
    "66H2","BLAH_BLAH1"
    EOX
    editor:XY=370,230
    end:Static_Data_2


    Any help is much appreciated.


  • 2.  RE: Pass information through DB Execute

    Employee
    Posted 12-14-2007 23:36

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

    Originally posted by: NerdMachine

    I think the strcat() is evaluated once when the brainscript is compiled. You are already using the positional paramater, :1, so try using a :2.

    sqlSelect(1,strcat("Select ms.*, ':2' as BLAH1 from multisec0 ms where PRODUCTCD = :1"),'CODE','BLAH')

    -NerdMachine


  • 3.  RE: Pass information through DB Execute

    Employee
    Posted 12-17-2007 14:41

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

    Originally posted by: robby123

    No love there either. I tried that first, but I am not sure that sqlSelect allows more than one variable expression unlike sqlNonSelect which does. When I run the code as suggested I get the following error:

    ERROR processing data:
    index out of bounds: 1 / 1


  • 4.  RE: Pass information through DB Execute

    Employee
    Posted 05-07-2008 18:21

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

    Originally posted by: mmarinelli

    I believe that the DB Execute node prohibits changes to the output schema objects, because these could result in changes to the output metadata, which must be consistent for a BRAIN node. For example, if I were to execute the statement ("SELECT SYSDATE AS " + FOO + " FROM DUAL"), using FOO as an input field, I could get a different output field name for each line of data, which a BRAIN node can't handle.