Forum Stats

  • 3,837,505 Users
  • 2,262,265 Discussions
  • 7,900,308 Comments

Discussions

Apex Rich Text Editor and Database query

1029522
1029522 Member Posts: 1
edited Jan 29, 2015 7:04PM in General Database Discussions

Hi!

I have a problem in item Rich Text Editor. I have created a simple letter layout: <p>Debt</p> <p>Debtnumber:  '||debtnumber||'</p>.

Layout is saved in CLOB field (table LAYOUTS field LAYOUT CLOB;). Layout opens fine in Rich Text Editor.

Next step is to set a value into variable  '||debtnumber||' .

I have tried following code:

DECLARE

v_layout         CLOB; 

v_debtnumber NUMBER(10);    

BEGIN

   SELECT layout INTO v_layout FROM layouts;

   SELECT DISTINCT(debtnumber) INTO v_debtnumber FROM debts WHERE debtnumber = 1;

   INSERT INTO letters (letter) VALUES (v_layout);

END;

/

Variable does not work: it wont return the value!

But if I use code:

DECLARE

v_layout         CLOB;

v_debtnumber NUMBER(10);    

BEGIN

   SELECT DISTINCT(debtnumber) INTO v_debtnumber FROM debts WHERE debtnumber = 1;

   v_layout := '<p>Debt</p> <p>Debtnumber:  '||debtnumber||'</p>';

   INSERT INTO letters (letter) VALUES (v_layout);

END;

/

Everything works fine!

I have to use layouts to create a final letter.

What shoud I do to get a value into the variable '||debtnumber||' ?

Yours

Tuula

Tagged:
This discussion has been closed.