View previous topic :: View next topic
|
Author |
Message |
Naga Rajender.K
New User
Joined: 19 Dec 2008 Posts: 13 Location: Hyderabad
|
|
|
|
Hi ,
I am using the below function in my program.
EXEC SQL
VALUES :WS-TIMESTAMP-OUT = FUNCTION JTIMEZONECONVERTER
(:WS-TIMESTAMP-IN ,
:WS-ORG-TIME-ZONE ,
:WS-TARGET-TIME-ZONE
)
END-EXEC
i am getting the error as
** External Compiler Module message
** DB0100 SQL0104N An unexpected token ":WS-TIMESTAMP-OUT =
** FUNCTION" was found following "VALUES ". Expected tokens may
** include: "<space>". SQLSTATE=42601
Thanks in advance
Naga |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
try: VALUES <function(parms)> INTO :Host-VAR |
|
Back to top |
|
|
Naga Rajender.K
New User
Joined: 19 Dec 2008 Posts: 13 Location: Hyderabad
|
|
|
|
Than q Dick for ur reply.
But i am getting the same error with yhe above syntax. Can we use SELECT with RETURN..
Thanks in advance |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Quote: |
EXEC SQL
VALUES :WS-TIMESTAMP-OUT = FUNCTION JTIMEZONECONVERTER
(:WS-TIMESTAMP-IN ,
:WS-ORG-TIME-ZONE ,
:WS-TARGET-TIME-ZONE
)
END-EXEC |
If JTIMEZONECONVERTER is a DB2 function try this
Code: |
EXEC SQL
SET :WS-TIMESTAMP-OUT = JTIMEZONECONVERTER(:WS-TIMESTAMP-IN, :WS-ORG-TIME-ZONE, :WS-TARGET-TIME-ZONE)
END-EXEC |
|
|
Back to top |
|
|
Naga Rajender.K
New User
Joined: 19 Dec 2008 Posts: 13 Location: Hyderabad
|
|
|
|
Hi Craq.
I tried with this. But didnt work.
Actually we are working with cobol on AIX environment. How can we know that whether this particular db2 function is created correctly or not.
Can anybody provide sql to verify whether db2 function is created or not.
Thanks in advance |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Naga Rajender.K wrote: |
EXEC SQL
VALUES :WS-TIMESTAMP-OUT = FUNCTION JTIMEZONECONVERTER
(:WS-TIMESTAMP-IN ,
:WS-ORG-TIME-ZONE ,
:WS-TARGET-TIME-ZONE
)
END-EXEC |
What is that? is it part of a SELECT, an UPDATE or a SET statement?
You've removed too many details...
Also, what do you mean by this:
Naga Rajender.K wrote: |
Can we use SELECT with RETURN |
|
|
Back to top |
|
|
Naga Rajender.K
New User
Joined: 19 Dec 2008 Posts: 13 Location: Hyderabad
|
|
|
|
can any one provide the sql query to verify whether the DB2 External Function is created or not. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
You could try showing us the definition of the function! |
|
Back to top |
|
|
Naga Rajender.K
New User
Joined: 19 Dec 2008 Posts: 13 Location: Hyderabad
|
|
|
|
Actually I have the create query as follows.Im trying to derive the values from the below DDL.
CREATE FUNCTION TIMEZONECON(UTCtimestamp varchar(50), originaltimezone varchar(5), targetimezone varchar(5))
RETURNS varchar(100)
EXTERNAL NAME 'TIMEZONECON.TZCON’
LANGUAGE java
PARAMETER STYLE JAVA
DETERMINISTIC
FENCED
NOT NULL CALL
NO SQL
NO EXTERNAL ACTION
NO SCRATCHPAD
ALLOW PARALLEL;
Thanks |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What are the definitions for WS-TIMESTAMP-IN, WS-ORG-TIME-ZONE, WS-TARGET-TIME-ZONE, and WS-TIMESTAMP-OUT? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
just take a decision.. You posted in the cobol forum, but You say..
Quote: |
Actually we are working with cobol on AIX environment.
...
Actually I have the create query as follows.Im trying to derive the values from the below DDL.
...
LANGUAGE java
PARAMETER STYLE JAVA
... |
what is that You want ??
anywhere ( MF, AIX, UNIX, LINUX, WINDOZE ) any cobol thingy must be compiled,
why not speak to Your support
and read the manual for Your environment |
|
Back to top |
|
|
|