• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL help please

jmolayal

Senior member
Ok I am new to SQL, so bear with me. I am using Oracle 9i for a project. I need to write a procedure that will basically do this

select * from table;

Thats it. Just display the entire table. Everytime I make a new procedure, I get an error stating I need to have an into command.. Any help?

-Jaison
 
Maybe you need to put it into some kind of variable?
My limited experience is only with PHP + MySQL, which is pretty easy stuff.
 
Interesting that you mention variables..

I had it originally going to a set of host variables.. But how to I print multiple host variables on one line? I can't get them to concatenate together...
 
I think you need to create a cursor

something like this:
DECLARE

CURSOR example1 IS
SELECT *
FROM table;

v_example table%rowtype;

BEGIN
OPEN example1;
LOOP
FETCH example1 INTO v_example;
EXIT WHEN example1%NOTFOUND;

DBMS_OUTPUT.PUT_LINE(v_example.field1, etc.....);

END LOOP;
CLOSE example1;
END;
It's not perfect but i'm not at work.
 
Back
Top