How can I recover values from a SELECT using the field name and not its position in th array?
oCn :=maria_Connect( cHost,cUser,cDb,cPwd )
IF oCn=NIL
msgwait("Error conectando con eventos en la nube","")
return nil
ENDIF
cQwery:="SELECT * FROM proforma"
oRs := oCn:RowSet( cQwery)
MSGINFO(oRs:FieldGet(5)) //WORKS SHOWS CONTENT OF 1ST FIELD DESCRIP
MSGINFO(oRs:FieldName("DESCRIP")) //DOSE NOT WORK
oCn:Close()
RETURN NIL
****************************************************************************************
/*
CREATE TABLE `proforma` (
`UPDATED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`ID` int(6) NOT NULL AUTO_INCREMENT,
`NO_PEDIDO` int(13) DEFAULT NULL,
`UNIDADES` int(4) DEFAULT NULL,
`DESCRIP` varchar(50) DEFAULT NULL,
`VAL_UNI` float(9,2) DEFAULT NULL,
`VAL_TOT` float(9,2) DEFAULT NULL,
`DIVISA` varchar(3) DEFAULT NULL,
`FECHA` date DEFAULT NULL,
`CATEGORIA` int(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=62706502 DEFAULT CHARSET=latin1;
*/
Mysql recover values usaing field names
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Mysql recover values usaing field names
Code: Select all | Expand
? oRs:FieldGet( 5 ) // works
? oRs:DESCRIP // works. Case not sensitive
? oRs:Fields( "DESCRIP" ):Value // works. Ado syntax compatible
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Mysql recover values usaing field names
I found oRs:DESCRIP Works
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Mysql recover values usaing field names
for modifying and editing you can use:
Code: Select all | Expand
oRs:descript := cNewValue
oRs:fetcha := date()
// .....
oRs:Save()
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India