Parammeter in a SELECT in MS clause, what could be wrong?

HI, I made a sample sp this doen work, I followed exactly how it manuals shows and still cannot do the job.
What's wrong with my code, I need to put the setting in FROM clause: (SELECT count (*) from cc from $param02).
I put a few test selects which works very well, but the job of principal still select doen, I played with qoutes and the semicolon in immediate exec, still no luck.

Appreciate you help. MY PC is below.

TX so much.
T
-----------------------------------------------

create or replace
PROCEDURE TEST1 AS
sql_s varchar2 (200);
CC number (3);
param02 varchar2 (40);
BEGIN
SELECT count (*) IN cc FROM tt_dailY_view;
DBMS_OUTPUT. Put_line (' #aaa: ' | cc);
param02: = 'tt_dailY_view ';

SELECT count (*) IN cc FROM tt_dailY_view;
DBMS_OUTPUT. Put_line (' #bbb: ' | cc);

sql_s: =' SELECT count (*) INTO cc FROM ' | param02;
DBMS_OUTPUT. Put_line (' #sql: ' | sql_s);

immediately run sql_s;
DBMS_OUTPUT. Put_line (' #ccc: ' | cc);

EXCEPTION when others then
DBMS_OUTPUT. Put_line (' error: another exception...) ');
END;

The INTO clause is in the EXECUTE IMMEDIATE

create or replace
PROCEDURE TEST1 AS
sql_s varchar2(200);
cc number(3);
param02 varchar2(40);
BEGIN
SELECT count(*) INTO cc FROM dual;
DBMS_OUTPUT.PUT_LINE (' #aaa: '||cc);
param02 := 'dual';

SELECT count(*) INTO cc FROM dual ;
DBMS_OUTPUT.PUT_LINE (' #bbb: '||cc);

sql_s :=' SELECT count(*) FROM '|| param02  ;
DBMS_OUTPUT.PUT_LINE (' #sql: '||sql_s);

execute immediate sql_s into  cc ;
DBMS_OUTPUT.PUT_LINE (' #ccc: '||cc);

EXCEPTION when others then
DBMS_OUTPUT.PUT_LINE (sqlerrm);
END;

set serveroutput on;
exec test1;
 #aaa: 1
 #bbb: 1
 #sql:  SELECT count(*) FROM dual
 #ccc: 1
PL/SQL procedure successfully completed.

VR,
Sudhakar B.

Tags: Database

Similar Questions

Maybe you are looking for

  • Chargers apple has a warranty on them?

    IF I buy a charger from Best Buy, it will be guaranteed? Or do I have to buy it from Apple? Can I get a warranty on this subject if I just bought a charger?

  • Satellite Pro A120: SD card cannot be detected.

    Whenever I insert a card SD in my Satellite Pro A120 Windows does nothing, nothing changes, it's as if I don't plug. I found that if I reinstall the driver of SD card while the card is connected, then it will be detected, but windows doesn't detect n

  • Connectivity issues - Toshiba AR5004G G Mini PCI card wireless

    I just mounted the card above for my Toshiba A30-203, but I am unable to connect to the internet. I get an error message that I have not adjusted my client adapter and that my IP address has not been set correctly. I don't have any idea what that mea

  • ThinkPad Yoga S1 does not charge on among Dock

    When to use the Dock among my trendy not says Yoga in charge. I have provided 65W power brick attached to the OneLink - powerbrick works very well if plug in Yoga. However when connected via OneLink power getting to the laptop is about 8 - 9W, as ind

  • where can I download spider solitaire xp version

    where can I find the spider solitaire game and download