Fun with Views

Beatrix Willius bwillius at gmx.de
Wed Jul 11 12:55:48 CDT 2007


Hello,

I'm trying to find duplicates within my database and thought I could  
try the view feature. But there are some problems:

1. Using

create view "CheckDuplicates" as (select "CheckSum", count 
("CheckSum") as CountOfDup from "Message" group by "CheckSum")

in VStudio works, but

create view if not exists "CheckDuplicates" as (select "CheckSum",  
count("CheckSum") as CountOfDup from "Message" group by "CheckSum")

as per wiki gives the errors:

19:23:54: Error: line 1:13: unexpected token: if
19:23:54: Error: Kernel error: 0x71000
19:23:54: Error: line 1:13: unexpected token: if

2. How do I show the newly created with in the SQLBuilder in VStudio?  
Shouldn't there be a third category Views next to Tables and Links?

3. Tried to build my SQL by hand:

select * from Message inner join CheckDuplicates on  
CheckDuplicates.CheckSum = Message.CheckSum where  
CheckDuplicates.CountOfDup > 1

But this only give a lovely hard crash within VStudio.

Thread 0 Crashed:
0   libvkernel_fat_release.dylib   	0x0a24b664  
fbl::vsql::Node_Table_Join::PreprocessSql(fbl::vsql::SqlEnvironment&)  
+ 620
1   libvkernel_fat_release.dylib   	0x0a23d498  
fbl::vsql::Node_TableExpr::PreprocessSql_From 
(fbl::vsql::SqlEnvironment&) + 140
2   libvkernel_fat_release.dylib   	0x0a2458c4  
fbl::vsql::Node_TableExpr::PreprocessSql(fbl::vsql::SqlEnvironment&)  
+ 52
3   libvkernel_fat_release.dylib   	0x0a22fd54  
fbl::vsql::Node_QuerySelect::PreprocessSql 
(fbl::vsql::SqlEnvironment&) + 140
4   libvkernel_fat_release.dylib   	0x0a236304  
fbl::vsql::Node_Select::PreprocessSql(fbl::vsql::SqlEnvironment&) + 92
5   libvkernel_fat_release.dylib   	0x0a0753d8  
fbl::vsql::SqlParser::PreprocessCommand(fbl::vsql::SqlEnvironment&) +  
292
6   libvkernel_fat_release.dylib   	0x0a0765d4  
fbl::vsql::SqlParser::SqlQuery(fbl::vsql::I_SqlDatabaseEx*,  
fbl::String const&, fbl::vsql::ECursorLocation, fbl::vsql::ELockType,  
fbl::vsql::ECursorDirection,  
fbl::smart_ptr<fbl::ArrayOfSmartPtrs<fbl::smart_ptr<fbl::I_Value> >  
 >) + 740
7   libvkernel_fat_release.dylib   	0x0a1bab4c  
fbl::vsql::SqlDatabase::SqlQuery(fbl::String const&,  
fbl::vsql::ECursorLocation, fbl::vsql::ELockType,  
fbl::vsql::ECursorDirection,  
fbl::smart_ptr<fbl::ArrayOfSmartPtrs<fbl::smart_ptr<fbl::I_Value> >  
 >) + 136
8   libvkernel_fat_release.dylib   	0x0a275670  
fbl::vsql::LocalConnection::SqlQuery(fbl::String const&,  
fbl::vsql::ECursorLocation, fbl::vsql::ELockType,  
fbl::vsql::ECursorDirection,  
fbl::smart_ptr<fbl::ArrayOfSmartPtrs<fbl::smart_ptr<fbl::I_Value> >  
 >) + 140
