UDF creation problem, *** Error 7506 The library for UDF/XSP/UDM SYSLIB.oreplace1 could not be found

Database
Teradata Employee

UDF creation problem, *** Error 7506 The library for UDF/XSP/UDM SYSLIB.oreplace1 could not be found

I’m facing a problem with UDF function creation.

Although the UDF has been created, it doesn’t work as you can see below:

BTEQ -- Enter your SQL request or BTEQ command:

REPLACE FUNCTION SYSLIB.OREPLACE2

  (input_string VARCHAR(16000) CHARACTER SET LATIN,

   search_string VARCHAR(512) CHARACTER SET LATIN)

RETURNS VARCHAR(16000) CHARACTER SET LATIN

SPECIFIC oreplace1

LANGUAGE C

NO SQL

PARAMETER STYLE SQL

DETERMINISTIC

CALLED ON NULL INPUT

EXTERNAL NAME 'CS!oreplace1!/etc/opt/teradata/tdconfig/oreplace/oreplace1.c'

;

REPLACE FUNCTION SYSLIB.OREPLACE2

  (input_string VARCHAR(16000) CHARACTER SET LATIN,

   search_string VARCHAR(512) CHARACTER SET LATIN)

RETURNS VARCHAR(16000) CHARACTER SET LATIN

SPECIFIC oreplace1

LANGUAGE C

NO SQL

PARAMETER STYLE SQL

DETERMINISTIC

CALLED ON NULL INPUT

EXTERNAL NAME 'CS!oreplace1!/etc/opt/teradata/tdconfig/oreplace/oreplace1

.c'

;

*** Function has been replaced.

*** Warning: 5607 Check output for possible warnings encountered in compiling and/o

r linking UDF/XSP/UDM/UDT.

*** Total elapsed time was 1 second.

Check output for possible compilation warnings.

---------------------------------------------------------------------------

/usr/bin/gcc -D_REENTRANT -D_LIBC_REENTRANT    -I/usr/tdbms/etc   -L/usr/td

bms/lib  -fpic -c oreplace1.c

/usr/bin/gcc -D_REENTRANT -D_LIBC_REENTRANT    -I/usr/tdbms/etc   -L/usr/td

bms/lib  -fpic -c Teradata_new_delete.cpp

/usr/bin/gcc -D_REENTRANT -D_LIBC_REENTRANT    -I/usr/tdbms/etc   -L/usr/td

bms/lib   -fpic -c  pre_oreplace1.c

/usr/bin/gcc -shared -fpic -Xlinker -rpath -Xlinker /usr/tdbms/lib -Wl,--ve

rsion-script=/var/opt/teradata/tdtemp/UDFTemp/0CC3.16377.6Ffd96/UserUdf_ver

sions.scr -D_REENTRANT -D_LIBC_REENTRANT    -I/usr/tdbms/etc   -L/usr/tdbms

/lib  -o libudf_0cc3_537.so  oreplace1.o Teradata_new_delete.o pre_oreplace

1.o pre_GetQueryBandValue.o pre_MonitorVirtualConfig.o pre_pty_varcharlatin

enc.o pre_GetQueryBandSP.o pre_IdentifyTable.o pre_MonitorSessionRate.o pre

_pty_varcharlatindec.o pre_GetQueryBand.o pre_getTvsUdfViewpointSummary.o p

re_pty_floatdec.o pre_MonitorPhysicalSummary.o pre_MonitorSession.o pre_Get

TimeZoneDisplacement.o pre_pty_getdbsinfo.o pre_MonitorWDRate.o pre_SQLRest

rictedWords_TBF.o pre_MonitorVersion.o pre_SetSessionAccount.o pre_MonitorS

QLCurrentStep.o pre_IdentifyDatabase.o pre_MonitorAWTResource2.o pre_SetSes

sionRate.o pre_MonitorSystemPhysicalConfig.o pre_IdentifySession.o pre_Iden

tifyUser.o pre_MonitorQueryBand.o pre_MonitorVirtualResource.o pre_MonitorV

irtualSummary.o pre_MonitorSQLSteps.o pre_MonitorSQLText.o pre_AbortSession

s.o pre_pty_floatdecex.o pre_MonitorWD.o pre_GetQueryBandPairs.o pre_GetQue

ryBandPairs2.o pre_pty_varcharlatindecex.o pre_pty_whoami.o pre_MonitorPhys

icalResource.o pre_MonitorPhysicalConfig.o pre_installpkg.o pre_pty_getvers

ion.o pre_GetQueryBandValueSP.o pre_AbortListSessions.o pre_SetResourceRate

.o pre_MonitorAWTResource.o pre_pty_floatenc.o pre_GetQueryBandValue2.o pre

_pty_checkselaccess.o pre_MonitorMySessions.o  -ludflib  -lapi  /opt/proteg

rity/defiance_dps/pep/pepteradata62.plm  -lxsp   -ludf  -lm -ljil -lstdc++

BTEQ -- Enter your SQL request or BTEQ command:

SELECT SYSLIB.oreplace2('azabzabcabcde', 'z');

SELECT SYSLIB.oreplace2('azabzabcabcde', 'z');

*** Error 7506 The library for UDF/XSP/UDM SYSLIB.oreplace1 could not be

found

                  Statement# 1, Info =0

*** Total elapsed time was 2 seconds.


Does anybody have an idea/clue how I might resolve this issue?

Thank you very much in advanced.

3 REPLIES
Enthusiast

Re: UDF creation problem, *** Error 7506 The library for UDF/XSP/UDM SYSLIB.oreplace1 could not be found

Do you have SYSLIB.oreplace1 defined somewhere before ? If yes, can you please put its definition ? Also, don't understand why you defined SYSLIB.oreplace2 twice because the later definition would replace the first one anyways.

Teradata Employee

Re: UDF creation problem, *** Error 7506 The library for UDF/XSP/UDM SYSLIB.oreplace1 could not be found

Hi. No, I don't have SYSLIB.oreplace1 defined anywhere else and I haven't defined SYSLIB.oreplace2 twice, the second time what you can see it's just echo.

Here is an additional info bteq output:

BTEQ -- Enter your SQL request or BTEQ command:

help function SYSLIB.OREPLACE2;

help function SYSLIB.OREPLACE2;

 *** Help information returned. 3 rows.

 *** Total elapsed time was 1 second.

Parameter Name                 Type Comment

------------------------------ ---- ---------------------------------------

input_string                         CV      ?

search_string                      CV      ?

RETURN0                             CV      ?

 BTEQ -- Enter your SQL request or BTEQ command:

Enthusiast

Re: UDF creation problem, *** Error 7506 The library for UDF/XSP/UDM SYSLIB.oreplace1 could not be found

Oh k. All UDFs/XSPs/UDMs are linked in a dynamic linked library or in a package which must exist on all nodes on the database system. And it looks like, the library for this UDF/XSP/UDM could not be found on at least one node. I think you should check with your DBA regarding this.