Home » Developer & Programmer » Forms » concate two colulmns
concate two colulmns [message #639141] Thu, 02 July 2015 02:54 Go to next message
palpali
Messages: 138
Registered: December 2014
Location: India
Senior Member
Hallo all..

I would like to concate two fields into one in Oracle forms, but i m getting error 103 at line 2 column 27 Sad

my code:

 select fname, lname 
         into :block1.ename || ' ' || block1.ename
        from empl
      where id = :block1.eid;


can anyone please help me

regards,
Re: concate two colulmns [message #639142 is a reply to message #639141] Thu, 02 July 2015 03:01 Go to previous messageGo to next message
Littlefoot
Messages: 21331
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That certainly won't work; you can't concatenate two block items (doesn't make sense).

select fname ||' '|| lname
  into :block1.ename
  from empl
  where id = :block1.eid

looks like something that might work. If you aren't satisfied with it, please, post a screenshot and explain what you'd like to have as a result.
Re: concate two colulmns [message #639143 is a reply to message #639142] Thu, 02 July 2015 03:04 Go to previous messageGo to next message
palpali
Messages: 138
Registered: December 2014
Location: India
Senior Member
thank you very much Smile
Re: concate two colulmns [message #639146 is a reply to message #639143] Thu, 02 July 2015 03:29 Go to previous messageGo to next message
palpali
Messages: 138
Registered: December 2014
Location: India
Senior Member
Hi Litlefoot Smile

thankx for your help. Now i am getting another error :/

"frm-40735 post-query trigger raised unhandled exception ora-01403"

would it be the Problem cause of, my column (eid) is empty? because i have added this column in my table later on and is empty

can you please help, how to solve this error?

thanking you
regards.
Re: concate two colulmns [message #639148 is a reply to message #639146] Thu, 02 July 2015 04:27 Go to previous messageGo to next message
Littlefoot
Messages: 21331
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ORA-01403 indicates that no data has been found, i.e. SELECT returned no rows.

As Forms' triggers are PL/SQL, you can handle that situation in its EXCEPTION section, such as
begin
  select fname ||' '|| lname
  into :block1.ename
  from empl
  where id = :block1.eid;

exception
  when no_data_found then
    :block1.ename := 'Unknown';
end;

Or, you could use an aggregate function which will suppress that error message, but I believe you'd rather use the first (EXCEPTION) option as it clearly shows what's going on:
select max(fname ||' '|| lname)
  into :block1.ename
  from empl
  where id = :block1.eid
Re: concate two colulmns [message #639154 is a reply to message #639148] Thu, 02 July 2015 05:43 Go to previous message
palpali
Messages: 138
Registered: December 2014
Location: India
Senior Member
Thankx a lot Mr Litlefoot Smile

Previous Topic: bad bind variable parameter.G_query_find
Next Topic: Sending SMS from a form
Goto Forum:
  


Current Time: Fri Jan 19 22:19:52 CST 2018

Total time taken to generate the page: 0.30239 seconds