[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::sql

Title:SQL notes
Moderator:NOVA::SMITHI
Created:Wed Aug 27 1986
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3895
Total number of notes:17726

2646.0. "VARCHARs and C char fields - SQL$MOD/SQL$PRE" by BSS::63738::MOLLER (Fix it before it breaks) Mon Nov 30 1992 19:37

T.RTitleUserPersonal
Name
DateLines
2646.1BEAGLE::GODFRINDTue Dec 01 1992 06:2619
2646.2We'll fix the docsELUDE::GREMBOWICZTue Dec 01 1992 11:433
2646.3VARCHAR and C char for SQLMODSELKRK::MARSANRick Marsan (Doctor Flash)Tue Dec 01 1992 18:1216
2646.4NOVA::SMITHIThe vegemite kid learns VLDB... :-)Wed Dec 02 1992 11:399
2646.5Answer 1 took me a while to understandNOVA::MATSUMOTOTwice half-backed isn't doneWed Dec 02 1992 11:4918
2646.6The GUS and the SQLRMELUDE::GREMBOWICZWed Dec 02 1992 12:298
2646.7SELKRK::MARSANRick Marsan (Doctor Flash)Wed Dec 02 1992 13:5721
2646.8SELKRK::MARSANRick Marsan (Doctor Flash)Wed Dec 02 1992 14:008
2646.9Is this enough English?NOVA::MATSUMOTOTwice half-backed isn't doneWed Dec 02 1992 14:4178
2646.10Prompting for the doc. folksSELKRK::MARSANRick Marsan (Doctor Flash)Wed Dec 02 1992 18:599
2646.11personal preference followsALICAT::BUDILOVRdb/VMS acrobatWed Dec 02 1992 20:2924
2646.12BEAGLE::GODFRINDThu Dec 03 1992 06:1325
2646.13ELUDE::GREMBOWICZThu Dec 03 1992 12:5411
2646.14Correcting myselfNOVA::MATSUMOTOTwice half-backed isn't doneThu Dec 03 1992 13:5726
2646.15You and JensNOVA::MATSUMOTOTwice half-backed isn't doneThu Dec 03 1992 14:0017
2646.16Not meBSS::STPALY::MOLLERFix it before it breaksThu Dec 03 1992 14:459
2646.17C++ will make things easier?BROKE::HIGGSSQL is a camel in disguiseThu Dec 03 1992 17:0011
2646.18Paranoia?BROKE::HIGGSSQL is a camel in disguiseThu Dec 03 1992 17:0317
2646.19Who me?NOVA::MATSUMOTOTwice half-backed isn't doneThu Dec 03 1992 17:177
2646.20BEAGLE::GODFRINDMon Dec 07 1992 06:5429
2646.21New languages, standards, and resourcesBROKE::HIGGSSQL is a camel in disguiseMon Dec 14 1992 13:3434
2646.22pass char* from C to VARCHAR in SQLMODORAREP::CIM2NI::THORPEMon Apr 07 1997 17:1310
What is the trick to pass a char* from C into a SQL module procedure
argument that is VARCHAR(x)?  A TRACE statement in the procedure shows
that the first 2 bytes are being clipped.  The procedure argument
datatypes are specified using domains.

I'm using RDB 6.1 and specifying the SQL92 dialect on OpenVMS Alpha
V6.1.

Thanks,
Bill
2646.23NOVA::SMITHIDon't understate or underestimate Rdb!Mon Apr 07 1997 17:548
The *trick* is to pass the data correctly.

A VARCHAR is a length-prefixed string.  The length is an UNSIGNED WORD, which
is why the first two characters appear clipped.

Use the $SQL_VARCHAR macro to construct a varchar in C and pass that.

Ian