Ah, of try and catch of course! Just like java :) I have to apologize for my 
inexperience with C++, and this really made my day, Ive been sitting here 
thinking about how the «#%%$ C++ handles exception, because having the program 
crash surely isn’t a good solution! Thank you!

Tor


4. mars 2014 kl. 14:36 skrev Wim Dumon <w...@emweb.be>:

> The manual says:
> Schema creation will fail if one or more tables already existed. 
> This method throws an Wt::Dbo::Exception if the table creation failed.
> 
> so:
> 
> try {
>   session_.createTables();
>   Wt::log("info") << "Database created";
> } catch (Wt::Dbo::Exception &) {
>   Wt::log("info") << "Using existing database";
> }
> 
> BR,
> Wim.
> 
> 
> 
> 2014-03-04 14:14 GMT+01:00 Tor Arne Fallingen <fallin...@gmail.com>:
> It seems to me that in Wt MySQL backend if I call create table and the table 
> already exist, the program crashes, and I can’t really find any method to 
> create table if it doesn’t exist. So how do you usually solve this? I want to 
> have the ability of creating the table automatically if it doesn’t exist, it 
> probably won’t exist the first time the system is turned on, but then 99% of 
> the rest of the time.
> 
> Tor
> 
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
> 
> 
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works. 
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk_______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to