ORA-01704: too long string literal

Asked

Viewed 3,935 times

1

I have a CLOB type field in the BD, but when I give an INSERT it returns me an error saying that exceeded the field size that is 4000 characters.

Relatório de erros -
Erro de SQL: ORA-01704: literal de string extenso demais
01704. 00000 -  "string literal too long"
*Cause:    The string literal is longer than 4000 characters.
*Action:   Use a string literal of at most 4000 characters.
       Longer values may only be entered using bind variables.
INSERT INTO TESTE (ID, INSTANCE_ID,NAME,DESCRIPTION,CONFIG_TXT,EXTRA_TXT,CREATED,MODIFIED)
VALUES (USERS_SEQ.NEXTVAL, 1, 'Teste', 'Usuário de teste conexão ao Windows', '{"Entity":{"Version":2,"Name":"teste"},"General":{"IdCodeProfile":"teste","Description":"Descricao de teste","Email":"[email protected]","MaxSessions":1,"Backup":1,"Locked":0,"AuthPswdNeverExpire":1,"ConnectionBeforeCommand":"/Users/teste/tmp/teste/program/teste.sh conexao_antes 0","ConnectionBeforeCommandWait":1,"ConnectionStartCommand":"/Users/teste/tmp/teste/program/teste.sh conexao_inicio 0","ConnectionStartCommandWait":1,"ConnectionEndCommand":"/Users/teste/tmp/teste/program/teste.sh conexao_fim 0","ConnectionEndCommandWait":1,"ConnectionFilter":"","FileFilterTx":"","FileFilterRx":"","FileLenFilterTx":0,"FileMinLenFilterTx":0,"FileLenFilterRx":0,"FileMinLenFilterRx":0,"FileTypeDefault":"Outros","FileUserdataWithFileIdTx":0,"CreateControlCompletedFileRx":1,"StartDateHour":0,"StartDateMinute":0,"StartDateSecond":0,"EndDateHour":23,"EndDateMinute":59,"EndDateSecond":59,"WeekDayInterval":127,"TransferProtocol":1,"TxOptimized":1,"EnabledEERP":1,"Password":"73eedb38e8e4578008ac69ed6965a13eacf23ad4baf8aebc5e1f3a8f843ca44343dff66b0f66b12368d0b55fba0e4cf1d21f775704e7a1a5d210b9d5f3893bb4"},"Token":{"DLLName":"","CheckTokenId":0,"SendTokenId":0},"Net1":{"Enable":1,"TCPIPv6":0,"Debug":0,"Type":"TCP","DLLName":"libstcpnetopenssl.dylib","Mode":"ACTIVE","FTPDownloadRemoteDir":"","FTPDownloadRemoteFileMask":"","FTPDownloadRemoteFileRemove":0,"FTPDownloadRemoteTmpDir":"","FTPDownloadRemoteTmpExt":"","FTPMaxBufSize":8192,"FTPPassive":0,"FTPProxyEnabled":0,"FTPProxyRemoteAddress":"","FTPProxyRemotePort":0,"FTPProxyType":0,"FTPProxyUserName":"","FTPProxyUserPswd":"","FTPRemoteAddress":"","FTPRemotePort":21,"FTPSecurity":0,"FTPSSLCAField":"","FTPSSLCAValue":"","FTPSSLCertFile":"","FTPSSLClientPrivKeyFile":"","FTPSSLClientPrivKeyPswd":"","FTPUploadRemoteDir":"","FTPUploadRemoteTmpDir":"","FTPUploadRemoteTmpExt":"","SFTPDownloadRemoteDir":"","SFTPDownloadRemoteFileMask":"","SFTPDownloadRemoteFileRemove":0,"SFTPDownloadRemoteTmpDir":"","SFTPDownloadRemoteTmpExt":"","SFTPMaxBufSize":8192,"SFTPProxyEnabled":0,"SFTPProxyRemoteAddress":"","SFTPProxyRemotePort":0,"SFTPProxyType":1,"SFTPProxyUserName":"","SFTPProxyUserPswd":"","SFTPRemoteAddress":"","SFTPRemotePort":22,"SFTPSecurity":0,"SFTPSSLClientPrivKeyFile":"","SFTPSSLClientPrivKeyPswd":"","SFTPSSLServerFingerPrint":"","SFTPUploadRemoteDir":"","SFTPUploadRemoteTmpDir":"","SFTPUploadRemoteTmpExt":"","TCPAuthentication":0,"TCPCompress":1,"TCPCryptLevel":-1,"TCPLocalAddress":"0.0.0.0","TCPLocalPort":0,"TCPMaxRecvBuf":8192,"TCPMaxSendBuf":8192,"TCPMaxListen":0,"TCPProxyAuth":0,"TCPProxyEnabled":0,"TCPProxyRemoteAddress":"","TCPProxyRemotePort":0,"TCPProxyType":0,"TCPProxyUserName":"","TCPProxyUserPswd":"","TCPRemoteAddress":"localhost1","TCPRemotePort":33050,"TCPRfc2204":16,"TCPSecurity":4,"TCPSSLCAFile":"/Users/teste/tmp/teste/certs/stcp_teste_ca.cer","TCPSSLCAPath":"","TCPSSLCertFile":"","TCPSSLCipher":"","TCPSSLDHFile":"/Users/teste/tmp/teste/keys/stcp_dhparams.pem","TCPSSLDebugDir":"","TCPSSLDebugLevel":0,"TCPSSLPrivKeyFile":"","TCPSSLPrivKeyPswd":"","TCPSSLVerifyCert":0,"TCPMaxRecvTO":120,"TCPMaxSendTO":120},"Net2":{"Enable":0,"TCPIPv6":0,"Debug":0,"Type":"TCP","DLLName":"libstcpnetopenssl.dylib","Mode":"ACTIVE","FTPDownloadRemoteDir":"","FTPDownloadRemoteFileMask":"","FTPDownloadRemoteFileRemove":0,"FTPDownloadRemoteTmpDir":"","FTPDownloadRemoteTmpExt":"","FTPMaxBufSize":8192,"FTPPassive":0,"FTPProxyEnabled":0,"FTPProxyRemoteAddress":"","FTPProxyRemotePort":0,"FTPProxyType":0,"FTPProxyUserName":"","FTPProxyUserPswd":"","FTPRemoteAddress":"","FTPRemotePort":21,"FTPSecurity":0,"FTPSSLCAField":"","FTPSSLCAValue":"","FTPSSLCertFile":"","FTPSSLClientPrivKeyFile":"","FTPSSLClientPrivKeyPswd":"","FTPUploadRemoteDir":"","FTPUploadRemoteTmpDir":"","FTPUploadRemoteTmpExt":"","SFTPDownloadRemoteDir":"","SFTPDownloadRemoteFileMask":"","SFTPDownloadRemoteFileRemove":0,"SFTPDownloadRemoteTmpDir":"","SFTPDownloadRemoteTmpExt":"","SFTPMaxBufSize":8192,"SFTPProxyEnabled":0,"SFTPProxyRemoteAddress":"","SFTPProxyRemotePort":0,"SFTPProxyType":1,"SFTPProxyUserName":"","SFTPProxyUserPswd":"","SFTPRemoteAddress":"","SFTPRemotePort":22,"SFTPSecurity":0,"SFTPSSLClientPrivKeyFile":"","SFTPSSLClientPrivKeyPswd":"","SFTPSSLServerFingerPrint":"","SFTPUploadRemoteDir":"","SFTPUploadRemoteTmpDir":"","SFTPUploadRemoteTmpExt":"","TCPAuthentication":0,"TCPCompress":1,"TCPCryptLevel":-1,"TCPLocalAddress":"0.0.0.0","TCPLocalPort":0,"TCPMaxRecvBuf":8192,"TCPMaxSendBuf":8192,"TCPMaxListen":0,"TCPProxyAuth":0,"TCPProxyEnabled":0,"TCPProxyRemoteAddress":"","TCPProxyRemotePort":0,"TCPProxyType":0,"TCPProxyUserName":"","TCPProxyUserPswd":"","TCPRemoteAddress":"","TCPRemotePort":3305,"TCPRfc2204":16,"TCPSecurity":4,"TCPSSLCAFile":"/Users/teste/tmp/teste/certs/teste_ca.cer","TCPSSLCAPath":"","TCPSSLCertFile":"","TCPSSLCipher":"","TCPSSLDHFile":"/Users/teste/tmp/teste/keys/stcp_dhparams.pem","TCPSSLDebugDir":"","TCPSSLDebugLevel":0,"TCPSSLPrivKeyFile":"","TesteSSLPrivKeyPswd":"","TCPSSLVerifyCert":0,"TCPMaxRecvTO":120,"TCPMaxSendTO":120},"OFTP":{"Idcode":"teste","UserData":"","DLLName":"libstcptransferoftp.dylib","OdetteLevel":1,"InitMode":"R","Mode":"Both","Compression":1,"SpecialLogic":0,"Credits":99,"Restart":1,"MaxBufSize":8192,"Timeout":120,"T1":45,"T2":7,"NumMaxRetry":5,"Debug":4,"MaxLenDsn":128,"Level":"1","Password":"teste"},"SFTP":{"Idcode":"","UserData":"","DLLName":"","InitMode":"R","Mode":"Both","MaxBufSize":8192,"Timeout":120,"Debug":0,"MaxLenDsn":128,"SFTPSysdateFormat":"%Y%m%d","Password":""},"Relations":{"Groups":[]}}',
'', to_date('2017-09-18 14:24:10', 'YYYY-MM-DD HH24:MI:SS'), to_date('2017-09-18 14:24:10', 'YYYY-MM-DD HH24:MI:SS'));