9   V2.bundle                      	0x0b088508  
vsV2_EmbeddedConnection::SqlQuery(wxString const&, vsECursorLocation,  
vsELockType, vsECursorDirection, wxString const*) + 300
10  SQL.bundle                     	0x0afc5ce0  
vsSQLEditor::ExecuteSingleSQL(wxString const&) + 120
11  SQL.bundle                     	0x0afc6e9c  
vsSQLEditor::OnSQLExecute(wxCommandEvent&) + 264
12  libwx_mac.dylib                	0x01042a90  
wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&,  
wxEvtHandler*, wxEvent&) + 180
13  libwx_mac.dylib                	0x01042ce0  
wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 152
14  libwx_mac.dylib                	0x010435f8  
wxEvtHandler::ProcessEvent(wxEvent&) + 212
15  libwx_mac.dylib                	0x010c86e4 wxWindowBase::TryParent 
(wxEvent&) + 108
16  SQL.bundle                     	0x0afe5518 vsSQLButton8::OnLeftUp 
(wxMouseEvent&) + 300
17  libwx_mac.dylib                	0x01042a90  
wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&,  
wxEvtHandler*, wxEvent&) + 180
18  libwx_mac.dylib                	0x01042ce0  
wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 152
19  libwx_mac.dylib                	0x010435f8  
wxEvtHandler::ProcessEvent(wxEvent&) + 212
20  libwx_mac.dylib                	0x0119de7c  
wxMacTopLevelMouseEventHandler(OpaqueEventHandlerCallRef*,  
OpaqueEventRef*, void*) + 868
21  libwx_mac.dylib                	0x0119eed0  
wxMacTopLevelEventHandler(OpaqueEventHandlerCallRef*,  
OpaqueEventRef*, void*) + 3304
22  com.apple.HIToolbox            	0x931e5554 DispatchEventToHandlers 
(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 692
23  com.apple.HIToolbox            	0x931e4cac  
SendEventToEventTargetInternal(OpaqueEventRef*,  
OpaqueEventTargetRef*, HandlerCallRec*) + 372
24  com.apple.HIToolbox            	0x931eba60 SendEventToEventTarget  
+ 40
25  com.apple.HIToolbox            	0x93277d48  
HandleMouseEventForWindow(OpaqueWindowPtr*, OpaqueEventRef*, unsigned  
short) + 236
26  com.apple.HIToolbox            	0x932772c0 HandleMouseEvent 
(OpaqueEventRef*) + 368
27  com.apple.HIToolbox            	0x931ebdcc  
ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*,  
OpaqueEventRef*, void*) + 496
28  com.apple.HIToolbox            	0x931e57a4 DispatchEventToHandlers 
(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1284
29  com.apple.HIToolbox            	0x931e4cac  
SendEventToEventTargetInternal(OpaqueEventRef*,  
OpaqueEventTargetRef*, HandlerCallRec*) + 372
30  com.apple.HIToolbox            	0x931eba60 SendEventToEventTarget  
+ 40
31  libwx_mac.dylib                	0x011687f4  
wxApp::MacHandleOneEvent(void*) + 52
32  libwx_mac.dylib                	0x01168900 wxApp::MacDoOneEvent()  
+ 156
33  libwx_mac.dylib                	0x01278530 wxEventLoop::Dispatch 
() + 52
34  libwx_mac.dylib                	0x01278330 wxEventLoopManual::Run 
() + 204
35  libwx_mac.dylib                	0x0100c3c8 wxAppBase::MainLoop()  
+ 88
36  libwx_mac.dylib                	0x011f8e98 wxEntry(int&,  
wchar_t**) + 144
37  ...digmasoft.valentina.vstudio 	0x0001ee70 main + 24
38  ...digmasoft.valentina.vstudio 	0x00002c40 _start + 760
39  ...digmasoft.valentina.vstudio 	0x00002944 start + 48

4. The new view doesn't show up in auto complete as the other tables  
and fields do.

5. The SQLBuilder has a "white zone" of about two centimeters on the  
right side and field names are cut off in this area.

Using VStudio 3.1 and normally v4rb 3.1 on Realbasic 2007R3. Is this  
supposed to work? I haven't used views before, but I use a technique  
like this in Access to fish out duplicates with a saved query. The  
database itself is a plain vanilla one with a 1:m relation between  
the tables. The field CheckSum contains (guess what) checksum  
information.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: archive, clean and search email
http://www.beatrixwillius.de
Fractals, 3d landscapes etc.



More information about the Valentina mailing list