` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

SQL Related Articles: Simple SELECT builder
2004-04-19 -- Juanro
 
Newsgroups: softvelocity.clarion.databasedrivers Have you ever seen something like this? Test FILE(...) Record Field1 LONG Field2 LONG Desc STRING END Test{PROP:SQL} = 'SELECT Desc FROM Test WHERE ...' !error: invalid character value ... Do you have a file with a correct ...PROP:SQL = 'SELECT ...' and then you changed the file structure and "BANG!" ? (I was. Many times ) Since then I'm using this (see below) I guess many of you could have something similar, but anyway, here it is. Hope you find it usefull, best regards, Juanro ---------------------------------------------------------------------------- -------------------------------- BuildSelectList PROCEDURE (FILE ThisTable) ! Declare Procedure LOC:StrLine STRING(10000) ! CODE LOC:StrLine = '' count# = 1 LOOP f#=1 TO ThisTable{PROP:Fields} IF ThisTable{PROP:Type,f#}<>'GROUP' LOC:StrLine = CLIP(LOC:StrLine) & CHOOSE(count# > 1,',','') & CLIP(UPPER(ThisTable{PROP:Name,f#})) count# += 1 END END RETURN CLIP(LOC:StrLine) ---------------------------------------------------------------------------- ------------------------------ Use it like this: Test{PROP:SQL} = 'SELECT ' & BuildSelectList(Test) & ' FROM Test WHERE ...'


Today is May 5, 2024, 6:44 am
This article has been viewed 35116 times.
Google search has resulted in 29 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: