You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

To print number in string

6 replies [Last post]
Guest's picture
Guest

Hi all,

I have a SQL query with me which gives o/p in word if any digit is entered directly in oracle DB.

select to_char(to_date(1234567,'J'), 'JSP') as text_number from dua

Output:

TEXT_NUMBER
---------------------------------------------------------------------
ONE MILLION TWO HUNDRED THIRTY-FOUR THOUSAND FIVE HUNDRED SIXTY-SEVEN

Now,i have 1 field in Amount in a record..and i want to popup a message whenever a number is enter in this field...
I had tried with sql exec
like
&Amount=recname.fieldname.value;

SQLExec("select to_char(to_date(&Amount,'J'), 'JSP') as text_number from dual", &temp);
WinMessage(&temp);
But ist giving me some error....

Any help would be appreciated...

Lepa's picture
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: To print number in string

What is the error you are getting?

I also don't recommend using WinMessage. It is and outdated way of doing things. use MessageBox or MsgGet. Here is a post about them. You can find more in Peoplebooks.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: To print number in string

Hi Lepa,

Thanks for your concern...But i dont think so it is due to Winmessage.
Error i am getting is:

SQL Error:fUNCTION sqleXEC
Error position:0
Return:1008-ORA-01008:Not all variable bound

Lepa's picture
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: To print number in string

Ok the error makes sense. You can't have &amount inside of your SQLExec. You need to pass the value in as a bind, and that's what the error is telling you.

SQLExec("select to_char(to_date(&Amount,'J'), 'JSP') as text_number from dual", &temp);

Your SQLExec needs to be something like this:

SQLExec("select to_char(to_date(:1,'J'), 'JSP') as text_number from dual", &Amount,&temp);

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: To print number in string

Thanks a lot Lepa .............................

Its working fine now........:)...
May have some link or tutorials or any sites where i can do a self study or try to implement new thing.
As of now i dont have any technical base only 6 months and merely reading peoplebooks is simply boaring........:(any help would be appreciated.....

Lepa's picture
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: To print number in string

Your welcome...
I've learned everything I know on the job. All what I know came from projects I've done and digging in peoplebooks :). Believe it or not, my 1st project years back was to add a translate value to a field and I was like, what the heck is translate value?! I Had to read peoplebooks to figure out how to add it to a field!

This is the way it is with PeopleSoft, there are no short cuts, you need to give it time. You'll get there, just keep at it and good luck.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Guest's picture
Guest (not verified)
Re: To print number in string

Thnks for your Advice.....
will try to implement on it......
And as i know,if i face any difficulty..you are here :)
Thanks again.......
Please keep posting tips.......