Home » Developer & Programmer » Forms » set_block_property default where ,, why we use that much apostrophe (forms 10g)
set_block_property default where ,, why we use that much apostrophe [message #681880] Sat, 05 September 2020 07:07 Go to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

Hello Every One
Why we use that much Apostrophe in Default where clause
please explain it

a:='hiredate='||''''||:block4.search||'''';
set_block_property('emp',default_where,a);
PFA
  • Attachment: Capture.PNG
    (Size: 36.76KB, Downloaded 49 times)

[Updated on: Sat, 05 September 2020 07:11]

Report message to a moderator

Re: set_block_property default where ,, why we use that much apostrophe [message #681881 is a reply to message #681880] Sat, 05 September 2020 07:16 Go to previous messageGo to next message
Michel Cadot
Messages: 67560
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You didn't feedback nor thank nor answer to our questions on your previous topics.
please explain it

Re: set_block_property default where ,, why we use that much apostrophe [message #681884 is a reply to message #681881] Sat, 05 September 2020 08:43 Go to previous messageGo to next message
Littlefoot
Messages: 21624
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Because you're enclosing a string into single quotes, but - when enclosing a single quote into single quotes, you need that many of them in order to make it work and be correct.

Maybe a simpler (easier to read) option is to concatenate CHR(39) which represents a single quote:
a := 'hiredate=' || chr(39) || :block4.search || chr(39);
Re: set_block_property default where ,, why we use that much apostrophe [message #681887 is a reply to message #681880] Sat, 05 September 2020 14:08 Go to previous messageGo to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

what is the differene b/w these code


a := 'hiredate=' || chr(39) || :block4.search || chr(39);
a := 'hiredate=' || :block4.search ||';
a := 'hiredate=' || :block4.search ;
Re: set_block_property default where ,, why we use that much apostrophe [message #681891 is a reply to message #681887] Sun, 06 September 2020 04:46 Go to previous message
John Watson
Messages: 8428
Registered: January 2010
Location: Global Village
Senior Member
If you test it:
orclz> var block4 varchar2(10)
orclz> exec :block4:='aaa'

PL/SQL procedure successfully completed.

orclz> select 'hiredate=' || chr(39) || :block4 || chr(39) from dual;

'HIREDATE='||CHR(39)||:BLOCK4||CHR(39)
-------------------------------------------
hiredate='aaa'

orclz> select 'hiredate=' || :block4||' from dual;
ERROR:
ORA-01756: quoted string not properly terminated


orclz> select 'hiredate=' || :block4 from dual;

'HIREDATE='||:BLOCK4
-----------------------------------------
hiredate=aaa

orclz>
the difference is clear.
Previous Topic: Help Needed for Freight Calculation
Next Topic: same record appeared twice
Goto Forum:
  


Current Time: Wed Dec 02 19:46:26 CST 2020