Start a new topic

as400 to view content of a member

[This topic is migrated from our old forums. The original author name has been removed]

Hi! I try to display the content of a member in DBVis. To view the content of a member via SQL first you have to create an alias to referring to it. For example: create alias qtemp.xxx for schema_name.table_name(member_name); After that you can display its content via: select * from qtemp.xxx; I have put these two above commands in a tag and I used it in member's ObjectView. It works fine when you first displays a member content but if you come back later to Object view panel by clicking on the same member in the tree view it fails because the alias already exists. Actually I don't know where and how to drop this temporary alias in the profile which is needed only for displaying the content of a member. I tried to put the drop alias statement before create alias or after select statement but both cases caused problem. Is anybody an idea how to handle this issue? Cheers, Zsolt

[This reply is migrated from our old forums.]

Re: as400 to view content of a member
Hi, If you need to run two SQL statements in a single then make sure these are separated with a semicolon. If that doesn't work, let me know what error you get. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]
[Attachment has been removed.]

Re: as400 to view content of a member
Yes, I have used semicolon to execute multiple SQL statements. I have attached my as400.xml profile by the way. Probably it helps to understand what is the issue. This way it works fine when you first view the content of a member (create alias and use that in the select). But when you display it again the same member it tries to create an already existing alias which cause SQLException. So this way is not a nice implementation to view members. I tried several way to avoid this. Nr 1: dropping the alias before the create alias statement in the above Command. This caused SQLException. Nr 2: dropping the alias after the select statement in the above Command. This caused not displaying the content of the member. I need some kind of conditional SQL statement execution: e.g. If the alias already exists then drop it. Is it possible somehow to implement it in profile? Cheers, Zsolt
[This reply is migrated from our old forums.]

Re: as400 to view content of a member
Zsolt, Currently when one statement in multi statement Command fail, it will stop and report the error. So in your case where it would be fine continuing due to that the alias already exist this will not work as you've discovered. In the next version we will add the continueonerror="true" attribute for the element. The effect of this is that any error from the first create alias will be ignored. Regards Roger
[This reply is migrated from our old forums.]

Re: as400 to view content of a member
Zsolt, This is now fixed in the 8.0.8 version. http://www.dbvis.com/products/dbvis/download/ Regards Roger