Relative Content

Tag Archive for oracle

executing dynamic sql in oracle

With DYN_DateCheck As
(Select ‘Select ‘ || ””|| TABLE_NAME ||”” || ‘ As Tbl, ‘ || ””|| COLUMN_NAME||”” || ‘ As Fld, ‘ || ‘Check_Date(‘ || COLUMN_NAME || ‘, :dateformat) As ValidDate ‘ ||
‘From ‘ || TABLE_NAME || ‘_TST ‘ ||
‘Where ‘ || COLUMN_NAME || ‘ IS NOT NULL UNION’
From all_tab_columns
Where NOT OWNER In (‘SYS’, ‘XDB’, ‘GSMADMIN_INTERNAL’ )
And TABLE_NAME In (‘EGL_CLIENTDETAIL’, ‘STG_PLY’, ‘STG_PLR’, ‘STG_IAC’, ‘STG_PPD’)
And DATA_TYPE = ‘DATE’
UNION
Select ‘Select ‘ || ”’XYZ”’ || ‘ As Tbl, ‘ || ”’XYZ”’ || ‘ As Fld, NULL As ValidDate From Dual’ From Dual
Order By 1
)
Select * From (Select * From DYN_DateCheck)
You probably already know this final Select statement won’t actually execute all of the Selects / Unions in DYN_DateCheck – it just provides the dynamic SQL. How can I execute the dynamic Select statements that are in DYN_DateCheck?

ORA-00969: missing ON keyword

CREATE TABLE PHONG ( MAP CHAR(4 BYTE) , TENPG VARCHAR2(10 BYTE) , LOAI VARCHAR2(20 BYTE) , SONGUOI NUMBER(*, 0) , DIENTICH NUMBER(*, 0) , TRANGTHAI VARCHAR2(20 BYTE) , GIA NUMBER(*, 0) ) CREATE TABLE HOPDONG ( MHD CHAR(6 BYTE) , NGAYBATDAU DATE , NGAYKETTHUC DATE , MADD CHAR(6 BYTE) , MAP CHAR(4 BYTE) , GIATHUE […]

Error creating Oracle trigger for audit logs of table changes

I’m attempting to create a trigger in Oracle to maintain a log of changes in a specific table. My goal is to record inserts, updates, and deletes in the CLIENTS table into an audit table called CLIENTS_LOG. However, when trying to create the trigger, I encounter errors related to the NEW and OLD bind variables. It seems like the link variable is wrong.

Return Results if No Record is Found in Data

The goal is to show the number of orders in different buckets (0-100, 101-400, 401-800, 801-1000, and 1001 and above). However, there are no orders of 1001 and above, but we still need to show that bucket as have 0 orders. I can’t figure out how to show that row. I am using the Orcale SQL builder.

Download Oracle Forms without logging in

I’m trying to download Oracle Forms from the official source but due I’m in a forbidden country for oracle, every time I try to sign up, the verification email never arrives (or at least I think that’s the reason. I’ve tried several times with VPN but the email never shows up. I’m assuming that they check the country of the recipient mail before sending anything)