Home » Developer & Programmer » Forms » message problem
message problem [message #285906] Thu, 06 December 2007 01:13 Go to next message
salwa
Messages: 76
Registered: December 2007
Member
declare
x varchar(100);
begin
x :=message('dasdadadaefd');
end;

its possiable
Re: message problem [message #285910 is a reply to message #285906] Thu, 06 December 2007 01:27 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Did you try it?
What error did you get?
Re: message problem [message #285935 is a reply to message #285906] Thu, 06 December 2007 02:23 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Dear when you take a VARCHAR OR VARCHAR2 then you are trying to store some character or stings into it. Right?

That means

if x varchar(100);

then you can store

x := 'A'
Or
x := 'ABc'

Now see your code

x :=message('dasdadadaefd');

Is the above value is a string. I don't thing so. So make it a string to store it.

If you do the following you can store it.

x := 'message ('||''''||'dasdadadaefd'||''''||')'

Regards,
Azam Khan
Re: message problem [message #285936 is a reply to message #285935] Thu, 06 December 2007 02:29 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
Quote:

Is the above value is a string. I don't thing so. So make it a string to store it.

can you prove that it;s not a string.

create or replace function string_test(p_string varchar2) 
    return varchar2 is
  begin
  return p_string;
end;


declare
  x varchar2(100);
begin
  x :=string_test('display as string');
  dbms_output.put_line(x);
end;





regards,

[Updated on: Thu, 06 December 2007 02:34]

Report message to a moderator

Re: message problem [message #285941 is a reply to message #285935] Thu, 06 December 2007 02:54 Go to previous messageGo to next message
salwa
Messages: 76
Registered: December 2007
Member
message build in message.
i want to retrive database message
Re: message problem [message #285942 is a reply to message #285941] Thu, 06 December 2007 02:56 Go to previous messageGo to next message
salwa
Messages: 76
Registered: December 2007
Member
CREATE OR REPLACE procedure VALIDATE_OPERATION_WEB(br_code in varchar2,mk_user_name in varchar2,rightid in number)
is

RECORD_COUNT number;
v_data number;

begin
SELECT distinct 1 INTO RECORD_COUNT
FROM
test.USERINFO ,
test.USERROLE ,
test.ROLERIGHTS ,
test.RIGHTS
WHERE
test.USERINFO.ID = test.USERROLE.USERID
AND test.ROLERIGHTS.RIGHTSID = test.RIGHTS.ID
AND test.USERROLE.ROLEID = test.ROLERIGHTS.ROLEID
AND test.USERINFO.HOMEBRANCHID =to_number(br_code)
AND UPPER(test.USERINFO .USERNAME) = UPPER(mk_user_name)
AND test.RIGHTS.ID = rightid;

RAISE TOO_MANY_ROWS;

EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error(-20010,'User has no right to perform the operation ');
raise_application_error(-06512,'User has no right to perform the operation ');

WHEN TOO_MANY_ROWS THEN
NULL;

WHEN others THEN
raise_application_error(-20002,'Can not Use it ');
end;
/

this is my procedure
message will be 'User has no right to perform the operation '
Re: message problem [message #285954 is a reply to message #285936] Thu, 06 December 2007 03:19 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Dear Salwa you didnt said that in " x :=message('dasdadadaefd'); "
Message() is a function or procedure. I thought that you are trying to store a value...


Re: message problem [message #285961 is a reply to message #285942] Thu, 06 December 2007 03:30 Go to previous messageGo to next message
Littlefoot
Messages: 20894
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why do you insist on a procedure? Why wouldn't you create a FUNCTION instead, which would return "OK, you can do that" or "NO, you can not do that"?

BTW, this is one of the coolest solutions recently:
RAISE TOO_MANY_ROWS;

EXCEPTION
  WHEN TOO_MANY_ROWS THEN
    NULL;
(not to mention the WHEN OTHERS handler which isn't helpful at all).
Re: message problem [message #285985 is a reply to message #285961] Thu, 06 December 2007 04:23 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Yes I think Littlefoot is right you should use a function instead of this but if it is necessary to use procedure only then...

A procedure passes value in different way then a function

For a procedure if you want to return a value from it then you have to declare a OUT variable in the procedure.


Regards,
Azam Khan
Re: message problem [message #288878 is a reply to message #285985] Wed, 19 December 2007 00:18 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
titu,

Did you solve your problem?

David
Previous Topic: plse help
Next Topic: How to assign a value more than 32000bytes to a text field in oracle forms
Goto Forum:
  


Current Time: Mon Dec 05 10:38:17 CST 2016

Total time taken to generate the page: 0.22087 seconds