Logical View Other Files

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
nazirul_fitri
Posts: 21
Joined: Thu Sep 15, 2016 7:00 pm

Logical View Other Files

Post 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
wizard
Posts: 10
Joined: Thu Aug 25, 2016 12:48 pm

Re: Logical View Other Files

Post by wizard »

Nobody gonna help you man. Not much people know lansa.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Logical View Other Files

Post 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.
nazirul_fitri
Posts: 21
Joined: Thu Sep 15, 2016 7:00 pm

Re: Logical View Other Files

Post 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??
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Logical View Other Files

Post 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
nazirul_fitri
Posts: 21
Joined: Thu Sep 15, 2016 7:00 pm

Re: Logical View Other Files

Post 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?
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Logical View Other Files

Post 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.
Post Reply