Purging an Oracle Advanced Queue in C# -
i developing windows service uses oracle advanced queue control it. command objects placed on queue , service dequeue , attempt carry out task. in order control service developed small command application. application put commands on queue able purge queue calling dbms_aqadm.purge_queue_table whenever button pushed. have tried 2 ways. first tried:
using (oracleconnection conn = new oracleconnection(configurationmanager.connectionstrings["connectionstring"].connectionstring)) { conn.open(); oraclecommand cmd = conn.createcommand(); cmd.commandtype = commandtype.storedprocedure; cmd.commandtext = "dbms_aqadm.purge_queue_table"; cmd.parameters.add("queue_table", "prismpro_q_tab"); cmd.parameters.add("purge_condition", dbnull.value); cmd.parameters.add("purge_options", dbnull.value); cmd.executenonquery(); conn.close(); }
and following error:
ora-06550: line 1, column 7: pls-00306: wrong number or types of arguments in call 'purge_queue_table' ora-06550: line 1, column 7: pl/sql: statement ignored
dbms_aqadm.purge_queue_table has 3 parameters , passed 3 arguments. furthermore, of correct type. there no reason best can tell why error should happening. unable figure out how go away tried following:
using (oracleconnection conn = new oracleconnection(configurationmanager.connectionstrings["connectionstring"].connectionstring)) { conn.open(); oraclecommand cmd = conn.createcommand(); cmd.commandtype = commandtype.text; cmd.commandtext = "exec dbms_aqadm.purge_queue_table('prismpro_q_tab', null, null)"; cmd.executenonquery(); conn.close(); }
and got error:
ora-00900: invalid sql statement
the sql statement not invalid. runs fine in sql developer. in either case getting error messages unless missing shouldn't getting. can't figure out way around this. please tell me doing wrong or how work around this?
i bet need:
cmd.bindbyname = true;
Comments
Post a Comment