DCBROWSECOL and DATA

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

DCBROWSECOL and DATA

#1 Post by Victorio »

Hi,

Only little question, about correct syntax, how can I implement here conversion function convtoansiCP() :

DCBROWSECOL DATA SQLFieldBlock(qoDataset,qoDataset:FieldPos("POPIS")) ;
HEADER "Plomba na" WIDTH znakpixc[1]*15

SQLFieldBlock is function from SQL Express...

Or maybe better solution, how can I change charset in SQL Statement, my collation is Slovak_CI_AS :
statement is like this :

problem is with table LCI_PLM.POPIS, because I have in my app SET CHARST TO OEM everythere (DBF files FOXPRO) and table has ANSI coding :

cStatement := 'SELECT KU_ID,CLV,PCS,LIS_KNIHY.ZNA,CPS,ROL,OZN,LIS_KNIHY.CTL,LCI_PLM.POPIS '+;
'FROM LIS_PLOMBA,LIS_PLOMBA_HIS,LIS_KNIHY,LCI_ZNA,LCI_PLM WHERE '+;
'(LIS_PLOMBA.PLO_ID = LIS_PLOMBA_HIS.PLO_ID) AND (LIS_PLOMBA.LIS_ID = LIS_KNIHY.LIS_ID) AND '+;
'(LIS_PLOMBA.CLV='+qcislolv+') AND '+; // filtrovanie pre zadané CLV
'(LIS_PLOMBA.KU_ID='+qcisloku+') AND '+; // filtrovanie pre zadané cislo ku
'(LIS_KNIHY.ZNA=1 OR LIS_KNIHY.ZNA=2 OR LIS_KNIHY.ZNA=3 OR LIS_KNIHY.ZNA=4) AND '+; // V,Z,N,X
'(LIS_KNIHY.STL=1 OR LIS_KNIHY.STL=4 OR LIS_KNIHY.STL=5) AND '+; // povolený,v konaní,v konaní po lehote
'(LIS_PLOMBA.PLM=2 OR LIS_PLOMBA.PLM=3 OR LIS_PLOMBA.PLM=7 OR LIS_PLOMBA.PLM=4 OR LIS_PLOMBA.PLM=5 OR LIS_PLOMBA.PLM=6) AND '+;
'(LIS_PLOMBA.PLS=1 OR LIS_PLOMBA.PLS=2) AND '+; // plomba, dotknutá nehn.
'(LIS_KNIHY.LTY=1) AND '+; // právne listiny (tj. mimo objednávok atď.)
'(LCI_ZNA.ZNA = LIS_KNIHY.ZNA) AND '+; // toto typ listiny zviazanie z typom v KNIHY ? ale neviem presne či dobré
'(LCI_PLM.PLM = LIS_PLOMBA.PLM)' // zobrazenie typu plomby

If I change SET CHARSET TO ANSI, SQL table show correct, but I mean, exist better variant

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSECOL and DATA

#2 Post by rdonnay »

Put the following debugging in your code so I can see what kind of code block is return by SQLFieldBlock()

WTF SQLFieldBlock(qoDataset,qoDataset:FieldPos("POPIS"))

This will show you what is in the code block.
It can then be modified and you would replace the call to SQLFieldBlock() with the contents of the modified code block.
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: DCBROWSECOL and DATA

#3 Post by Victorio »

SQLFieldblock is :

FUNCTION SQLFieldBlock( oCursor, nField )
Return {|x|iif(Pcount()==0, oCursor:fieldGet(nField), oCursor:fieldPut(nField, x))}

Modify it is good idea, thanks. I will try.
Also wtf...

I am also searching some info about SQL CONVERT, etc. and set charset ... by SQL statement .

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: DCBROWSECOL and DATA

#4 Post by Victorio »

Hi Roger ,

this works fine :

FUNCTION SQLFieldBlock2( oCursor, nField )
Return {|x|iif(Pcount()==0, iif( !empty(oCursor:fieldGet(nField)) , convtooemCP(oCursor:fieldGet(nField))," ") , oCursor:fieldPut(nField, x))}

Thanks

Post Reply