infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
retrieve items from list and convert (ODBC)
System
Originally posted by Doug Stelley
I
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Doug,
OK to start with the xlateOutVals in this example
{{{2011-04-01 10:00:26.000} {2004-01-20 08:39:06.000} 154 1864}}
is a nested list (I think you tried too hard to make xlateOutVals a list).
The first nest only has one element and it is:
{{2011-04-01 10:00:26.000} {2004-01-20 08:39:06.000} 154 1864}
The above is what I think you really want but to continue...
The second nest is:
{2011-04-01 10:00:26.000} {2004-01-20 08:39:06.000} 154 1864
within this nest is another set of lists (the 2 date/time elements) which have 2 elements each.
In order to get the date you want you first have to properly navigate the list you have set up. I would suggest trying to reduce the nesting (share your code and perhaps we can assist with getting that pared down).
Once you get to the date portion of the date/time element (index 0 of that list) you will get something like 2011-04-01.
Then use the clock command.
set junk [clock format [clock scan "2011-4-01"] -format %Y%m%d]
The litreral with the date above will be replaced with the appropriate lindex once we get your list cleaned up.
System
Originally posted by Doug Stelley
here is a snippet from the SQL command:
set xlateOutVals [list [sql "SELECT PatientProfile.LastModified, PatientProfile.Created, PatientProfile.FacilityId, PatientProfile.RaceMId
FROM PatientProfile WHERE (((PatientProfile.PatientId)='$xlateInVals'));"]]
Thats what produced the
{2011-04-01 10:00:26.000} {2004-01-20 08:39:06.000} 154 1864
I was able to get the "154" by using
set myloc [lindex [lindex [lindex $xlateOutVals 0] 0] 2]
However I was not able to use "myloc" in a later COPY command.
I'm looking for examples on creating something along the lines of
set xlateOutVals 0 to be the first date
set xlateOutVals 1 to be the second date
set xlateOutVals 2 to be the "154"
set xlateOutVals 3 to be the '1864"
Internal to the proc it was easy, how de I bring them forward?
I haven't looked at the clock portion yet....
Thanks!
System
Originally posted by Doug Stelley
It would like be easier to program a seperate proc for each ODBC call
and have them be in seperate COPY commands but I thought it would be more efficient to bundle them up.
System
Originally posted by Doug Stelley
for the clock portion;
using
set clock1 [lindex [lindex [lindex $xlateOutVals 0] 0] 1]
set junk [clock format [clock scan $clock1] -format %Y%m%d]
echo myclock:
here is the message:
MESSAGE 1
Tcl callout error
erroCode: NONE
errorInfo:
unable to convert date-time string "2004-01-20 08:39:06.000"
while executing
"clock scan $clock1"
Jim Kosloskey
Doug,
I have created multiple outbound from one inbound in the past by using xmpstore.
With that technique, I needed to use a CALL Action in the Xlate to invoke the proc rather than a COPY Action.
Jim Kosloskey
Doug,
You only need to use the date portion for what you want.
The date/time is a list in and of itself so you can lindex into that list as well.
For example
set clock1 [lindex [lindex [lindex $xlateOutVals 0] 0] 1]
at this point you have {2004-01-20 08:39:06.000}. This is a list. Now you only really need the first element of the list (2004-01-20). So if you do this:
set junk [lindex $clock1 0] <-- this should give you just the 2004-01-20
Or you could just increase your indexing above to get the same thing.
Now do your clockformat/clockscan with the junk or clock1 variable (whichever indexing method you used).
Keith McLeod
The command does not handle the .000 at the end of the time.