Assistance needed on query

Bart Pietercil bart.pietercil at gmail.com
Mon May 14 13:00:31 CDT 2007


Hi Ruslan,

back on the screen...


John is right, I do use this '' as 'mycompetenceid' as an expression  
and by itself Valentina has no problems with it.
This way I can use my subclassed listbox (ValentinaListbox) to store  
an extra key in a dictionary describing the returned record.

In another place I use this query without problem:

SELECT recid, '' AS 'mycompetenceid',competence_name FROM  
competence_cards WHERE profile_ptr = ?"

Works without problems, mySubClass just gets a cursor with an extra  
field


This one:


     SELECT competence_cards.recid, competence_cards.competence_name  
FROM competence_cards  JOIN my_competences ON  
'compcards_to_my_competences' WHERE competence_cards.profile_ptr = ?  
AND my_competences.recid = 1

gives the Vexception

as you can see I left out the '' as competenceid part for debugging  
purposes. This does not help, I still get the
SEMANTIC error message

Of course all this would not be a problem if I could use VStudio :-(


Bart




On 14-mei-07, at 19:24, Ruslan Zasukhin wrote:

> On 14/5/07 4:02 PM, "Sims, John (CDC/CCHP/NCBDDD) (CTR)"  
> <ayu8 at CDC.GOV>
> wrote:
>
> Hi John,
>
>>> Can be
>>>
>>>     SELECT f1
>>>     SELECT f1 as 'alias'
>>>     SELECT expr as 'alias'
>>>
>>> But you have
>>>
>>>     select '' as 'alias'
>>>
>>> What means EMPTY single quotes?
>>>
>>>
>>> --
>>> Best regards,
>>>
>>> Ruslan Zasukhin
>>> VP Engineering and New Technology
>>> Paradigma Software, Inc
>>>
>>
>> Hi Ruslan,
>>
>> I've seen this trick before.  For many databases, this gives you a
>> column of "blanks", or other "default" values.  We used to use this
>> trick for binding the datatable (cursor) to a datagrid when we  
>> wanted to
>> include columns that had nothing to do with the database.
>>
>> For example:
>>
>> Select FirstName, LastName, Address, City, State, Zip, TRUE as
>> 'PrintNow' FROM Addresses
>>
>> Now, when you get the datatable, you bind it to the grid and have a
>> "PrintNow" column with each line set to TRUE by default.  We would  
>> never
>> store the "PrintNow" data in the database and this way you didn't  
>> have
>> to modify the datatable after the results were returned from the
>> database just to add the "PrintNow" column.  Having the "PrintNow"
>> column in the datatable made it easier to pass this information to
>> related processes.
>>
>> I hope I made sense.
>
> But you describe in fact this case:
>>>     SELECT expr as 'alias'
>
> NOT
>>>     select '' as 'alias'
>
> First case works in Valentina also I believe.
>
>
> -- 
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list