Page 1 of 1

Logical View Other Files

Posted: Wed Oct 19, 2016 2:56 pm
by nazirul_fitri
Hi there,

I have load existing tables from my db with option 'load other file' into lansa. It compiled perfectly. but it seems i cant add new logical views to the file i recently added. I need that logical view to make a filter in VLF One. Please Help

Re: Logical View Other Files

Posted: Wed Oct 19, 2016 2:58 pm
by wizard
Nobody gonna help you man. Not much people know lansa.

Re: Logical View Other Files

Posted: Wed Oct 19, 2016 3:05 pm
by MarkD
My understanding is that files (tables) are either defined and maintained by LANSA, or they are defined and maintained by some other external tool - this is called an OTHER file.

You can’t change an OTHER file in LANSA.

To change an OTHER file, alter it using the external tool, then reload the changed definition into LANSA again and recompile the I/O module.

Re: Logical View Other Files

Posted: Wed Oct 19, 2016 3:07 pm
by nazirul_fitri
MarkD wrote:My understanding is that files (tables) are either defined and maintained by LANSA, or they are defined and maintained by some other external tool - this is called an OTHER file.

You can’t change an OTHER file in LANSA.

To change an OTHER file, alter it using the external tool, then reload the changed definition into LANSA again and recompile the I/O module.
what if i load other file into lansa and then copy it as lansa file, does it also copy all the data in the tables or not??

Re: Logical View Other Files

Posted: Wed Oct 19, 2016 3:15 pm
by MarkD
Sorry, I don't know the answer to that for sure.
I would think the answer is no, but writing and running a program like this should solve that.

select *all from_file(OTHER)
insert fields(*all) to_File(YOURCOPY)
endselect

Re: Logical View Other Files

Posted: Wed Oct 19, 2016 3:17 pm
by nazirul_fitri
MarkD wrote:Sorry, I don't know the answer to that for sure.
I would think the answer is no, but writing and running a program like this should solve that.

select *all from_file(OTHER)
insert fields(*all) to_File(YOURCOPY)
endselect
and where should i run this script?

Re: Logical View Other Files

Posted: Wed Oct 19, 2016 3:29 pm
by MarkD
It's not a script - it's intended to be part of a LANSA program written in RDMLX.

Assuming you are working with VL-Web applications, create a basic web form with a "Copy" button that calls a server module's SrvRoutine in the usual way. In the called server module's SrvRoutine execute the select/insert loop - so maybe 6 lines of RDMLX code in the web page and 8 lines of RDMLX code in the server module.

Alternatively, you could just write a stand alone RDMLX function and call it from a command line using the X_RUN.EXE interface.