Do you have any other type of data that accepts more than 4000 characters? Or would you have some rule that I can do in BD and change this option?

  • Publish the syntax of the string, see also the type of variable that makes the Insert , is varchar2 ?

  • I posted the INSERT for you to take a look

  • this string gigantesta tente , define a variable blob , concatene part of this string (limit to 4000 charcs and insert the variable

  • I published the way it worked, it was that way?

  • I thought I didn’t accept such a big string , but funfou leaves it quiet

1 answer

0


It worked that way.

DECLARE
texto CLOB := '{"Entity":{"Version":2,"Name":"teste"},"General":{"IdCodeProfile":"teste","Description":"Descricao de teste","Email":"[email protected]","MaxSessions":1,"Backup":1,"Locked":0,"AuthPswdNeverExpire":1,"ConnectionBeforeCommand":"/Users/teste/tmp/teste/program/teste.sh conexao_antes 0","ConnectionBeforeCommandWait":1,"ConnectionStartCommand":"/Users/teste/tmp/teste/program/teste.sh conexao_inicio 0","ConnectionStartCommandWait":1,"ConnectionEndCommand":"/Users/teste/tmp/teste/program/teste.sh conexao_fim 0","ConnectionEndCommandWait":1,"ConnectionFilter":"","FileFilterTx":"","FileFilterRx":"","FileLenFilterTx":0,"FileMinLenFilterTx":0,"FileLenFilterRx":0,"FileMinLenFilterRx":0,"FileTypeDefault":"Outros","FileUserdataWithFileIdTx":0,"CreateControlCompletedFileRx":1,"StartDateHour":0,"StartDateMinute":0,"StartDateSecond":0,"EndDateHour":23,"EndDateMinute":59,"EndDateSecond":59,"WeekDayInterval":127,"TransferProtocol":1,"TxOptimized":1,"EnabledEERP":1,"Password":"73eedb38e8e4578008ac69ed6965a13eacf23ad4baf8aebc5e1f3a8f843ca44343dff66b0f66b12368d0b55fba0e4cf1d21f775704e7a1a5d210b9d5f3893bb4"},"Token":{"DLLName":"","CheckTokenId":0,"SendTokenId":0},"Net1":{"Enable":1,"TCPIPv6":0,"Debug":0,"Type":"TCP","DLLName":"libstcpnetopenssl.dylib","Mode":"ACTIVE","FTPDownloadRemoteDir":"","FTPDownloadRemoteFileMask":"","FTPDownloadRemoteFileRemove":0,"FTPDownloadRemoteTmpDir":"","FTPDownloadRemoteTmpExt":"","FTPMaxBufSize":8192,"FTPPassive":0,"FTPProxyEnabled":0,"FTPProxyRemoteAddress":"","FTPProxyRemotePort":0,"FTPProxyType":0,"FTPProxyUserName":"","FTPProxyUserPswd":"","FTPRemoteAddress":"","FTPRemotePort":21,"FTPSecurity":0,"FTPSSLCAField":"","FTPSSLCAValue":"","FTPSSLCertFile":"","FTPSSLClientPrivKeyFile":"","FTPSSLClientPrivKeyPswd":"","FTPUploadRemoteDir":"","FTPUploadRemoteTmpDir":"","FTPUploadRemoteTmpExt":"","SFTPDownloadRemoteDir":"","SFTPDownloadRemoteFileMask":"","SFTPDownloadRemoteFileRemove":0,"SFTPDownloadRemoteTmpDir":"","SFTPDownloadRemoteTmpExt":"","SFTPMaxBufSize":8192,"SFTPProxyEnabled":0,"SFTPProxyRemoteAddress":"","SFTPProxyRemotePort":0,"SFTPProxyType":1,"SFTPProxyUserName":"","SFTPProxyUserPswd":"","SFTPRemoteAddress":"","SFTPRemotePort":22,"SFTPSecurity":0,"SFTPSSLClientPrivKeyFile":"","SFTPSSLClientPrivKeyPswd":"","SFTPSSLServerFingerPrint":"","SFTPUploadRemoteDir":"","SFTPUploadRemoteTmpDir":"","SFTPUploadRemoteTmpExt":"","TCPAuthentication":0,"TCPCompress":1,"TCPCryptLevel":-1,"TCPLocalAddress":"0.0.0.0","TCPLocalPort":0,"TCPMaxRecvBuf":8192,"TCPMaxSendBuf":8192,"TCPMaxListen":0,"TCPProxyAuth":0,"TCPProxyEnabled":0,"TCPProxyRemoteAddress":"","TCPProxyRemotePort":0,"TCPProxyType":0,"TCPProxyUserName":"","TCPProxyUserPswd":"","TCPRemoteAddress":"localhost1","TCPRemotePort":33050,"TCPRfc2204":16,"TCPSecurity":4,"TCPSSLCAFile":"/Users/teste/tmp/teste/certs/stcp_teste_ca.cer","TCPSSLCAPath":"","TCPSSLCertFile":"","TCPSSLCipher":"","TCPSSLDHFile":"/Users/teste/tmp/teste/keys/stcp_dhparams.pem","TCPSSLDebugDir":"","TCPSSLDebugLevel":0,"TCPSSLPrivKeyFile":"","TCPSSLPrivKeyPswd":"","TCPSSLVerifyCert":0,"TCPMaxRecvTO":120,"TCPMaxSendTO":120},"Net2":{"Enable":0,"TCPIPv6":0,"Debug":0,"Type":"TCP","DLLName":"libstcpnetopenssl.dylib","Mode":"ACTIVE","FTPDownloadRemoteDir":"","FTPDownloadRemoteFileMask":"","FTPDownloadRemoteFileRemove":0,"FTPDownloadRemoteTmpDir":"","FTPDownloadRemoteTmpExt":"","FTPMaxBufSize":8192,"FTPPassive":0,"FTPProxyEnabled":0,"FTPProxyRemoteAddress":"","FTPProxyRemotePort":0,"FTPProxyType":0,"FTPProxyUserName":"","FTPProxyUserPswd":"","FTPRemoteAddress":"","FTPRemotePort":21,"FTPSecurity":0,"FTPSSLCAField":"","FTPSSLCAValue":"","FTPSSLCertFile":"","FTPSSLClientPrivKeyFile":"","FTPSSLClientPrivKeyPswd":"","FTPUploadRemoteDir":"","FTPUploadRemoteTmpDir":"","FTPUploadRemoteTmpExt":"","SFTPDownloadRemoteDir":"","SFTPDownloadRemoteFileMask":"","SFTPDownloadRemoteFileRemove":0,"SFTPDownloadRemoteTmpDir":"","SFTPDownloadRemoteTmpExt":"","SFTPMaxBufSize":8192,"SFTPProxyEnabled":0,"SFTPProxyRemoteAddress":"","SFTPProxyRemotePort":0,"SFTPProxyType":1,"SFTPProxyUserName":"","SFTPProxyUserPswd":"","SFTPRemoteAddress":"","SFTPRemotePort":22,"SFTPSecurity":0,"SFTPSSLClientPrivKeyFile":"","SFTPSSLClientPrivKeyPswd":"","SFTPSSLServerFingerPrint":"","SFTPUploadRemoteDir":"","SFTPUploadRemoteTmpDir":"","SFTPUploadRemoteTmpExt":"","TCPAuthentication":0,"TCPCompress":1,"TCPCryptLevel":-1,"TCPLocalAddress":"0.0.0.0","TCPLocalPort":0,"TCPMaxRecvBuf":8192,"TCPMaxSendBuf":8192,"TCPMaxListen":0,"TCPProxyAuth":0,"TCPProxyEnabled":0,"TCPProxyRemoteAddress":"","TCPProxyRemotePort":0,"TCPProxyType":0,"TCPProxyUserName":"","TCPProxyUserPswd":"","TCPRemoteAddress":"","TCPRemotePort":3305,"TCPRfc2204":16,"TCPSecurity":4,"TCPSSLCAFile":"/Users/teste/tmp/teste/certs/teste_ca.cer","TCPSSLCAPath":"","TCPSSLCertFile":"","TCPSSLCipher":"","TCPSSLDHFile":"/Users/teste/tmp/teste/keys/stcp_dhparams.pem","TCPSSLDebugDir":"","TCPSSLDebugLevel":0,"TCPSSLPrivKeyFile":"","TesteSSLPrivKeyPswd":"","TCPSSLVerifyCert":0,"TCPMaxRecvTO":120,"TCPMaxSendTO":120},"OFTP":{"Idcode":"teste","UserData":"","DLLName":"libstcptransferoftp.dylib","OdetteLevel":1,"InitMode":"R","Mode":"Both","Compression":1,"SpecialLogic":0,"Credits":99,"Restart":1,"MaxBufSize":8192,"Timeout":120,"T1":45,"T2":7,"NumMaxRetry":5,"Debug":4,"MaxLenDsn":128,"Level":"1","Password":"teste"},"SFTP":{"Idcode":"","UserData":"","DLLName":"","InitMode":"R","Mode":"Both","MaxBufSize":8192,"Timeout":120,"Debug":0,"MaxLenDsn":128,"SFTPSysdateFormat":"%Y%m%d","Password":""},"Relations":{"Groups":[]}}';
BEGIN
INSERT INTO USERS (ID, INSTANCE_ID,NAME,DESCRIPTION,CONFIG_TXT,EXTRA_TXT,CREATED,MODIFIED)
VALUES (USERS_SEQ.NEXTVAL, 1, 'river2', 'Usuário de teste conexão ao STCP Windows', texto,'', to_date('2017-09-18 14:24:10', 'YYYY-MM-DD HH24:MI:SS'), to_date('2017-09-18 14:24:10', 'YYYY-MM-DD HH24:MI:SS'));
END;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.