Link to home
Start Free TrialLog in
Avatar of tesmc
tesmcFlag for United States of America

asked on

powerbuilder function is not executing messagebox

I have a function that gets called within a dw that returns a string from a query as follows:

String   ls_source
select 'test' into :ls_source from dual;
MESSAGEBOX ( 'TEST', ls_source)
return  ls_source

However, the MESSAGEBOX  never executes if placed after the sql. i don't know why.
please assist
Avatar of sandeep_patel
sandeep_patel
Flag of United States of America image

Hi,
after calling select statement, ls_source becomes null becoz of something wrong with your database connection.

If the value of title or text is null, the MessageBox does not display.

Which database are you connected to?

Try this...

String   ls_source
select 'test' into :ls_source from dual;
If sqlca.sqlcode <> 0 Then
   Messagebox('SQLERR',sqlca.sqlerrtext)
End If
If IsNull(ls_source) Then ls_source = ''
MESSAGEBOX ( 'TEST', ls_source)
return  ls_source

Regards,
Sandeep

ASKER CERTIFIED SOLUTION
Avatar of tesmc
tesmc
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial