Advanced Queueing (Oracle 8i) & VB6 ORA-25215

Hi all.
I am trying to dequeue a queue I created in Oracle 8i using VB6 & OO4O, however when I call Q.Dequeue I get the error ORA-25215 'user_data type and queue type do not match'.
Does anyone have any ideas ??
I am new to Oracle & queues so I appologise for any stupid mistakes.
The Queue payload type:
CREATE type aq.message_type as object (
subject VARCHAR2(30),
text VARCHAR2(80));
The suspect code:
Dim Q As OraAQ
Dim QMsg As OraAQMsg
Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")
Set empDb = OO4OSession.OpenDatabase("AQ_DUAL", "aq/aq", 0)
Set Q = empDb.CreateAQ("AQQUEUE")
'Specify the message value.
Set QMsg = Q.AQMsg(ORATYPE_OBJECT, "MESSAGE_TYPE", "AQ")
Set QMsg = Q.AQMsg
'HERE for Error ORA-25215 'user_data type and queue type do not match'
Q.Dequeue

You can't create a message with a VARCHAR2 payload. It either has to be a RAW message, or a message of an object type.
Of course, your object type can have VARCHAR2 attributes, but not VARCHAR2(40000) since the maximum for VARCHAR2 is 4000. It can be a CLOB attribute, in which case the message can be up to 4 gigabytes.

Similar Messages

  • Oracle Streams 'ORA-25215: user_data type and queue type do not match'

    I am trying replication between two databases (10.2.0.3) using Oracle Streams.
    I have followed the instructions at http://www.oracle.com/technology/oramag/oracle/04-nov/o64streams.html
    The main steps are:
    1. Set up ARCHIVELOG mode.
    2. Set up the Streams administrator.
    3. Set initialization parameters.
    4. Create a database link.
    5. Set up source and destination queues.
    6. Set up supplemental logging at the source database.
    7. Configure the capture process at the source database.
    8. Configure the propagation process.
    9. Create the destination table.
    10. Grant object privileges.
    11. Set the instantiation system change number (SCN).
    12. Configure the apply process at the destination database.
    13. Start the capture and apply processes.
    For step 5, I have used the 'set_up_queue' in the 'dbms_strems_adm package'. This procedure creates a queue table and an associated queue.
    The problem is that, in the propagation process, I get this error:
    'ORA-25215: user_data type and queue type do not match'
    I have checked it, and the queue table and its associated queue are created as shown:
    sys.dbms_aqadm.create_queue_table (
    queue_table => 'CAPTURE_SFQTAB'
    , queue_payload_type => 'SYS.ANYDATA'
    , sort_list => ''
    , COMMENT => ''
    , multiple_consumers => TRUE
    , message_grouping => DBMS_AQADM.TRANSACTIONAL
    , storage_clause => 'TABLESPACE STREAMSTS LOGGING'
    , compatible => '8.1'
    , primary_instance => '0'
    , secondary_instance => '0');
    sys.dbms_aqadm.create_queue(
    queue_name => 'CAPTURE_SFQ'
    , queue_table => 'CAPTURE_SFQTAB'
    , queue_type => sys.dbms_aqadm.NORMAL_QUEUE
    , max_retries => '5'
    , retry_delay => '0'
    , retention_time => '0'
    , COMMENT => '');
    The capture process is 'capturing changes' but it seems that these changes cannot be enqueued into the capture queue because the data type is not correct.
    As far as I know, 'sys.anydata' payload type and 'normal_queue' type are the right parameters to get a successful configuration.
    I would be really grateful for any idea!

    Hi
    You need to run a VERIFY to make sure that the queues are compatible. At least on my 10.2.0.3/4 I need to do it.
    DECLARE
    rc BINARY_INTEGER;
    BEGIN
    DBMS_AQADM.VERIFY_QUEUE_TYPES(
    src_queue_name => 'np_out_onlinex',
    dest_queue_name => 'np_out_onlinex',
    rc => rc, , destination => 'scnp.pfa.dk',
    transformation => 'TransformDim2JMS_001x');
    DBMS_OUTPUT.PUT_LINE('Compatible: '||rc);
    If you dont have transformations and/or a remote destination - then delete those params.
    Check the table: SYS.AQ$_MESSAGE_TYPES there you can see what are verified or not
    regards
    Mette

  • Oracle AQ, the Advanced Queueing Facility

    Hi all,
    Does someone have first hand experience using
    Oracle AQ, the Advanced Queueing Facility?
    I am primarily interested in understanding its reliability, usability and general industry acceptance.
    thx
    Kalpana Subramanian

    DBMS_XMLQUERY and DBMS_XMLSAVE are implemented in Java. Neither are part of XQuery. However XQuery does require the java componant since the XQuery parser is currently written in Java. So while we can execute XQuery without Java we currently cannot parse XQuery statements without Java.
    DBMS_XMLGEN and DBMS_XMLSTORE should be present in XE. They are almost 100% feature equivilant to XMLQUERY and XMLSAVE but are implemented in 'C' rather than java. For XML Generation (XMLQUERY/XMLGEN) you should also consider the SQL/XML operators (XMLElement, XMLAgg, XMLForest, XMLAttributes).

  • Does Oracle Advanced Queueing support JRockit?

    Does anyone know if Oracle Advanced Queueing supports JRockit (1.5 or 1.6),
    or better still, does anyone have experience using this?

    AQ is an in-database implementation of Java Messaging Service (JMS).
    With that in mind could you please ask your question again including specifics as to what you are thinking.

  • Oracle Advanced Queueing  VS. JAVA

    Dears,
    i am facing a problem when integrating java with oracle while using advanced queueing.
    The dequeue rate is very little 26 deq/second, is there any performance tuning mechanisms to be used or optimizations?
    Thank you.

    Try http://www.akadia.com/services/ora_advanced_queueing.html
    they have some very straight forward , basic examples

  • Oracle Advanced Queueing on 10G  dequeue options  FIRST_MESSAGE

    Has anyone used the " dbms_aq.first_message " in their dequeue options when dequeueing from a queue with oracle advanced queueing?
    If so, have yoiu noticed any change in performance time ? Has it slowed processing time in anyway?
    Just looking for anyone that has actually used this and their experience with it.
    Thanks,

    Its difficult to answer without understanding what your application is trying to achieve, PLSQL notification can handle certain aspects - e.g. fire off a procedure when new messages arrive.
    Have a look at the doc to see if it might help your scenario:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14257/aq_opers.htm#sthref1315
    (10.7 Registering for Notification)
    Thanks
    Paul

  • Oracle Advance Queueing

    I am using DBMS_AQ (Advanced Queueing) , when trying to dequeue the messages from it, by providing a dequeue stored procedure that is being called by a java process the number of dequeue messages per second is below expectations; arround 33/sec.
    Please can any one tell me what is wrong, find below the stored procedure, if there is any optimization that can be made on it please tell me to speed up the dequeue process.
    CREATE OR REPLACE PROCEDURE SMPP.deq (
    outputmessage OUT smpp.sms,
    priority OUT NUMBER,
    enq_time OUT VARCHAR2,
    CORR IN VARCHAR2,
    waittime IN NUMBER
    AS
    dequeue_options DBMS_AQ.dequeue_options_t;
    message_properties DBMS_AQ.message_properties_t;
    message_handle RAW (16);
    v_err VARCHAR2 (255);
    BEGIN
    dequeue_options.WAIT := waittime;
    dequeue_options.visibility := DBMS_AQ.IMMEDIATE;
    dequeue_options.correlation := CORR;
    dequeue_options.navigation := DBMS_AQ.first_message;
    DBMS_AQ.dequeue (queue_name => 'SMPP.SMSINQ',
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => outputmessage,
    msgid => message_handle
    priority := message_properties.priority;
    enq_time :=
    TO_CHAR (message_properties.enqueue_time, 'dd-mm-rr hh24:mm:SS');
    DBMS_OUTPUT.put_line (enq_time);
    DBMS_OUTPUT.put_line (outputmessage.msg_txt);
    DBMS_OUTPUT.put_line (message_properties.priority);
    EXCEPTION
    WHEN OTHERS
    THEN
    v_err := SUBSTR (SQLERRM, 1, 255);
    DBMS_OUTPUT.put_line (v_err);
    RAISE;
    END;
    /

    I haven't found much tuning opportunities by messing with dequeue options. Adding memory to the SGA tends to help. Also, creating mutliple queue tables for the queue tends to distribute io and may also help.

  • Data synchronization between apps using Advanced Queueing

    Dear you,
    I'm quite new to Oracle Advanced Queueing and looking at this for using now.
    I want to integrate our system (name A, Web application with Java technology, deployed on Ora AS 10g, using Oracle database) with an outside system (named B, .NET technology, using Sybase database) using Oracle Advanced Queuing.
    Could you please suggest the interfaces for both system A & B to access Advanced Queuing? What is the best to use: Java, JMS or HTTP/HTTPS/SMTP?
    Many thanks,
    K.N

    So we are talking EPMA Data Synchronization here.
    Are you able to limit decimal precision?
    The number provided in the error message is not negative -- can you please provide more details?
    Thank you,
    Todd Rebner

  • ERROR: ORACLE prepare error: ORA-00936: missing expression

    Hello,
    I am required to run "pass-through" Oracle SQL, to extract data from tables into SAS for processing and manipulation. My code (attached) reads and writes (executes) but with zero records to test first. I cannot get past the Prepare Error.
    The query is very much like other queries that seem to work, but I cannot get past this prepare error. I have no other access to individauls with adequate knowledge of PL SQL, and as a last stop hoped others in the forum could quickly spot the source of errror.
    Thanks very much in advance for any assistance.
    Jeff
    1 ;*';*";*/;quit;run;
    2 OPTIONS PAGENO=MIN;
    3 %LET _CLIENTTASKLABEL=%NRBQUOTE(rx_biplr_v3_2);
    4 %LET _EGTASKLABEL=%NRBQUOTE(rx_biplr_v3_2);
    5 %LET _CLIENTPROJECTNAME=%NRBQUOTE();
    6 %LET _SASPROGRAMFILE=;
    7
    8 ODS _ALL_ CLOSE;
    NOTE: Some of your options or statements may not be supported with the Activex or Java series of devices. Graph defaults for these
    drivers may be different from other SAS/GRAPH device drivers. For further information, please contact Technical Support.
    9 OPTIONS DEV=ACTIVEX;
    10 FILENAME EGHTML TEMP;
    NOTE: Writing HTML(EGHTML) Body file: EGHTML
    11 ODS HTML(ID=EGHTML) FILE=EGHTML ENCODING='utf-8' STYLE=EGDefault
    11 ! STYLESHEET=(URL="file:///C:/Program%20Files/SAS/Shared%20Files/BIClientStyles/EGDefault.css")
    11 ! ATTRIBUTES=("CODEBASE"="http://www2.sas.com/codebase/graph/v91/sasgraph.exe") NOGTITLE NOGFOOTNOTE GPATH=&sasworklocation
    11 ! ;
    12
    13 %gaccessible;
    14 /********************************************************/
    15 * RX_BIPLR_V3.SAS ;
    16 /********************************************************/
    17
    18 dm 'log;clear;out;clear';
    19 options linesize =120;
    20 Option obs=0 NoReplace;
    21
    22 ****************************************************************************************;
    23 *Date Programmer Reviewed By WHAT WAS DONE;
    24 *----- -------------- ------------ -----------------------------------------;
    25 *2005 David Boyd Program creation for test population;
    26 *;
    27 *02/06/2006 Ivon Jones Modified to include total population;
    28 *;
    29 *07/20/2006 Ivon Jones Identified data elements for exclusion;
    30 * or inclusion for consolidation with ;
    31 * Robin's report;
    32 *;
    33 *08/18/2006 Ivon Jones Updated the Specific Therapeutic Classes;
    34 * 10-2009 J Shaf - modified to extract actual or potential Bipolar Dx from UBH and Medical Claims;
    35 ****************************************************************************************;
    36
    37
    38
    39 *%let allclmorgn = ('M','A') ; /* all claims origin code */
    40 %let begdate='01SEP2009'd;
    41 %let enddate='30SEP2009'd;
    42 %let q = %str(%') ;
    43
    44
    45 data _null_ ;
    46 call symput('fdos',put(intnx('month',"&begdate"d,-27,'beginning'), date9.) ) ;
    47 call symput('ldos',put(intnx('month',"&enddate"d,-0,'ending'), date9.) ) ;
    48 run ;
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    2 The SAS System 11:44 Friday, October 30, 2009
    cpu time 0.01 seconds
    49
    50
    51
    52 **************************************************************;
    53 * ??Use the data _null_ step to create a macro variable for the ;
    54 * year and month based on the ldos macro variable in the data ;
    55 * step above?? ;
    56 **************************************************************;
    57
    58
    59 data _null_ ;
    60 if month("&ldos"d) < 10
    61 then call symput('yr_mo',compress(year("&ldos"d) || '0' || month("&ldos"d) ) ) ;
    62 else call symput('yr_mo',compress(year("&ldos"d) || month("&ldos"d) ) ) ;
    63 run ;
    NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
    61:39 61:64 62:39 62:57
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.00 seconds
    64
    65 *%put &biplr_dx;
    66 %put &begdate ;
    '01SEP2009'd
    67 %put &enddate ;
    '30SEP2009'd
    68 %put &fdos ;
    01JUN2007
    69 %put &ldos ;
    30SEP2009
    70 %put &q ;
    71
    72
    73 libname biplr'/home/jshafi01/projects/adhoc/biplr_dprsn/data';
    NOTE: Libref BIPLR was successfully assigned as follows:
    Engine: V9
    Physical Name: /home/jshafi01/projects/adhoc/biplr_dprsn/data
    74 libname rosdwp oracle user="&oracle_user." pass="&oracle_pass." buffsize=32767 path='rosdwp';
    NOTE: Libref ROSDWP was successfully assigned as follows:
    Engine: ORACLE
    Physical Name: rosdwp
    75
    76 data work.biplr_up_v1;
    77 attrib mbr_id length=$26;
    78 set biplr.biplr_ubh_med_v1;
    79 run;
    NOTE: There were 0 observations read from the data set BIPLR.BIPLR_UBH_MED_V1.
    NOTE: The data set WORK.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: DATA statement used (Total process time):
    real time 0.01 seconds
    3 The SAS System 11:44 Friday, October 30, 2009
    cpu time 0.00 seconds
    80
    81 proc contents;
    82 run;
    NOTE: PROCEDURE CONTENTS used (Total process time):
    real time 0.03 seconds
    cpu time 0.03 seconds
    83
    84 proc datasets
    85      library = rosdwp nolist;
    86      delete biplr_up_v1;
    87 quit;
    NOTE: Deleting ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 3.74 seconds
    cpu time 0.03 seconds
    88
    89 proc datasets
    90      library=work nolist;
    91      copy out = rosdwp move;
    92      select biplr_up_v1 ;
    93 quit;
    NOTE: Moving WORK.BIPLR_UP_V1 to ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
    NOTE: There were 0 observations read from the data set WORK.BIPLR_UP_V1.
    NOTE: The data set ROSDWP.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 0.32 seconds
    cpu time 0.04 seconds
    94
    95
    96
    97 *****************************************************************************;
    98
    99 *execute(commit) by rosdwp
    100 ******************************************************************************;
    101
    102
    103 proc SQL noprint ;
    104 connect to oracle as rosdwp (user="&oracle_user." password="&oracle_pass" buffsize=32767 path='rosdwp'
    104 ! preserve_comments);
    105      execute(alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
    106 CREATE table biplr_rx as
    107 SELECT
    108 mrb_id,
    109 pcp_spc,
    110 rx_date,
    4 The SAS System 11:44 Friday, October 30, 2009
    111 brand,
    112 generic,
    113 ahfs_cd,
    114 ahfs_dsc,
    115 lbl,
    116 strngth,
    117 unt,
    118 spc_tx_cls_cd,
    119 spc_tx_cls_dsc,
    120 gcn,
    121 rx_num,
    122 rx_ingrd,
    123 rx_paid,
    124 rx_cnt,
    125 rx_qty,
    126 rx_day
    127 FROM connection to rosdwp
    128 (SELECT
    129 mid.UNIQ_MBR_ID as mrb_id,
    130 pd.PRVDR_SPCLTY_DESC as pcp_spc,
    131 pcf.LAST_SRVC_DT as rx_date,
    132 dd.BRAND_NAME as brand,
    133 dd.GNRC_NAME as generic,
    134 dd.AHFS_THRPTC_CLS_CD as ahfs_cd,
    135 dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc,
    136 dd.LABEL_NAME as lbl,
    137 dd.STRNGTH_NUM as strngth,
    138 dd.STRNGTH_UNIT_DESC as unt,
    139 dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
    140 dd.SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
    141 dd.GCN_NUM as gcn,
    142 pcf.PRSCRPTN_NUM as rx_num,
    143 SUM(pcf.INGRDNT_AMT) as rx_ingrd,
    144 SUM(pcf.PD_AMT) as rx_paid,
    145 SUM(pcf.UNIT_SRVC_CNT) as rx_cnt,
    146 SUM(pcf.DSPNSD_QTY) as rx_qty,
    147 SUM(pcf.DAY_SUPLY_CNT) as rx_day
    148 FROM
    149 PHRMCY_CLM_FACT pcf,
    150 MBR_ID_DMNSN mid,
    151 DRUG_DMNSN dd,
    152 PRVDR_DMNSN pd,
    153           biplr_up_v1
    154 WHERE
    155 (
    156 (biplr_up_v1.mbr_id = MBR_ID_DMNSN.UNIQ_MBR_ID) And
    157 (PHRMCY_CLM_FACT.FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN.FINL_CLM_KEY) AND
    158 (PHRMCY_CLM_FACT.MBR_KEY = MBR_ID_DMNSN.MBR_KEY) And
    159 (PHRMCY_CLM_FACT.BNFT_KEY = MBR_BNFT_DMNSN.BNFT_KEY) And
    160 (PHRMCY_CLM_FACT.DRUG_KEY = DRUG_DMNSN.DRUG_KEY) And
    161 (PHRMCY_FINL_CLM_DMNSN.CLM_ORGN_CD IN ('M','A')) AND
    162 (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN between &q.&fdos.&q and &q.&ldos.&q)
    163      )
    164 Group By
    165 mid.UNIQ_MBR_ID ,
    166 pd.PRVDR_SPCLTY_DESC ,
    167 pcf.LAST_SRVC_DT ,
    168 dd.BRAND_NAME ,
    5 The SAS System 11:44 Friday, October 30, 2009
    169 dd.GNRC_NAME ,
    170 dd.AHFS_THRPTC_CLS_CD ,
    171 dd.AHFS_THRPTC_CLS_DESC ,
    172 dd.LABEL_NAME ,
    173 dd.STRNGTH_NUM ,
    174 dd.STRNGTH_UNIT_DESC ,
    175 dd.SPECF_THRPTC_CLS_CD ,
    176 dd.SPECF_THRPTC_CLS_DESC ,
    177 dd.GCN_NUM ,
    178 pcf.PRSCRPTN_NUM
    179 );
    ERROR: ORACLE prepare error: ORA-00936: missing expression. SQL statement: SELECT mid.UNIQ_MBR_ID as mrb_id,
    pd.PRVDR_SPCLTY_DESC as pcp_spc, pcf.LAST_SRVC_DT as rx_date, dd.BRAND_NAME as brand, dd.GNRC_NAME as generic,
    dd.AHFS_THRPTC_CLS_CD as ahfs_cd, dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc, dd.LABEL_NAME as lbl, dd.STRNGTH_NUM as
    strngth, dd.STRNGTH_UNIT_DESC as unt, dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, dd.SPECF_THRPTC_CLS_DESC as
    spc_tx_cls_dsc, dd.GCN_NUM as gcn, pcf.PRSCRPTN_NUM as rx_num, SUM(pcf.INGRDNT_AMT) as rx_ingrd, SUM(pcf.PD_AMT)
    as rx_paid, SUM(pcf.UNIT_SRVC_CNT) as rx_cnt, SUM(pcf.DSPNSD_QTY) as rx_qty, SUM(pcf.DAY_SUPLY_CNT) as rx_day
    FROM PHRMCY_CLM_FACT pcf, MBR_ID_DMNSN mid, DRUG_DMNSN dd, PRVDR_DMNSN pd, biplr_up_v1 WHERE (
    (biplr_up_v1.mbr_id = MBR_ID_DMNSN.UNIQ_MBR_ID) And (PHRMCY_CLM_FACT.FINL_CLM_KEY =
    PHRMCY_FINL_CLM_DMNSN.FINL_CLM_KEY) AND (PHRMCY_CLM_FACT.MBR_KEY = MBR_ID_DMNSN.MBR_KEY) And
    (PHRMCY_CLM_FACT.BNFT_KEY = MBR_BNFT_DMNSN.BNFT_KEY) And (PHRMCY_CLM_FACT.DRUG_KEY = DRUG_DMNSN.DRUG_KEY) And
    (PHRMCY_FINL_CLM_DMNSN.CLM_ORGN_CD IN ('M','A')) AND (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN between '01JUN2007'
    and '30SEP2009') ) Group By mid.UNIQ_MBR_ID , pd.PRVDR_SPCLTY_DESC , pcf.LAST_SRVC_DT , dd.BRAND_NAME ,
    dd.GNRC_NAME , dd.AHFS_THRPTC_CLS_CD , dd.AHFS_THRPTC_CLS_DESC , dd.LABEL_NAME , dd.STRNGTH_NUM ,
    dd.STRNGTH_UNIT_DESC , dd.SPECF_THRPTC_CLS_CD , dd.SPECF_THRPTC_CLS_DESC , dd.GCN_NUM , pcf.PRSCRPTN_NUM.
    NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
    180 execute (drop table biplr_up_v1) by rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    181 disconnect from rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    182 quit;
    NOTE: The SAS System stopped processing this step because of errors.
    NOTE: PROCEDURE SQL used (Total process time):
    real time 0.14 seconds
    cpu time 0.03 seconds
    183
    184

    Hello Again ,
    Wish Oracle was a bit more informative. Am using a SAS Institute Product called Enterprise Guide. A "hot fix" was installed to address an issue that the product appears unable to save the latest version of edited code changes (hence " BETWEEN between" remaining even after a prior edit). In any case, with the change, am now receiving this error:
    " ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT"."LAST_SRVC_DT": invalid identifier". (Log file appears below)
    -The error remains, regardless of whether one uses "pass through" code to pass the date range to Oracle (which looks ok from the log output below I believe), or if I hard code the date range into the PL SQL query itself.
    -The Prepare error always appears at end of the inner SELECT.
    -The Prepare error remains, with or without the GROUP BY clause.
    Is there anything else here I am missing? Someone suggested a reserve word - but from other ANSI SQL versions, I do not see that is the case. I have consulted SAS Tech Support and SAS List Serve at University of GA. but nothing definitive from these sources. Have requested facility to be able to run Oracle directly, outside this SAS Institute product - in process.
    Any suggestions are greatly appreciated. Thanks to everyone very much.
    Jeff
    14 /********************************************************/
    15 * RX_BIPLR_V3.SAS ;
    16 /********************************************************/
    17
    18 dm 'log;clear;out;clear';
    19 options linesize =120;
    20 Option obs=0 NoReplace;
    21
    22 ****************************************************************************************;
    23 *Date       Programmer         Reviewed By     WHAT WAS DONE;
    24 *-----      --------------     ------------    -----------------------------------------;
    25 *2005 D. Boyd Program creation for test population;
    26 *;
    27 *02/06/2006 I. Jones Modified to include total population;
    28 *;
    29 *07/20/2006 I. Jones Identified data elements for exclusion;
    30 * or inclusion for consolidation with ;
    31 * Robin's report;
    32 *;
    33 *08/18/2006 I Jones Updated the Specific Therapeutic Classes;
    34 * 10-2009 J Shaf - modified to extract actual or potential Bipolar Dx from UBH and Medical Claims;
    35 ****************************************************************************************;
    36
    37
    38
    39 *%let allclmorgn = ('M','A') ; /* all claims origin code */
    40 %let begdate='01SEP2009'd;
    41 %let enddate='30SEP2009'd;
    42 %let q = %str(%') ;
    43
    44
    45 data null ;
    46 call symput('fdos',put(intnx('month',"&begdate"d,-27,'beginning'), date9.) ) ;
    47 call symput('ldos',put(intnx('month',"&enddate"d,-0,'ending'), date9.) ) ;
    48 run ;
    2 The SAS System 12:46 Monday, November 2, 2009
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.00 seconds
    49
    50
    51
    52 **************************************************************;
    53 * ??Use the data null step to create a macro variable for the ;
    54 * year and month based on the ldos macro variable in the data ;
    55 * step above?? ;
    56 **************************************************************;
    57
    58
    59 data null ;
    60 if month("&ldos"d) < 10
    61 then call symput('yr_mo',compress(year("&ldos"d) || '0' || month("&ldos"d) ) ) ;
    62 else call symput('yr_mo',compress(year("&ldos"d) || month("&ldos"d) ) ) ;
    63 run ;
    NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
    61:39 61:64 62:39 62:57
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.01 seconds
    64
    65 *%put &biplr_dx;
    66 %put &begdate ;
    '01SEP2009'd
    67 %put &enddate ;
    '30SEP2009'd
    68 %put &fdos ;
    01JUN2007
    69 %put &ldos ;
    30SEP2009
    70 %put &q ;
    71
    72
    73 libname biplr'/home/jshafi01/projects/adhoc/biplr_dprsn/data';
    NOTE: Libref BIPLR was successfully assigned as follows:
    Engine: V9
    Physical Name: /home/jshafi01/projects/adhoc/biplr_dprsn/data
    74 libname rosdwp oracle user="&oracle_user." pass="&oracle_pass." buffsize=32767 path='rosdwp';
    NOTE: Libref ROSDWP was successfully assigned as follows:
    Engine: ORACLE
    Physical Name: rosdwp
    75
    76 data work.biplr_up_v1;
    77 attrib mbr_id length=$26;
    78 set biplr.biplr_ubh_med_v1;
    79 run;
    NOTE: There were 0 observations read from the data set BIPLR.BIPLR_UBH_MED_V1.
    NOTE: The data set WORK.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.01 seconds
    80
    81 proc contents;
    82 run;
    NOTE: PROCEDURE CONTENTS used (Total process time):
    real time 0.02 seconds
    cpu time 0.02 seconds
    83
    84 proc datasets
    85      library = rosdwp nolist;
    86      delete biplr_up_v1;
    87 quit;
    NOTE: Deleting ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 0.61 seconds
    cpu time 0.01 seconds
    88
    89 proc datasets
    90      library=work nolist;
    91      copy out = rosdwp move;
    92      select biplr_up_v1 ;
    93 quit;
    NOTE: Moving WORK.BIPLR_UP_V1 to ROSDWP.BIPLR_UP_V1 (memtype=DATA).
    NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
    NOTE: There were 0 observations read from the data set WORK.BIPLR_UP_V1.
    NOTE: The data set ROSDWP.BIPLR_UP_V1 has 0 observations and 1 variables.
    NOTE: PROCEDURE DATASETS used (Total process time):
    real time 0.15 seconds
    cpu time 0.04 seconds
    94
    95
    96
    97 *****************************************************************************;
    98
    99 *execute(commit) by rosdwp
    100 ******************************************************************************;
    101
    102
    103 proc SQL noprint ;
    104 connect to oracle as rosdwp (user="&oracle_user." password="&oracle_pass" buffsize=32767 path='rosdwp'
    104 ! preserve_comments);
    105      execute(alter session set nls_date_format = 'ddmonyyyy') by rosdwp;
    106 CREATE table biplr_rx as
    107 SELECT
    108 mrb_id,
    109 uniq_mbr_id,
    110 pcp_spc,
    111 rx_date,
    112 brand,
    113 generic,
    114 ahfs_cd,
    115 ahfs_dsc,
    116 lbl,
    117 strngth,
    118 unt,
    119 spc_tx_cls_cd,
    120 spc_tx_cls_dsc,
    121 gcn,
    122 rx_num,
    123 rx_ingrd,
    124 rx_paid,
    125 rx_cnt,
    126 rx_qty,
    127 rx_day
    128 FROM connection to rosdwp
    129 (SELECT
    130 mid.UNIQ_MBR_ID as uniq_mrb_id,
    131 blpr.mrb_id.mbr_id,
    132 pd.PRVDR_SPCLTY_DESC as pcp_spc,
    133 pcf.LAST_SRVC_DT as rx_date,
    134 dd.BRAND_NAME as brand,
    135 dd.GNRC_NAME as generic,
    136 dd.AHFS_THRPTC_CLS_CD as ahfs_cd,
    137 dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc,
    138 dd.LABEL_NAME as lbl,
    139 dd.STRNGTH_NUM as strngth,
    140 dd.STRNGTH_UNIT_DESC as unt,
    141 dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd,
    142 dd.SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc,
    143 dd.GCN_NUM as gcn,
    144 pcf.PRSCRPTN_NUM as rx_num,
    145 SUM(pcf.INGRDNT_AMT) as rx_ingrd,
    146 SUM(pcf.PD_AMT) as rx_paid,
    147 SUM(pcf.UNIT_SRVC_CNT) as rx_cnt,
    148 SUM(pcf.DSPNSD_QTY) as rx_qty,
    149 SUM(pcf.DAY_SUPLY_CNT) as rx_day
    150 FROM
    151 PHRMCY_CLM_FACT pcf,
    152 MBR_ID_DMNSN mid,
    153 DRUG_DMNSN dd,
    154 PRVDR_DMNSN pd,
    155      BIPLR_UP_V1 blpr
    156 WHERE
    157 (BIPLR_UP_V1.mbr_id = MBR_ID_DMNSN.UNIQ_MBR_ID) And
    158 (PHRMCY_CLM_FACT.FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN.FINL_CLM_KEY) AND
    159 (PHRMCY_CLM_FACT.MBR_KEY = MBR_ID_DMNSN.MBR_KEY) And
    160 (PHRMCY_CLM_FACT.BNFT_KEY = MBR_BNFT_DMNSN.BNFT_KEY) And
    161 (PHRMCY_CLM_FACT.DRUG_KEY = DRUG_DMNSN.DRUG_KEY) And
    162 (PHRMCY_FINL_CLM_DMNSN.CLM_ORGN_CD IN ('M','A')) AND
    163 (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN &q.&fdos.&q and &q.&ldos.&q)
    164 );
    ERROR: ORACLE prepare error: ORA-00904: "PHRMCY_CLM_FACT"."LAST_SRVC_DT": invalid identifier. SQL statement: SELECT
    mid.UNIQ_MBR_ID as uniq_mrb_id, blpr.mrb_id.mbr_id, pd.PRVDR_SPCLTY_DESC as pcp_spc, pcf.LAST_SRVC_DT as
    rx_date, dd.BRAND_NAME as brand, dd.GNRC_NAME as generic, dd.AHFS_THRPTC_CLS_CD as ahfs_cd,
    dd.AHFS_THRPTC_CLS_DESC as ahfs_dsc, dd.LABEL_NAME as lbl, dd.STRNGTH_NUM as strngth, dd.STRNGTH_UNIT_DESC as
    unt, dd.SPECF_THRPTC_CLS_CD as spc_tx_cls_cd, dd.SPECF_THRPTC_CLS_DESC as spc_tx_cls_dsc, dd.GCN_NUM as gcn,
    pcf.PRSCRPTN_NUM as rx_num, SUM(pcf.INGRDNT_AMT) as rx_ingrd, SUM(pcf.PD_AMT) as rx_paid, SUM(pcf.UNIT_SRVC_CNT)
    as rx_cnt, SUM(pcf.DSPNSD_QTY) as rx_qty, SUM(pcf.DAY_SUPLY_CNT) as rx_day FROM PHRMCY_CLM_FACT pcf,
    MBR_ID_DMNSN mid, DRUG_DMNSN dd, PRVDR_DMNSN pd, BIPLR_UP_V1 blpr WHERE (BIPLR_UP_V1.mbr_id =
    MBR_ID_DMNSN.UNIQ_MBR_ID) And (PHRMCY_CLM_FACT.FINL_CLM_KEY = PHRMCY_FINL_CLM_DMNSN.FINL_CLM_KEY) AND
    (PHRMCY_CLM_FACT.MBR_KEY = MBR_ID_DMNSN.MBR_KEY) And (PHRMCY_CLM_FACT.BNFT_KEY = MBR_BNFT_DMNSN.BNFT_KEY) And
    (PHRMCY_CLM_FACT.DRUG_KEY = DRUG_DMNSN.DRUG_KEY) And (PHRMCY_FINL_CLM_DMNSN.CLM_ORGN_CD IN ('M','A')) AND
    (PHRMCY_CLM_FACT.LAST_SRVC_DT BETWEEN '01JUN2007' and '30SEP2009').
    NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
    165 execute (drop table biplr_up_v1) by rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    166 disconnect from rosdwp;
    NOTE: Statement not executed due to NOEXEC option.
    167 quit;
    NOTE: The SAS System stopped processing this step because of errors.
    NOTE: PROCEDURE SQL used (Total process time):
    real time 0.24 seconds
    cpu time 0.02 seconds
    168
    Edited by: user12142482 on Nov 2, 2009 4:02 PM

  • Error when connect to Advanced Queuing Oracle

    Dear sir,
    I'm using intellij IDE write one a class java to connect Advanced Queuing, my code follow :
    queueConnectionFactory = AQjmsFactory.getQueueConnectionFactory("host", "sid", 1521, "thin");
    queueConnection = queueConnectionFactory.createQueueConnection("usernamer", "password");
    but program have error : "Exception in thread "main" oracle.jms.AQjmsException: ORA-00604: error occurred at recursive SQL level 1
    ORA-01882: timezone region not found".
    I try connect this schema by "sql developer", i receive same error. i change file sqldeveloper.conf, put line - AddVMOption -Duser.timezone="+07:00" then sql developer work fine.
    I download tzupdater-1.3.40-2011h and run "java -jar tzupdater.jar -u" and "java -jar tzupdater.jar -f" but app not run.
    can you have me. i need complete this app.

    Post the stack trace

  • Oracle not started ORA-12560 error

    Hello,
    My Database version : 8.1.7.0.0
    OS : Windows 2000
    When I want to connect sqlplus using :
    C:\Documents and Settings\Administrator.TVCLKLB>sqlplus sys@tvclklb
    SQL*Plus: Release 8.1.7.0.0 - Production on Sun May 25 12:11:43 2008
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    Enter password:
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    And when I want to connect using sqlplus/nolog it shows :
    C:\Documents and Settings\Administrator.TVCLKLB>sqlplus/nolog
    SQL*Plus: Release 8.1.7.0.0 - Production on Sun May 25 12:13:06 2008
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    SQL> conn sys as sysdba
    Enter password:
    ERROR:
    ORA-12560: TNS:protocol adapter error
    Have any idea what is the problem and what is suggested solution. I already check the listner and service which is running smoothy.
    I shall wait for ur quick feedback.
    Thanks in advanced
    Aungshuman Paul

    For further details I put the sqlnet.log file :
    Fatal NI connect error 12640, connecting to:
    (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    VERSION INFORMATION:
         TNS for 32-bit Windows: Version 8.1.7.0.0 - Production
         Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 8.1.7.0.0 - Production
    Time: 25-MAY-2008 12:20:35
    Tracing not turned on.
    Tns error struct:
    nr err code: 0
    ns main err code: 12640
    TNS-12640: Authentication adapter initialization failed
    ns secondary err code: 0
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
    Thanks
    Aungshu

  • Advanced Queueing and SQL in same transaction?

    Can Advanced Queueing operations and SQL operations be combined in one atomic transaction? I can't find any reference to this in the Oracle AQ documentation and none of the examples show this. In my application I'm having problems that seem like deadlock when I do combine AQ and SQL in the same transaction. However, when I place them in seperate transactions it works.
    null

    I am also looking for some examples of using SQL/PLSQL w/Advanced Queueing. We currently have the following scenario: One server has non-relational tables; another server has relational tables which house the same data in a relational format. We are looking for a way to migrate the non-relational data to the relational tables and keep the data updated when it changes in the non-relational tables.
    We had considered using materialized views, but, this was ruled out because the non-relational tables are created and dropped on a daily basis.
    My email: [email protected]
    Thanks for any input you may have!

  • Advanced Queueing and databases synchronization

    What kind of (application) problems could be solved by Advanced Queueing ?
    What about databases synchronization ( two Oracle Database Standard Edition One ) ?
    TANK YOU !

    AQ is intended for messaging. Messaging between applications, messaging between back-end and front-end.
    Synchronization would be a poor use of messaging. If you want synchronization then name your version number (all four places) and replication technology and we can point you in the right direction.
    For most situations I use:
    DBMS_RECTIFIER_DIFF or DBMS_COMPARISON
    http://www.morganslibrary.org/library.html

  • Deadlock using Advanced Queueing and OC4J

    We develop an application which extensively uses JMS. We use Advanced Queueing as JMS provider (Oracle9i 9.2.0.3.0 and OC4J 9.0.3). In our application we have message driven bean which listens on cerain queue and can send messages to other queues/topics as a result of processing received message. In this scenario we sometimes get a java-level deadlock.
    An example of such deadlock is here (taken from thread dump, jvm is sun 1.4.1_01):
    Found one Java-level deadlock:
    =============================
    "TaskManager":
    waiting to lock monitor 0x8ff45c (object 0x39db898, a oracle.jdbc.driver.OracleCallableStatement),
    which is held by "ApplicationServerThread-1"
    "ApplicationServerThread-1":
    waiting to lock monitor 0x8ff43c (object 0x39e4de8, a oracle.jdbc.driver.OracleConnection),
    which is held by "TaskManager"
    Java stack information for the threads listed above:
    ===================================================
    "TaskManager":
    at oracle.jdbc.driver.OracleCallableStatement.close(OracleCallableStatement.java:980)
    - waiting to lock <039DB898> (a oracle.jdbc.driver.OracleCallableStatement)
    - locked <039E4DE8> (a oracle.jdbc.driver.OracleConnection)
    at oracle.jdbc.driver.OracleConnection.close_statements(OracleConnection.java:2333)
    - locked <039E4DE8> (a oracle.jdbc.driver.OracleConnection)
    at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1412)
    - locked <039E4DE8> (a oracle.jdbc.driver.OracleConnection)
    at com.evermind.sql.DriverManagerPooledConnection.close(DriverManagerPooledConnection.java:247)
    - locked <039DC320> (a com.evermind.sql.DriverManagerPooledConnection)
    at com.evermind.sql.OrionPooledDataSource.removeCache(OrionPooledDataSource.java:559)
    - locked <08A67AF0> (a com.evermind.sql.OrionPooledDataSource)
    at com.evermind.sql.OrionPooledDataSource.run(OrionPooledDataSource.java:505)
    at com.evermind.sql.DriverManagerXADataSource.run(DriverManagerXADataSource.java:195)
    at com.evermind.util.TaskManager.run(TaskManager.java:181)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
    at java.lang.Thread.run(Thread.java:536)
    "ApplicationServerThread-1":
    at oracle.jdbc.driver.OracleConnection.getDescriptor(OracleConnection.java:2549)
    - waiting to lock <039E4DE8> (a oracle.jdbc.driver.OracleConnection)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:132)
    at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:128)
    at oracle.jms.AQjmsObjectMessage_C.toDatum(AQjmsObjectMessage_C.java:45)
    at oracle.jdbc.driver.OraclePreparedStatement.setORAData(OraclePreparedStatement.java:2700)
    - locked <039DB898> (a oracle.jdbc.driver.OracleCallableStatement)
    at com.evermind.sql.OrclCallableStatement.setORAData(OrclCallableStatement.java:732)
    at oracle.jms.AQjmsProducer.enqueue(AQjmsProducer.java:837)
    - locked <091DBC40> (a oracle.jms.AQjmsProducer)
    at oracle.jms.AQjmsProducer.publish(AQjmsProducer.java:1366)
    - locked <091DBC40> (a oracle.jms.AQjmsProducer)
    at oracle.jms.AQjmsProducer.publish(AQjmsProducer.java:1216)
    - locked <091DBC40> (a oracle.jms.AQjmsProducer)
    at com.abilitydev.slovalco.jms.dispatcher.alarm.AlarmMessageDispatcher.dispatchMessage(AlarmMessageDispatcher.java:229)
    at com.abilitydev.slovalco.jms.dispatcher.DispatcherWrapper.dispatchMessage(DispatcherWrapper.java:51)
    at com.abilitydev.slovalco.jms.dispatcher.DispatcherWrapper.dispatchMessage(DispatcherWrapper.java:49)
    at com.abilitydev.slovalco.jms.dispatcher.DispatcherWrapper.dispatchMessage(DispatcherWrapper.java:49)
    at com.abilitydev.slovalco.jms.dispatcher.DispatcherWrapper.dispatchMessage(DispatcherWrapper.java:49)
    at com.abilitydev.slovalco.jms.handlers.PotDataHandler.handleMessage(PotDataHandler.java:40)
    at com.abilitydev.slovalco.jms.ObjectMessageBean.onMessage(ObjectMessageBean.java:95)
    at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:141)
    at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:769)
    at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:929)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
    at java.lang.Thread.run(Thread.java:536)
    Any suggestions?
    Thanks, Marcel

    Marcel --
    This sounds like something that you'd want to pursue with the Oracle support folks.
    Is it possible for you to test the application using the OC4J 904 Developer Preview and see if the problem reproduces?
    btw -- are you using a tool to pull the information from the thread-dump? I noticed the line "Found one Java-level deadlock:" which looks like output from a tool. Just interested that's all.
    cheers
    -steve-

  • Start up Advanced Queueing

    Hi,
    I would like to know the setup which needs to be made with the DB in order to enable advanced queueing.
    Also, I would like to have a nice material (easy to understand) on Advanced queuing.
    Also I would like to know how the Oracle Message Gateway works and how it works in tandem with AQ.
    Thanks and Regards,

    Can anybody email me these sql scripts to my email?
    My email id is [email protected]
    aqdemo00.sql Create users, message types, and tables
    aqdemo01.sql Create queue tables, queues, subscribers, and propagation schedule
    aqdemo02.sql Enqueue messages into input queue
    aqdemo03.sql Install dequeue procedures
    aqdemo04.sql Perform blocking dequeues
    aqdemo05.sql Perform listen for multiple agents
    aqdemo06.sql Clean up users, queue tables, queues, and subscribers in aqdemo00.sql to aqdemo05.sql
    aqdemo07.sql Enqueue and dequeue to XMLType queue using XPATH expressions
    aqdemo08.sql Demonstrates server-to-server email notifications with default XML presentation
    aqdemo09.sql Set up queues and subscribers for array enqueue and dequeue (for OCI array demos also)
    aqdemo10.sql Array enqueue 10 messages
    aqdemo11.sql Array dequeue 10 messages
    aqdemo12.sql Clean up queues and subscribers for array enqueue and dequeue (for OCI array demos also)

Maybe you are looking for

  • Error while starting AppsAdapter in  console

    Hi, I am facing the following error while starting AppsAdapter in Weblogic console. Please help me in this regard weblogic.application.ModuleException: weblogic.connector.exception.RAOutboundException: There are 1 nested errors: weblogic.connector.ex

  • Photos transferring OFF of iphone 4

    I've been trying to "delete" some photos off my Iphone to no avail. I've tried importing them from my iphone to my apple MacBook Pro, but they won't transfer---please help--what am I doing wrong?? Thanks Mary

  • Developing for 'Air for TV' with Flash builder 4.5?

    How can I target Adobe Air 2.5 when using Flash Builder 4.5 so I can develop for Adobe Air for TV? When I change the app.xml file to point to 2.5, I get the following error: "Namespace 2.5.0 in the application descriptor file should be equal or highe

  • Where to get free OS 9 Installation CD & How to contact Apple without a pho

    Hello... I am new users...your patience and help is appreciated. Two issues : Issue 1) Trying work with foreign languages (both view and enter). Actually, view seems to work fine...enter is the hard part. Having a little trouble setting it up on a Ma

  • Array of String. Can some one please respond?

    In Java,Strings are considered as objects of type String.Even String constants are considered as String objects.Right? So if I define an array of string as: public class ArrayString public static void main(String args[]) String str[] = {"one", "two",