Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Guys, good morning!
I have a problem working with DATASUL, and a table of movement payroll I have 3 array where fields are delimited by ';' are the event codes, quantity and value of the event event. How can I separate this array making each event code is a record and comes with its value and quantity? The field is represented as the example below:
cdn_evento_fp -> 001, 031, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
qtd_event_fp -> 180, 40, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ...
val_event_fp -> 1000.00, 200.00, 1200, 00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
Hello Hugo,
you can use a combination of subfield and LOAD While:
RawData:
LOAD * INLINE [
cdn_evento_fp, qtd_event_fp, val_event_fp
"001, 031, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "180, 40, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "1000.00, 200.00, 1200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"
];
ResultData:
NOCONCATENATE LOAD
subfield(cdn_evento_fp, ',', IterNo()) as cdn_evento_fp,
subfield(qtd_event_fp, ',', IterNo()) as qtd_event_fp,
subfield(val_event_fp, ',', IterNo()) as val_event_fp
Resident RawData
While subfield(cdn_evento_fp, ',', IterNo())>0;
Drop Table RawData;
- Ralf
use subfield funtion.
I used, but it did not work is returning the wrong values and quantities
if possible upload your file...
Manish, thank you for help me... but I got it! I used wrong sintax, You you were right!
Hello Hugo,
you can use a combination of subfield and LOAD While:
RawData:
LOAD * INLINE [
cdn_evento_fp, qtd_event_fp, val_event_fp
"001, 031, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "180, 40, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "1000.00, 200.00, 1200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"
];
ResultData:
NOCONCATENATE LOAD
subfield(cdn_evento_fp, ',', IterNo()) as cdn_evento_fp,
subfield(qtd_event_fp, ',', IterNo()) as qtd_event_fp,
subfield(val_event_fp, ',', IterNo()) as val_event_fp
Resident RawData
While subfield(cdn_evento_fp, ',', IterNo())>0;
Drop Table RawData;
- Ralf
Thank you!
So it was easier than what I did.
Hugo!,
how did you connect with datasul? with ODBC? did you buy any license?
does the database has a password?
I use ODBC connection with User name and password to the database, which is usually sysprogress. And no need to buy to use the ODBC license.