• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

IB6 MetaData Change

Hi,

After creating or droping a view (with a TIBQuery) the new view is not recognized by other IBDataBases and IBConsole. How can I notify them about the metadata changes? (Even after  TIBDatabase.FlushSchema and reopening the DataBase it could not see any change.)

Any idea?

Regards, Laci


0
Laci030999
Asked:
Laci030999
  • 4
  • 2
1 Solution
 
tkalchevCommented:
Then how are you sure that the execution of the TIBQuery is successful ? Are you really sure that you have created/dropped the view ?
0
 
tkalchevCommented:
Sounds like not commited transaction ...
0
 
Laci030999Author Commented:
1. When trying to Execute the same query again it raises an Exception, that the view exists.

2. After droping a view with the IBQuery which is visible to IBConsole, It stays visible in IBConsole but when I try to drop the same view from there, I receive an Exception, that the view does not exists.

3.After shoting down the IB server, and starting again , the changes becomes visible to IBConsole as well. The only way I've found to notify IBConsole about the changes was to do this. :(


I forgot to mention, that curently I'm using public licence version of IB 6.01.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
tkalchevCommented:
Are you able to see the newly created view in IBConsole after closing your program without shutting down the server ?
0
 
tkalchevCommented:
Also just noticed you are using IBQuery for creating/dropping view. As I believe, IBQuery is more useful for sql commands, which return some data :

--Delphi Help--
Use TIBQuery to access one or more tables in a database using SQL statements. The TIBQuery component provides a read-only dataset, and adapts well to the InterBase client/server environment.


Maybe is a good solution to use IBSQL instead. And to make sure that the transaction is commited :


  IBSQL1.SQL.Text := 'drop view VIEW1';
  try
    IBSQL1.ExecQuery;
    IBSQL1.Transaction.Commit;
  except
    IBSQL1.Transaction.Rollback;
    ShowMessage ( 'Error' );
  end;


 
0
 
Laci030999Author Commented:
U R right. It was simply not committed. ;-)

I'm new to SQL. This far I've been using IBconsole which does not require commiting SQLs which change the MetaData. For some reason I thought it should be the same when using IBQuery. :))

It is working now!!

Thank You for your help,
Laci
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now