cancel
Showing results for 
Search instead for 
Did you mean: 

insert hex data into a long varchar

Former Member
0 Kudos
1,742

Is there any special considerations I should be aware of when I try to insert hex data into a long varchar column?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

I found a solution: define the template column as varbinary(32767); my initial definition was varbinary which only allowed 1 character.

Should I prefix the string with "0x" to indicate that the remainder of the string is hex???

MarkCulp
Participant

You need to remove the quotes around the hex string and add 0x to the beginning.

Former Member
0 Kudos

Thanks Mark..that works!!!

Former Member
0 Kudos

I tried this SQL:

INSERT INTO s1_document_template (template_id,
                                  description,
                                  program_code,
                                  class_id,
                                  language_code,
                                  template,
                                  add_by,
                                  add_date,
                                  modified_by,
                                  modified_date,
                                  default_template_flag,
                                  template_code
                                 )
    VALUES ('Agtech Certificate of Origin (English)',
            'Default Certificate of Origin (English)',
            'ASM',
            'ASM_1',
            'EN',
           '504B03041400020008006B82EA4CA85EBC1B54010000B002000011000000646F6350726F70732F636F72652E786D6C8552DB6AC230187E9592FB363D300FA156D8C62EC61CC2848DDD85F457834D529268F5D976B147DA2BAC8D36E81476997CC7FF4F7EBEBEF3E95E54C10EB4E14A4E5012C52800C954C9E56A82B676198ED0B4C8594D98D230D7AA066D3998A09549434A36416B6B6B8271BDD555A4F40A970C430502A4353889128C3CD78216E6A6C021674CC1EDA1869BD41EF4ECBDE19ED8344DD4648E9AC671823F662F6F6C0D82865C1A4B25835EC56A2F328E61A27636D9824BA505B5C699D4946DE80A3AB301166069492DC5DD2AC2DAEF021579C908D340ADD2C52B676B5551133C2BBAE122C767587EDAC1F102CAA0ED4E8E93F6C87BF6F0B87842451A27A3301E84E9609164244D493AFEECBC2EF4EE61DA2C3B6B1F6CC9A1BC3F5CE75F537AD55C73D9B9F8ACBB453226E988645DD61F92EF2E4E46FF961F8649BC4863D2796667E57B03D743C38E777FAF18BA447F74A7CB3F57FC02504B03041400020008006B82EA4CB1BE4AF8D5000000FE000000100000006D656469612F696D616765312E706E67EB0CF073E7E592E2626060E0F5F470096260602902B20538D880649545C43A20C592EEE8EBC8C0B0B19FFB4F222B90CF59E01159CCC0C0B7078419A7EE29F2040A2EF074710CA9887B7B6323E71107810307DEFEF1BAFF9CD9BA88517D06A3E9C248A00A06A11E1920D9C0A1CC0EA4140E9D6004521D0620EB189420521DE54FE61497A5A9784E02A292C0FFE99F0D8A201CBD73272682595D294F3C40022AAE465029A5DA3E90668677694F40948B8425881274E303920E2D139981D4840DBF99A53EF9F75C2EFC0EE23278BAFAB9AC734A680200504B03041400020008006B82EA4C411FC6934D0D0000EAC6000011000000776F72642F646F63756D656E742E786D6CED5DEB76E238127E152DB3677F750013206976600E4920E10C0D5920DDD373FA8FB005785BB67C6441C2BCDAFED847DA575849BE700910033618709FD3C117B954A5AAFA5425CBD2FFFEF3DF5F7F7B333098206AEBC42CA79474360590A9124D3787E5D4980DAE6E53BF557E7D2D69441D1BC864809737EDD26B393562CC2A6532B63A4206B4D3C44226BF3720D4808C9FD261E69550CDA24445B6CDC9193893CB668B1903EA66CA2363D9EF0819BA4A894D062CAD12234306035D4592147F5CC92E11ED8EA0853C6A861A842B03D29F63EB8A13B720D3FB3AD6D95472E633A564B9E8D42CB944AE7C8EC4432587A392E0C37B62B2A9FCC4C0337195FC7EF23E50F8CA7F52C0504B8DA14928EC63544E09C25E25DA9B5F858626E8CDA2FC5149DB36A12588E61C1D547ED5DE4AAEEA813884B89CE2643242DF7DA24DC5AF25FF3C53F1C360DF767FC1AB531CA3014BF1138B70452AD95C3127CE30821AA2E594494C24E965660FEBA6C64B0C746AB3A66E72DEB3CE1303E61E527D38623346FEAD7A75A9DCFC10752F5387255A2726B3790968ABBA5E4E3DEAF6080A2AA3AA69CFCE1D913C428A7BC1FECBBB92F76AC3D01C7A179179F5D215B4FABAA6CF9D2268B3AAAD43FF9223A0E428E337168D3197BCFDB1763F8214F847BDA9C575D14743E19C6ED1F88BA19B36A33DF4C62ADD56AFF6470F3489CA9D9A98E9FA18E3163490283C2B752262ADD18E8D2C48214327A42056798274826C061AC2794DA91C88C13D67946310A2A00B31B2C1833ED1050E49A43815E1D6A80999DA9C86321E8626401A1B20556ECF02484314633D9056354D0410C2C414F0030DC03F30FBA7F8DF220F90C17F0CF919FF7F389C8D5E7987C2D91025611525A7803B4AA0F60AA7A0CBD2A09B8E1E4CA3D7C52298C65D08991E956C0BAA9C75117823DEF9A52AE01C34713E9076CF33BE04CAE22A09AB542D0B23F0B58A319A9E83E7241816174D9C0F86FDA95BCFC46610DF130D256016574958A5505072F973F09D04C5E2A289F341B17B3236199D261816674958E5C5D419D27856C919B7CFC1833E1EA20B3ABA96F3785D39BCB67A142B3274EB215C5A8970DB01C97A7FED118CEB14A1E71131516B6CF411DDD16FB7760F56B9CD66AF8A85FC9592BB5ED9A1EED06F45D7CF0050876FD12A83577068151494CF57B79FAFAF94FC7571671544EF6EA75C836F59EF00525F8F98B96887DD8FC28AB0AEFB5AA7D7A837EEABBD1A68D741BBD3786CB4160C2F644538AF6162A386C349975D962EFB5EBAEC36A6129C608430CCA110AD06E1FDE5775EDF65E60E42AF60A7F87FAF1ADFF5363CE6A34C34E37EF17914CDF06128BD9F722B3719E55A4C97B98DCA7E8ED15B9E310454BA046BA0474AAEBE2EC341BF727321D49FEF72796E5A7FF9F3A9FD021E5F1AA0D36E3D82C697E734A8B61E40ED0F7E70DF4E8366EF2171E10F5C785B1E6F7221465211E2C2B6016DE44EBF4B8DEF9CFE9E1806D174364D87E8F321B645709FDFA55256794977D3E017057C7B6A376BE07BADD96C7F03CFB56A17DC555BAD5A073CD5AA9D1E50B2D9E61DBFF418C4FD43147FD390C351BC606D80FC2950707C58560FE55F910C6D8B898D14AA2CFD15521D71077D40B64A754B8CD81CDC4F8F398E7D2C3BAFDC41D344F464CCFA72B122663DAAEBB777149ADA51BDF6E8BDEB13E2393F900D91749C97ED0C70286ABF6C777826786A516221CC93A0C421D63A4493400D6900B224A60C37A6BC23E4A76E0EDB5443342D5AF999502667B11E25FBBBC8A8B28B20633864F73FD5190E311BDB09249D3B60B5FFE8559031B69C7B69EC5DF13FE08A7C44EBD8ECADED201E3BED6E37B47771D18A10FDB87EB4FCAF8FE8BA08E317621CF035C1513415EE4B8788FDA5F2A577D26E1128483D3EF7AC528ABE993F84C1E86623445C5F10998F899B1BD0AFA7AB3F11EB8E0D03D269BA832C1E3FFF6B0C4DC643681955C7051163836BF35E73A3A4B39BBE603894EC07809939B143993AA0124CA87F51FE3B9F682C06C24584373190EC1D8671886AC23EC276BAD9E7C7E18FC8C5B935A243C31808C72ACFED97D643F74C9D713FD88E815C6B1074CF79A53110EC82D073530428F1740388821F7F07BF7CFA25C1D213108E559442F15351D92F5E8D8120670BA6614FC93D0AF6DF659A20DC6F0B4E12E98F87E70BAFC4EE9A07FE40E15401FA80305C0CFBE38918C0ED79BF457375A3392BCCF2438B0B27A63CF88BD706595DD77DDC5BEC77F5EAB592387745B19EB0FA564E150BD7F99BDB420AA8D372EAB392CFBBB25962D9E1670A744D3689090DDEC0CFBACAC61401A78D606948A135D255974BB80393EE6AB83E29011D604CF51D48590E739C1A3F2A593E5BFC686F6AE6848B2E34254ED4D66473C37885C42352DDEF48F4B16ED5758C85E4E218D01232FA8893EC20AC1B7088146F4D611A847967E9E20777A16847028AB0FC58D91EE996ED2A8CE33062EA481C0E78F51DA432C9E0DC9DCC227FE2CC96460A4B6F036A885F5E1B78938E31F5DC030A9BDA645099D9E31677D847C4E37E71504E51CE844BC324A252BFC99C7A33AE3A258D3933993F17AEE4F98C742BDF9562031F8102C0888065F7771C517EA7DFA9D56B9D5AEBBE065AED7464EF6662F09D58977B609D12A38306882253BDC02FC59E6ADF41B3DDFEFD3B78E23AFFDB8195BDDF54BE837AEEA6652DF8BF85863B1CAA6DAF8B0F1028368DBD94137FD0FC1B35B09DA0F19C86BC5AF86EABD9E87A237936F8E14C333DC27C63B70978FFAEDB62FB85174BE3A0E555E170A1BD95FA3C45157B4DC82FE8C5FE0A225863C8B0784484E46AE8BC565E25BFC31CF833A1D55BBAEF9194BA657DECFEB876D3C75D36C5C813A0E7E548FCC6377EF155AC245ECC7E16BC3A55686F7056A409A764CCFC7B70CCC84067B3FBF708E32FD0A989580EBDEC2A5AC26737DCEE13C678A0B5BE804483B5F733CBCC406D49AB99C53679A4BAE60AE15C529DBF6E01D56D9A5C516CF9B1A265D43B228615EC99E0B22E91C060249EB0FF2AA76EE58163A392697B0435E24930A0322297C7124CCAA9BAFCE7F33BAB2433E36D1E43F737E05DD12F9EA030FBDE9D87DA1835B44BFB10618B218ACCCCE8579B7EBEB8D21113D38FB5E92FBEB6EAFD64E14D5BBA442F2814F2D789179C9C177411C47BEE447109669F71C29F8C1F3646635B73816E8D677D1F04B3EBA3E08CDF5C5BB7EF613E9D0B9CA7FC10A3B120E58D838AF7849057F303EB361BC9FD7CCE21715192C4E5D0890BA7B5D86AF77EB36D95D3F86285DCABCDDA23D2EE523CAA7995F04C00D2B9A7842D48823AC6EF6904EF641746801CA2CB4E97DBA5AFDD9AEE3C50F89BA6ADC48FCD414F10E3099215B82E13BAE92446795246194E1CB897372CCCEC0B3F130AAF51B68F0CC3AB7B9BBC280044044A991288482062D15379C6667FDC6705C95826D0D4EDD1BB282AFC94C413FC02D2C6A30899A406496A706110BB2EB516B874E7DE587E1FE85D9797073AE25EC593008EA00DFE60D129BC845C8D956826AB97041AE62325634B6EBDE36FFBEE38B22C22264689020D53436F7E812BC52B81E1EA0239AF8057B9F07DFF7653B7D9931CFD785F9327A45F78A945E6CA0B32C18AFB6C6E2CBE20D587C45DD75C56E48710BAAAD7DAC19078BDB645A38C229772CC24B74C502DC92D2F3EB76495DFB75A4139495F13143A79149A4B5B37A6ABC92CA3755977F0D836132C38CE45131C678F1E1C8BFEA4435E2F30327E6767AB43E5B5D6B765487C62531D2E76AE1BCF435A629BC742F1E6F673769BD823995197CC250AEE60C98C3AE159B9EBC2ED2938593261EF249DEC2227EC71E97337B7F92BFEE7263EAE95E42C5BE62CEB538E8039CBF53639CB4D92B32439CB89A37D92B324394BCC60FEBC1C2CC9599C9CE5E6FA149C2CC9594ED2C92E356751C45A0757E26F2E3ECE95642D5B662DEB938E8059CBF2D73D1BB396DB246B49B29613C7FB246B49B29698C1FC79395892B524594BE26449D61207B377F389CCEBA19746081E66678ED544F15ADD78B9490FC76376671ED7E82D38C17016E0FE5603F7B54EAF51FFFE09F4DAA0F7540377B56E0FB4EBA0FDD201BFB7DADF9AB587C71AA8B61EF89D66A356FF244B3DB6DB0F5D50EDD444D19774375D4D8376A7F1D868A5177AAE53D045C263C263C2635C790CDE0F44BE18F52159395CA818C9D61B4DA2CA25DDD3F531C6C906F487EACF9F209D209B0139966A4A0D400CFCCFF54017626483077DA2DBFC56B83966B2C3C6E1F6A94FA44BA44BA44BA43B69E9D6445DF37B0B41531D110A6CDDB0307A26B6A4063126AFED09A2185AF2421F8DB82C0F44956758AEEED130C5C219CE05A2FE141BD6F04367A799097A428E684A2AA27D8B7C8E97B79FE1F72C62EBA2677EF2D9115B6E94532AC163C34C7965DA83818D582597BDC92A623878FEA277EAD059A0FA7589AA0855E4DE33CB84955C3E5FDC48F86B65690BA65C215FC8DE66576CC1F4CA6B681113B9A7B31D9972CB1B0FE5BC47D4D6E4D1D913A72E067B8505F8BBE4C82B3C86FC690393F038C01CA2AA6D21755E653B6FE2E4D8DE66062E76A3A835FABAE88DA2D6987D808DA276DA1CCA013D898B4B9B43C522466795BBEFA5D5837C4E15EE8FCD1BC17D424CAE70EB3479A33E736370D9B1865F64B8EFF43A9F3FDFCCF53BB705D90B31C2B15951AEE5BB26E7FBF8D9B9B3566E39759395EF930684B0B9D3E198C953BFBFF178CA084ADAD46963D7C42AFF07504B03041400020008006B82EA4CCF4DF7E576040000822800000F000000776F72642F7374796C65732E786D6CED59CD72DB36107E150EEF0E494571144D948CAB56B5675CD713BBBD432424A206010E005A765EAD873E525F21000930FC15258B969D0CC5838025B0DCDDEFDB5D88FAFFDFFF3E7E7E88B0750F194794CC6CEF8D6B5B90F83440643DB313B13A99D89F3F7DDC4CB978C4905B7235E1D3CDCC0E8588A78EC3FD104680BFA13124F2DE8AB2080839656B6743591033EA43CEA5B2083B23D73D75228088AD1406D4FF15AE408205575376CDF454CFD2AF0525825B9B29E03E4233FB06AE29B4FEBAB0A5283C23BC2472D48EA5BC730FF0CC76B50055053E887955C6054377B02A25F49A51BAAA8AEF01413CACA9A59832230489A046F55723F4265A941809A1049A656160A43E8680290F539546D966BA42B8AC5AA226CE305A13B3730938C428D7890159AB91A3E3E954A31C5767EAEB0EC2F80A3E88AA834A7E2995D782B74101DDCC25508CE2DC57E35612C74C12406DBC4AA2A5E4592DF60D9ED75C357ACEA4E8FC310E21A9EB89812F7926C52A045F120CBF874E4966F668ECAAC9124A96C274A324D64A40A6C7D90DF508ADABB8A62ACEC84582D45AC6C565FA88743D862BA1870CAD435124091132B409C037B9B52527FEF18D4429B1357AB146AF889753CBA03443E576F1184B4B62C0C09A81385466A4B72E82997D9D5A1564BB144C29CF419473FF4A2530D6D668466C312A659416A40FA91BE287D2125F46B064C8BCCB10ED99756DFCB0542D3058C3089DA32080249B3FD588FA63158C56C65453516452057FE63936777BB66154B341121C3249D93B3BD75CAB30AEFC2C16D582A20A2D867625E95BEC1160A9D6166CB9DD8D1DD66DB6B3C8911DB2B8C49946875CB764BA347489F3C11C62FC07C8663496DB363AC7326F820760CA9E246976DB73274D0B9654081A6DD19066ED16154ED920A768A8A6811CF95D846800A01EF234D6D60D8A62F9E53573F2D63D3618BFC8DE2E6BF977304AF4535D6F668FD381AC73A62EF210C84EA1272B269DD463DDE80A4FCD51EC5D6F0E7EEF9A0D6B7A578CE4412780E7CFA7FAEFFE553B359A9432B833475F2E05EBF5F8127171ACCC1BBBEA6ACA3CED52C9B9ECBB5A15C76FBBAA5ED30AA7A0EABE74ACF42111BA1D3AE6B97B85F46D6348472D211D6D697BEDE1D1838BF444D65CD80F2289A25AD9ABCE234CB15B5AD9FE2354E927BBD3D67BD4D2AE06343F4E07CA293FF49FA1FF74F69F124BFC3E3B8F9F379D5D8A6143AEB5349993730882B65F1EFD27D922FDEC9264DB583BD917A6C263B7B2F610C555FC777EBFF27EA12EDBF4866A6FF5461FBA9A6BE3925E58D3DC47BD9305A56260CDC09A66D68C5B58F33BA3499C159CE76CEB4BB3C33C6487035D479F0F1057BE060672B7C78E1CD06479400BFAED9DBAB6B7A09C1623D77B26CCDF6DC33C2B172F87F9D9A9BAF6C5BC375CAA88138477C4EBD01F5607007ADA9DC46DBFA78624FE4193F87D7712BF1CE64312EF0FE8A4F93DC8AB3DF51F2B5B7BD5FDDA8E86E544792A753EB450E7B847FF1EDECA787B835008E06E597F40983DB725CEC361F9E7EDB35ED3DFC039E8C369F9C76BB45EF3FBB5D1705CFE99D3B8E56FA6E1BCFCDAD2D88CF8A76F504B03041400020008006B82EA4C0804E60B730000007F00000012000000776F72642F6E756D626572696E672E786D6C0D8B410EC2201000BF42B85BD08331A4B46F41BA6D49BABB84A5E2DF3CF824BF20C799C9FC3EDF717EE3A15E502431797D1DAC56409197449BD7675D2F0F3D4F637374E2134AB7AA0F24AE79BDD79A9D311277C0200367A0DE562E186AC7B299C665C9852388F4130F73B3F66E3024D2CA4C7F504B03041400020008006B82EA4CB553E485280100002102000011000000776F72642F73657474696E67732E786D6C65914D6EC2301085AF12795F0C01D22A22A076C5A6EA825E60B0273FC2B12DDB49CAD9BAE8917A854E52AC547437EF7B6FAC19CFF7E7D7EEF0D1AAA447E71BA30BB65A2C59825A18D9E8AA605D281F9ED861BF1B728F2110F309E5B5CF8782D521D89C732F6A6CC12F8C454D5E695C0B81A4ABF8609CB4CE08F49E5A5BC5D3E532E32D349A8D4FCAC65B05D7171097CA994ECB530D169321EF41158C06E1530A4BE8547887F329181BDDC734FAD00573BCDA1A3504DAE1BE1D7BD4CF5ABE49794490B4E77D4098D642B8D5CA9DC675F015ACA591297BAE5605534D558715231948497097499CABF4E6A59397FE7A930021508FE95B31B334B23FB97564EB996D22DBCC6C1BD976665964D9C8EAAB45A71A7DA103C572E4A551CA0C288FB3FF0F4D3FC2E75BEF7F00504B03041400020008006B82EA4C0B868735B9050000E71B000015000000776F72642F7468656D652F7468656D65312E786D6CED594F6FDB3614FF2A84EEAD2CDB4A9DA06E113B76BBB56983C4EBD0232DD3121B4A14483AA96F437B1C30605837EC3260B71D866D055A608775D887C9D661EB807C853DD1B245D9549AB429B661F1C116A9DFEFFDE57B22E5E39F7EB97AFD61CCD0011192F2A4ED78976B0E2249C0473409DBCE448D2FB59CEBD7AEE20D1591982000277203B79D48A974C3756500D3585EE62949E0DE988B182B188AD01D097C084262E6D66BB53537C63471508263D276EE8EC734206890897416C27B0CBE1225B3898089BD406B34191A3BDAF7B21F39955D26D001666D07F48CF8E1803C540E62582AB8D1766AFAE320F7DA5577C162AA826C10FBFA3327E68CD17E5D1345385C30BD7E73FDCA56A1A13ED3B00AECF57ADD9E5748D4081C04E0ADB7026EF65B5E6721D540CD2E57A5776B7EADB9443034345608EB9D4EC75F2F131A05A1B94268D5D69A9BF532A15910FC551F3A9BDDEE5A99E01784B51542FFCAFA5A7389A05111A3C9FE0A3CCB6C91A20566CCD94D2BBE05F8D6622D1430D75869330189AA5A77317EC0451F003ACB58D104A9694AC638005C17C74341B1D6803708366EE573815C9DCBD42119089AAAB6F37E8AA1400ACCF18BEF8E5F3C43C72F9E1E3D7A7EF4E8C7A3C78F8F1EFD6063DEC44968325F7DF3E95F5F7D84FE7CF6F5AB279F5710A449F8EDFB8F7FFDF9B30AA432912FBF78FAFBF3A72FBFFCE48F6F9FD8F09B020F4DFC80C644A23BE410EDF238F3CFA2820CC519298308D312054700B5217B2A2A21EF4C31B3023BA41CC37B02DA82157963F2A064EF5E24268ADA90B7A2B884DCE69C75B8B0FB744BAB337C9A2461857E313181BB181F58D57797B2DC9BA4B0B2A95568372225537718241E8724210A65F7F83E2136DE7D4A4BF1DDA681E0928F15BA4F5107537B600674A8ECAC9B3486044DAD3642D64B11DABE873A9C59156C918332142A0433AB50C24AD1BC81270AC776AB71CC4CE86DAC22ABA17B531194022F15243D248CA3DE88486925DD15D392C9B730B428FB0AD866D3B80C158AEE5BA1B731E726748BEF77231CA776BB691299E0F7E43EAC588C76B8B2DBC1CB35938D212138A9CEFC3D4AD4198BFD031A46F6C592DD99086B8D105EAED1291B6392CC1F00A5561ED3E4A4BECE2834F68BBEBED4D737E16167ADA7E56E5E09FC8FF6F02D3C4976485627172DFCA2855FB4F0132AFC5D34EEA257BBE66E5DCB892BB7EE63CAD89E9A32725BEA2E2FC1C5511F26F5409316478534824B67A6AE840B05D6D74870F52155D15E845350E3690DA1CC458712A55CC209C5A994AD0FBC149CD673BE3EA5EA4848ACB6F96836DDA8CDE75D438C1E85D254D4C8049C5659E3CADB29F366C0536AF37CBB36FF446DAE114DA81F84B31711DE5A3D3FCECB003332CAE23E13304FCBB9A748467844F21C795647BCC629C3D67A7DD40C6DEB8DB7D3769A2499EA9A15EAFC73C8526D254BEE6A39B2A43C428760955FF71D14E0B4ED8C61530697710AF264D6AE300B93B613A8DC95D716F3B2C3F665E9D52A1D2EA94885545B58463396BE95935852D85FF79B591CCEC7014B373A9D158D96F70F5AE12EA7968CC724501533C530BFC7278A88BD687488866C227631D8DD9CADAE1195F0ACA8CF07022AB4992FBC72E5E755B0FCEA28AF0ECCD208E73DA965E47E06D7D70B1BF4C830CFADB0FD0D5D699CA32BFEFFD7956CE5C286B731D22733D806088CB235DA76B85011872E944634E80BD838685D601782B2C84C422C7BFF9DD94A0E8ABE3593316B7261A476698804854EA72241C88ECAFD7C8D30AF6E3E5FE782F23EB33057A6B3DF2139206C9055EF5AE6BF83A27937C903A171CB49736DD5350CFBFFE29D4FB362E773F2F6A050D43CCB5EA469347DE351B0FE76269CF1515BB77B5CF74FFDA84DE1C082B22F68DC5404ACD8DF0EF82E641F2D76940816E2A5565E7E8BC921D8DC329CCB44BDDB6D5491825645BECF73F36904BB5111EC93D5BD79B07D4BACFD9343EDAE96A86B1C64F468E5AF313E7C00BAB7E08034614AE62FA61EC2F1B43BFF270304E5E7254DBEF637504B03041400020008006B82EA4CAABBD5F9D6000000BE0100000B0000005F72656C732F2E72656C739D914D4E03310C46AF1279DFF1B48B08A1A655059BEE50C505A2C43313D1FC28710B9C8D0547E20A1884508B8A8458DAFEFCFCA2BCBDBC2ED74F71AF8E545BC8C9C0BCEB415172D987341A38F030BB82F56AB9A3BD6549B42994A6642535031373B9466C6EA2685B970B25990CB946CB52D6118B750F76245CF4BDC67ACA8073A6DA7A033BADE75A2F3637A0EE9F0BFDE5401E86E0E836BB43A4C417EEFC4808D9D691D8003EE6EAD17FF53BE182C20B522E57FA87D8EF2FC7486CBD658B1FE859A9B25D39503B7113AD3BE9B7CFC8B71B9EFDC2EA1D504B03041400020008006B82EA4C61E1243C3C01000046040000130000005B436F6E74656E745F54797065735D2E786D6CB5544B4EC33010BD8AE52D4ADCB240083565016CA10B2E609C496A117FE49994F66C2C3812576092942CAAB614513691E279DFD8CEE7FBC7EC76ED1AB1828436F8424EF38914E04D28ADAF0BD952955DCBDBF9EC79130105433D167249146F9442B304A7310F113C4FAA909C267E4DB58ADABCEA1AD4E56472A54CF0049E32EA34E47C760F956E1B120F6B5E1E6C133428C5DD00ECBC0AA9636CACD1C473B5F2E58E4BB675C899D9637069235E30400AB5D7A21F1D7438428CBEDE215AD775EBD799F2C41F2FD912C442277AD48E01EA2DA45295C1B48E49F971EB3DE54255590323BF538B291840E45D714D3E4E9CB67E2C7D30886FDD0B24A69E3FC928FD730AA44D0378FE0883EE09FE40C48CFF48B0553E9A81E98B1422F27548F0FB0CDFE7BD6367EC1E21913DA536F12585E139FD73F55E66F454FD5F61FE05504B03041400020008006B82EA4CAD8064BA670100009B0500001C000000776F72642F5F72656C732F646F63756D656E742E786D6C2E72656C73AD944B6E83301086AF82BC2F0E595455159245A24A5DD0484D2EE0C20056F143F6102567EBA247EA156A93174953142196F38F99EF1F7B869FAFEFC96C2BAA6003C672256312852312804C55C66511931AF38727329B4EDEA162E84ED8926B1BB84FA48D4989A89F29B5690982D95069902E932B2318BAD01454B3F4931540C7A3D12335ED1AE4B266F09AC5C4095CB8E31109D63B0DF700549EF314162AAD0548BCC1A14D455790990230265440C6D95E8D422D0B12D0DB565EE6D73E32D8C0561BB0364C95A05632ED88D1F88A9873A8B25449842DDA33B991E70739747DFC4B5EAC7A923386CC02A27BBB16D8ABAB83DACDEDDBB127F8861997602EC1F3A3DC495E97A21F19DD64B45EB709BB9B4C92653F94D705E39500C752BA499CC93E9BB86CE2B3CB7DB6D3C70A77D5B0936E7DC5B6A526EE34F1568B412DC85A7C80E17EAB8E2E4E52F76D1CE673D80BF9B30AF69E3558FB211AD4C8AD29DD8BD1C909BDF8C54E7F01504B03041400020008006B82EA4C02A7D890690000006C00000015000000776F72642F6461746153657474696E67732E786D6C0DCBC10D83300C00C05522FF8B8157151118A21344D8D0488D13611765B73E3A525728EFD3FD3EDF6969F9E54E3E34150930743D3896B550923DC0DBB6DB1D9679A2E6295A7CB0D905EAAE24EAA905789A558F487C72AB07AB766BC9A8122B8EFD30628E49C0E1FC07504B03041400020008006B82EA4CB03F6355140100007203000016000000776F72642F6669656C64436F6E74657874732E786D6CB593416EC2301045AF62795F9C38D0A288C002249A7D2FE0C643B19AD8963D49C3D9BAE8917A859A50549486882EBAB3BFF5DFD38CE4CFF78FC5AAAD4AD280F3CAE88CC6938812D085914ABF64B4C6DDDD9CAE960BD9A63B05A55C1B8DD0A227A1A57D2ADB8CEE116DCA9884065AEBC0FB49612AE6B5B08C47316795509AFE229070573208E9F184070B1975C66077F5A676450836A6A82BD04836020525EC2A855F504AE54F142B5CE8E627C9F56ED2EBE608551735CAABE712722D218C197599336F8F42CB12CE813ABEE67AEB4C6DCFD3FC88F998787A21B6CE587078F8EEE33EA34FAA7805F43D6232469C8DAF613AD6BDFFC735CCC6C40FB789E3BE381E10F3BF88E7B789795FCC07C4C9A098F5BFCDF20B504B03041400020008006B82EA4C88096F80B6000000070100001D000000776F72642F736E61704D61696C4D657267654F7074696F6E732E786D6C758F3D0EC2300C46AF126587B49D50D5C0D2850190E809A2C42D91F253396E95BB317024AE4040828DD1EF7B9F653FEF8FEE90BD632B60B231485E6F2BCE20E8686C98245F68DCECF861DF99DCA6A0E693B2EE0438C165A6E22756CA21B5264B7E239A5B210CAC90678494B63A7AF12E89A6AA1BE1950DFCB3C82852435C50C359796085ACCA49DE47BD7808C4FA9273263EAE5E100BBB828E688EC140FEF9D5D719AD23C081B09CFC4BBF618A486F5E26F1E789FD0B504B03041400020008006B82EA4C1D8C999D7F000000920000000F000000776F72642F7468656D65732E786D6C3D8CBB0D8330140057B15E1F1E5045C836455660010BBF044BFE89672CEF96222365859014294FBABBF7F325E716BCA8B4B34B51C1D0F52028AEC9BAF8507094FBE50AB396B64D65A3402C4E3DF2649B82AD943C215AAAD4F24ECCDD9A02723419C77E18311817E1979AB5B84ACB77204EACC62BB8193E8C07815AE2FFAE3F504B03041400020008006B82EA4C219AFB35730000007F0000001A000000776F72642F5F72656C732F7468656D65732E786D6C2E72656C737BBF7BBF8D7D456E8E42596A5171667E9EAD92A19E8192426A5E727E4A665EBAAD5269499AAE8592BD9D4D506A4E6209504571466641B102504B5EB1AD524649498195BE7E7172466A6E62B15E7E416A1E50262DBF2837B104C82D4AD72F484CCE4E4C4FD537323030D32F4236434941DF0E00504B010214001400020008006B82EA4CA85EBC1B54010000B0020000110000000000000000000000000000000000646F6350726F70732F636F72652E786D6C504B010214001400020008006B82EA4CB1BE4AF8D5000000FE0000001000000000000000000000000000830100006D656469612F696D616765312E706E67504B010214001400020008006B82EA4C411FC6934D0D0000EAC60000110000000000000000000000000086020000776F72642F646F63756D656E742E786D6C504B010214001400020008006B82EA4CCF4DF7E576040000822800000F0000000000000000000000000002100000776F72642F7374796C65732E786D6C504B010214001400020008006B82EA4C0804E60B730000007F0000001200000000000000000000000000A5140000776F72642F6E756D626572696E672E786D6C504B010214001400020008006B82EA4CB553E4852801000021020000110000000000000000000000000048150000776F72642F73657474696E67732E786D6C504B010214001400020008006B82EA4C0B868735B9050000E71B000015000000000000000000000000009F160000776F72642F7468656D652F7468656D65312E786D6C504B010214001400020008006B82EA4CAABBD5F9D6000000BE0100000B000000000000000000000000008B1C00005F72656C732F2E72656C73504B010214001400020008006B82EA4C61E1243C3C0100004604000013000000000000000000000000008A1D00005B436F6E74656E745F54797065735D2E786D6C504B010214001400020008006B82EA4CAD8064BA670100009B0500001C00000000000000000000000000F71E0000776F72642F5F72656C732F646F63756D656E742E786D6C2E72656C73504B010214001400020008006B82EA4C02A7D890690000006C000000150000000000000000000000000098200000776F72642F6461746153657474696E67732E786D6C504B010214001400020008006B82EA4CB03F63551401000072030000160000000000000000000000000034210000776F72642F6669656C64436F6E74657874732E786D6C504B010214001400020008006B82EA4C88096F80B6000000070100001D000000000000000000000000007C220000776F72642F736E61704D61696C4D657267654F7074696F6E732E786D6C504B010214001400020008006B82EA4C1D8C999D7F000000920000000F000000000000000000000000006D230000776F72642F7468656D65732E786D6C504B010214001400020008006B82EA4C219AFB35730000007F0000001A0000000000000000000000000019240000776F72642F5F72656C732F7468656D65732E786D6C2E72656C73504B0506000000000F000F00D6030000C42400000000',
            'ANY USER',
            Now(),
            'ANY USER',
            Now(),
            'Y',
            'Agtech Certificate of Origin (English)'
           )

but got this error:

Could not execute statement.
Right truncation of string data
SQLCODE=-638, ODBC 3 State="22001"
Line 1, column 1

the table definition is:

CREATE TABLE s1_document_template
(
   template_id                     varchar(40)                 not null,
   description                     nvarchar(250)               not null,
   program_code                    varchar(10)                 not null,
   class_id                        varchar(40)                 null,
   language_code                   varchar(10)                 not null,
   template                        varbinary                   not null,
   add_by                          varchar(40)                 not null
       DEFAULT current user,
   add_date                        timestamp                   not null
       DEFAULT current timestamp,
   modified_by                     varchar(40)                 null,
   modified_date                   timestamp                   null,
   default_template_flag           char(1)                     not null
       DEFAULT 'N'
       CONSTRAINT ckc_dt_default_template_flag CHECK (default_template_flag IN ('Y','N')),
   template_code                   varchar(40)                 not null,
   CONSTRAINT pk_document_template PRIMARY KEY (template_id)
)
;

Former Member
0 Kudos

apologies... the "template" column is defined as varbinary, not long varchar.