anthonycervantes
Programmer
OK, I am not a Oracle guy, I know Microsoft, but I am writing a script for an Oracle 8 DB. I want to declare variables, set those variables and then use them in a WHERE clause of a SELECT statement. Here is how I would do it for SQL Server 2K:
DELCARE @myvariable varchar(10)
SELECT *
FROM mytable
where name = @myvarible
GO
Here is what I have so far for my Oracle script:
DECLARE
cp_id INTEGER := 95967;
BEGIN
Select *
FROM mytable
WHERE mytable.COUNTERPARTY_ID = cp_id
END;
This doesn't work. Now what am I missing. This should not be hard to do. It is a very basic thing. Help me out please.
AC
DELCARE @myvariable varchar(10)
SELECT *
FROM mytable
where name = @myvarible
GO
Here is what I have so far for my Oracle script:
DECLARE
cp_id INTEGER := 95967;
BEGIN
Select *
FROM mytable
WHERE mytable.COUNTERPARTY_ID = cp_id
END;
This doesn't work. Now what am I missing. This should not be hard to do. It is a very basic thing. Help me out please.
AC