skorc123
17th November 2006, 11:55
Hi,

can anyone tell me if it is posible to access views created in Baan scheme of the datebase thrue Baan?

Have a nice day, Zoran

mr_suleyman
17th November 2006, 12:24
I think that it is not possible read views directly in BAAN.

shah_bs
21st November 2006, 18:32
You should only do this if there is very compelling reason to do it. (Because, if the tables are in BAAN, then any Display session that you create is effectively a 'view', since you can control what fields are seen and what are not - you do not really need views.)

Otherwise it can become a maintenance problem. [We did it for one table (so far) because any other alternatives were even more painful, and the table resides outside of BAAN in another application.]

- First create a table definition in BAAN as usual
- Do a convert to run-time DD
- DO NOT DO A CREATE TABLE in BAAN.

THEN, give a printout of the table definition to the DATABASE DBA and give him also the definition of the view (that is, basically the select statement that will 'populate' the view). There must not be any NULL fields - any records with NULL fields must be filtered out. (If the tables are in BAAN, this is not an issue, but if the tables are outside of BAAN, this becomes a problem. NULL values 'confuse' BAAN and will result in extremely poor performance while reading the view).

After the DBA 'establises' the view [now you can realize why it is maintenance problem - any time you need to change the view, you will need to involve the DBA], it is possible to read the view in BAAN as if it was any other BAAN table, for example, it is possible to Generate a display session, and view the results, and so on.

Unfortunately, I cannot describe the exact details of how the DBA creates the view, and especially how the 'authorizations' are set up for the view.

Hope this helps.

mark_h
21st November 2006, 19:24
We found that the view created by the DBA caused problems with other table changes. Everytime we needed to do a CRDD this table would come up with an error and not let us do the table we needed. Eventually we got rid of the view.

shah_bs
22nd November 2006, 17:26
Hello Mark.

Since you raised an important potential problem issue, I went back and checked on everything related to table creations and changes that I had done after the view we wanted was established.

I created four new tables since then and I modified one of them since then (in the package VRC that contains the view definition). I have not faced any errors during Create Runtime DD from within the Maintain Table Definitions session. SO, I went ahead and did a FULL Create Runtime DD today in my test environment, and did not get any error messages.

I suppose it is (unfortunately) an installation specific issue. If it is of any help, we are at Portingset 6.1c.06.04 (BAAN IVc3 + A&D2.2b), which could be a more lenient version of the portingset than what you may have.

ANYWAYS, I intend to keep your warning in mind and keep watch over this whenever I make table modifications. Thanks for the tip.

[Having said all this, I still would not use views if there were alternatives.]

mark_h
22nd November 2006, 18:13
Hello Mark.
I suppose it is (unfortunately) an installation specific issue. If it is of any help, we are at Portingset 6.1c.06.04 (BAAN IVc3 + A&D2.2b), which could be a more lenient version of the portingset than what you may have.

Glad to see others using A&D. We moved up to 4C4 and A&D1.0 (at least that is what everybody calls it). What I can not be sure of is if we did something wrong with creating the view. It worked fine until the first new table change went into place, then the errors started. This was well over a year ago and I can not remember what the view was for.
[Having said all this, I still would not use views if there were alternatives.]
I agree - we have stayed away from this so far, especially since we turned on the finance module.

shah_bs
22nd November 2006, 18:39
Hello Mark.

Just for completeness: I forgot to mention - in order to 'confine' the view, I created a new module under the ti package, and then proceeded to create the table definition. I do not know if this 'confinement' helps aleviate the problem that you reported during Create Runtime DD.

I don't know the details of how the DBA sets up the view, but the view definition itself is pretty straightforward. I give a fictitious example here:



CREATE OR REPLACE VIEW TTImmm001999
(T$FLD1, T$FDL2, T$REFCNTD, T$REFCNTU)
AS
select /*+ index (from_table from_table_index1) */
cast(to_char(field1) as char(12)) T$FLD1,
field2 T$FLD2,
0 T$REFCNTD,
0 T$REFCNTU
from schemaname.from_table@SID
where field2 is not null
with read only


where mmm is my new module, 999 is the Company Number - the 'table' name becoming timmm001 in the table definition.