Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 17 total
Thread Forcing the Creation of Database Objects.
Sun, Jan 31 2016 4:56 PMPermanent Link

Steve Gill

Avatar

Hi all,

I am using EDB in client/server mode only.  When it's freshly installed I have a problem where a stored procedure needs to run when the application starts for the first time, but it gets an error saying the stored procedure doesn't exist yet.  

For some reason EDB is not creating everything when it's first accessed.  For example, only some of the tables are created and many of the stored procedures aren't being created straight away.

Is there a way to force EDB to create all database objects (tables, stored procedures, functions,etc.)?

Thanks.

= Steve
Mon, Feb 1 2016 3:29 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve


I think the answer to your problem depends on just what you're doing and how you're working out that things haven't been created.

Tables first - are you checking to see if the tables exist in the catalog or just looking on the disk. If the latter then the disk files will only be created when they are first accessed.

If you're looking in the catalog then, as with the store procedures, it probably depends on how you've gone about installing things. Can you show the code you're using to create the database, tables, stored procedures and functions?

Roy Lambert
Mon, Feb 1 2016 4:00 AMPermanent Link

Steve Gill

Avatar

Hi Roy,

<< I think the answer to your problem depends on just what you're doing and how you're working out that things haven't been created. >>

I get an error message stating that the stored procedure doesn't exist when the application starts.  If I open the database in EDB Manager first then the error doesn't occur.

<< Tables first - are you checking to see if the tables exist in the catalog or just looking on the disk. If the latter then the disk files will only be created when they are first accessed. >>

It's just the stored procedures I'm having problems with at this stage.

<< If you're looking in the catalog then, as with the store procedures, it probably depends on how you've gone about installing things. Can you show the code you're using to create the database, tables, stored procedures and functions?  >>

A script in the custom server checks to see if the database exists and runs a script if it doesn't.  The script comes from the reverse engineering option in EDB Manager.

= Steve
Mon, Feb 1 2016 4:58 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve

><< I think the answer to your problem depends on just what you're doing and how you're working out that things haven't been created. >>
>
>I get an error message stating that the stored procedure doesn't exist when the application starts. If I open the database in EDB Manager first then the error doesn't occur.

><< Tables first - are you checking to see if the tables exist in the catalog or just looking on the disk. If the latter then the disk files will only be created when they are first accessed. >>
>
>It's just the stored procedures I'm having problems with at this stage.

><< If you're looking in the catalog then, as with the store procedures, it probably depends on how you've gone about installing things. Can you show the code you're using to create the database, tables, stored procedures and functions? >>
>
>A script in the custom server checks to see if the database exists and runs a script if it doesn't. The script comes from the reverse engineering option in EDB Manager.

What happened between the original post and this one to stop tables being a problem?

Since EDBManager is only an application my first guess is its something to do with your code. When you open the database in EDBManager do you mean after the script has been run or do you mean that you run the script in EDBManager? Are you using the custom server with EDBManager or f/s or the standard server?

Roy Lambert
Mon, Feb 1 2016 5:21 AMPermanent Link

Steve Gill

Avatar

Hi Roy,

<< What happened between the original post and this one to stop tables being a problem?  >>

Well, actually I never said that there were problems with the tables except that they weren't appearing in the physical data folder.  

<< Since EDBManager is only an application my first guess is its something to do with your code. When you open the database in EDBManager do you mean after the script has been run or do you mean that you run the script in EDBManager? Are you using the custom server with EDBManager or f/s or the standard server? >>

Yes I mean after the script has run by the custom server.

Here's what happens.  The custom database server runs the script to create all of the database objects.  When the application is run, there are some stored procedures that don't exist and so I get error messages.

In an attempt to find out what's going on, I used EDB Manager to have a look at the database.  So what I do as part of the investigation is delete everything, start the custom server again to create everything BUT this time instead of starting the application I run EDB Manager and open the database.  I don't know what EDB Manager does but when I do this everything exists.  If I THEN run the application it works fine.  So something in EDB Manager is creating everything.

= Steve
Mon, Feb 1 2016 7:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve


>Well, actually I never said that there were problems with the tables except that they weren't appearing in the physical data folder.

OK I misunderstood

>Here's what happens. The custom database server runs the script to create all of the database objects. When the application is run, there are some stored procedures that don't exist and so I get error messages.
>
>In an attempt to find out what's going on, I used EDB Manager to have a look at the database. So what I do as part of the investigation is delete everything, start the custom server again to create everything BUT this time instead of starting the application I run EDB Manager and open the database. I don't know what EDB Manager does but when I do this everything exists. If I THEN run the application it works fine. So something in EDB Manager is creating everything.

NO! EDBManager does not create anything without you telling it to.

In your application add the following query after the database has been opened

SELECT LIST(Name)AS Procs  FROM Information.Procedures

Use ShowMessage to display the contents of Procs - it should give you the names of the store procedures. Do the same for Information.Functions

I also wonder about timing - if your application is accessing the database whilst everything is in the process of being created. Without code to review, and test,t there's nothing much anyone can do.

Roy Lambert

Mon, Feb 1 2016 8:30 AMPermanent Link

Matthew Jones

Steve Gill wrote:

> The custom database server runs the script to create all of the
> database objects.

I'd want to see logs from that - any errors? How do you know it really
worked properly (indeed, it presumably didn't)?

Set it up in a virtual machine with plain OS, and start over. Does it
consistently fail? I wonder if there is actually some sort of
dependency in the script, sort of where the database backup destination
doesn't yet exist, so fails, so the rest of the script fails. Then when
you run it again, the directory does exist, so you don't see the error.

Just my thoughts - logging would be what I'd want to start with,
otherwise you can't get forensic.

--

Matthew Jones
Mon, Feb 1 2016 9:20 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Matthew


Good points. I'm assuming the script does work correctly since things are OK if Steve looks in EDBManager. Since its not going to create things unless its told to the problem is most likely the app which is why I wonder about a timing problem - never had one myself but you never know.

Roy Lambert
Mon, Feb 1 2016 10:06 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

Via email:

<< So I'm guessing that EDB Manager finishes creating all of the database  objects? >>

No, as Roy said in that thread, the EDB Manager doesn't create *anything* without you initiating the creation via SQL or interactive operations.

Could you email me the script that you're using ?

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Feb 1 2016 3:52 PMPermanent Link

Steve Gill

Avatar

Hi Tim,

<< No, as Roy said in that thread, the EDB Manager doesn't create *anything* without you initiating the creation via SQL or interactive operations.

Could you email me the script that you're using ?  >>

Script emailed.

Thanks.

= Steve
Page 1 of 2Next Page »
Jump to Page:  1 2
Image