Home » Developer & Programmer » Forms » Error With Execute Immediate in Oracle Forms 10g (Oracle Forms 10g, Windows 7)
Error With Execute Immediate in Oracle Forms 10g [message #631350] Tue, 13 January 2015 00:07 Go to next message
SandeepS
Messages: 15
Registered: April 2013
Junior Member
HI all,
I am using Oracle Forms 10g. i have a remote database and i have created a database link to that db. Now i need to update some data in that database from my system using forms. For that i wrote a statement like ,
execute immediate 'SELECT GLH_CODE_SEQ.NEXTVAL@WB INTO '||GLHCODE||' FROM DUAL'; (glh_code_seq is a sequence in remote db)

but its showing error like error 591: this feature is not supported in client side programs.

then i changed the statement to ,
forms_ddl('SELECT GLH_CODE_SEQ.NEXTVAL@WB INTO '||GLHCODE||' FROM DUAL');
Now that error is not popping but the variable is not receiving any value.

The same statement(forms_ddl) is working fine on sql*plus.

Someone pls help me on whether i'm doing anything wrong or suggest whether anything to be done on this.


Thank You,
Sandeep
Re: Error With Execute Immediate in Oracle Forms 10g [message #631354 is a reply to message #631350] Tue, 13 January 2015 00:40 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why do you want to use FORMS_DDL? (EXECUTE IMMEDIATE won't work in Forms anyway). What's wrong with pure & simple PL/SQL:
declare
  l_glh_code number;
begin
  select glh_code_seq.nextval@wb 
    into l_glh_code
    from dual;
end;
Re: Error With Execute Immediate in Oracle Forms 10g [message #631377 is a reply to message #631354] Tue, 13 January 2015 03:32 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Even if forms accepted execute immediate it wouldn't have worked as the syntax is wrong. The variable has to be outside the string, like this:
execute immediate 'SELECT GLH_CODE_SEQ.NEXTVAL@WB FROM DUAL' INTO GLHCODE;


That said, as LF pointed out, you don't need dynamic code and shouldn't use it.
Re: Error With Execute Immediate in Oracle Forms 10g [message #631852 is a reply to message #631350] Tue, 20 January 2015 23:08 Go to previous messageGo to next message
SandeepS
Messages: 15
Registered: April 2013
Junior Member
HI all,
Thank you Cookie Monster , my syntax was wrong. I changed it as you suggested and is working noe.

Thanking Both of you very much ...

But, is there another way to insert into remote database tables using forms. Because if i execute the statements directly(without dynamic sql) forms throwing error.


Thank You,
Sandeep
Re: Error With Execute Immediate in Oracle Forms 10g [message #631858 is a reply to message #631852] Wed, 21 January 2015 00:03 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
To INSERT into remote database tables? There's no INSERT in your code (at least, I don't see it).

Anyway: insert works over a database link just fine (if you use it correctly), i.e.
insert into some_table@db_link (col_1) values (<some_value>)
Re: Error With Execute Immediate in Oracle Forms 10g [message #632250 is a reply to message #631350] Wed, 28 January 2015 05:26 Go to previous message
SandeepS
Messages: 15
Registered: April 2013
Junior Member
Hi all,

Thanks Once Again LittleFoot and CookieMonster. It was my mistake to put execute immediate.

thanks a ton...


Thank You,
Sandeep
Previous Topic: debug fmx file
Next Topic: Property Classes (Oracle Form 11g)
Goto Forum:
  


Current Time: Thu Apr 25 07:25:23 CDT 2024