Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Stored procedure not working


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Dec 20, 2016 5:05 AM Last Post By: Jeff Overcash (...
Eric ten Westen...

Posts: 8
Registered: 4/4/10
Stored procedure not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 16, 2016 4:43 AM
Hi

if i run the query SELECT B FROM TO_DP(:TRANSACTIONTIMEDP)
and have 0.25 as the parameter, the procedure return 25 where i expected 0.25

Whats wrong?

Eric

CREATE PROCEDURE "TO_DP" 
(
  "A" DOUBLE PRECISION
)
RETURNS
(
  "B" DOUBLE PRECISION
)
AS
BEGIN EXIT; END ^
 
 
ALTER PROCEDURE "TO_DP" 
(
  "A" DOUBLE PRECISION
)
RETURNS
(
  "B" DOUBLE PRECISION
)
AS
BEGIN
  B = A;
  SUSPEND;
END
 ^
 
SET TERM ; ^
COMMIT WORK;
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Stored procedure not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2016 3:18 AM   in response to: Eric ten Westen... in response to: Eric ten Westen...
I get the right results in both XE3 and XE7.

Eric ten Westenend wrote:
Hi

if i run the query SELECT B FROM TO_DP(:TRANSACTIONTIMEDP)
and have 0.25 as the parameter, the procedure return 25 where i expected 0.25

Whats wrong?

Eric

CREATE PROCEDURE "TO_DP" 
(
  "A" DOUBLE PRECISION
)
RETURNS
(
  "B" DOUBLE PRECISION
)
AS
BEGIN EXIT; END ^
 
 
ALTER PROCEDURE "TO_DP" 
(
  "A" DOUBLE PRECISION
)
RETURNS
(
  "B" DOUBLE PRECISION
)
AS
BEGIN
  B = A;
  SUSPEND;
END
 ^
 
SET TERM ; ^
COMMIT WORK;

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Eric ten Westen...

Posts: 78
Registered: 12/8/99
Re: Stored procedure not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2016 3:39 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Hi

if i run the query SELECT B FROM TO_DP(:TRANSACTIONTIMEDP)
and have 0.25 as the parameter, the procedure return 25 where i expected 0.25

In holland i have to enter 0,25 not 0.25 could this be an issue Jeff?

Eric


Jeff Overcash (TeamB) wrote:
I get the right results in both XE3 and XE7.

Eric ten Westenend wrote:
Hi

if i run the query SELECT B FROM TO_DP(:TRANSACTIONTIMEDP)
and have 0.25 as the parameter, the procedure return 25 where i expected 0.25

Whats wrong?

Eric

CREATE PROCEDURE "TO_DP" 
(
  "A" DOUBLE PRECISION
)
RETURNS
(
  "B" DOUBLE PRECISION
)
AS
BEGIN EXIT; END ^
 
 
ALTER PROCEDURE "TO_DP" 
(
  "A" DOUBLE PRECISION
)
RETURNS
(
  "B" DOUBLE PRECISION
)
AS
BEGIN
  B = A;
  SUSPEND;
END
 ^
 
SET TERM ; ^
COMMIT WORK;

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Stored procedure not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2016 5:05 AM   in response to: Eric ten Westen... in response to: Eric ten Westen...
Eric ten Westenend wrote:
Hi

if i run the query SELECT B FROM TO_DP(:TRANSACTIONTIMEDP)
and have 0.25 as the parameter, the procedure return 25 where i expected 0.25

In holland i have to enter 0,25 not 0.25 could this be an issue Jeff?

Eric


yes because it is going to use the default decimal separator which for you I
suspect is a , not a .. This is a client side encoding of the parameter from a
string to a double before sending to the server and IBConsole is a Delphi app so
by default is going to use your system's decimal separator.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02