Use of SUBSTR function

Hi,
I have a query like this:
SELECT decode((select count(1) from patient_history b where (b.studyid =a.studyid and b.baseline_no= a.baseline_no and b.aeseq=a.aeseq and release_date IS not NULL)),0,'New','Current') status , a.*
FROM patient_history a
In this query for the where clause ( "b.studyid =a.studyid and b.baseline_no= a.baseline_no and b.aeseq=a.aeseq")
All the columns listed here in the where clause need to come from some table tab100 which has a column named 'col'.
tab100
col
This col columns store the column names which need to used in the "where" clause comparison.(its a self join)
Say this columns has, 'STUDYID,BASLINE_NO,AESEQ" as value then how can I write a dynamic string so I can select these values as "a." or "b." etc and write the query completely.
select decode((select count(1) from patient_history || 'b' || 'WHERE( ' || ' dynamic string after fetching from col ' ||...etc.
I tried using subtsr but failed to do so. Please help.
Rgds,
Aashish

Hi,
This may help
-- Created on 1/19/2010 by USER
declare
  -- Local variables here
  i integer;
  str varchar2(2000);
  str1 varchar2(2000);
begin
  -- Test statements here
for i in 1..3 loop /* count of columns */
for x in (select col from test100) loop
str:=str||' a.'||REGEXP_SUBSTR(x.col, '[^,]+', 1,i)||'=b.'||REGEXP_SUBSTR(x.col, '[^,]+', 1,i)||' and';
end loop;
end loop;
str:=rtrim(str,' and');
dbms_output.put_line(str);
end;The only thing you will have to determins is the number of column you need to join.
If you are on 11g you may use regexp_count and determins else tehre are number of ways to do that you can search on teh forum.
Regards,
Bhushan
Edited by: Buga on Jan 19, 2010 9:57 AM
Included the table

Similar Messages

  • SAP XI - Using the substring function.

    Hi Experts,
    I am having trouble using the substring function in SAP+XI. I have to consider the value from characters 6 to 19 for a target field of 25 characters. Every time I ma using the standard substring function it is giving an error Array Out of Bounds Exception.
    Please tell me how to proceed.
    Thanks
    Aniruddha

    Hi,
    Above error wil come if the input string length is less than the substring length what you are trying to get..
    i.e length of the input string is less than 25 characters... do some validations or pass substring as 6 and 0 ..
    HTH
    Rajesh

  • Use of substr function will avoid the use of indexes in a table

    i have one table which will contain some 3,00,000 records, it contains some 11 primary keys i am using some update statements to update some fields in the records (of 3,00,000 i will compare some 1,50,000 records with 1,50,000 another records) i am using substr function in all the select statements. whether usage of substr function will avoid the use of index
    can any one clarify?

    contains some 11 primary keys by this I suppose you mean to say the table has a composite PK on 11 columns.
    i am using substr function in all the select statementsCould you please post your SQL statement?

  • Using substring function in the Universe

    What is the correct syntax of using the substring function in the Universe?
    I need to extract the numbers and decimal between the #'s, and the character length varies:
    From: DOE, JOHN  Added the following entry to work history:
    A1S#0.25#
    To: 0.25
    Please help!  Thanks!

    There are ticket details in the text - I replaced certain letters with x, o, or a.  I thought you would need the total number of characters in the text.
    0.25#"
    DOE, JOHN A Xddxd xxx xxllxwOIg xIxxI xx wxxk xOXxxxI:
    A1S#0.25#"O xxxxd Oxck xxxm CJ, xx XxOd xxxx wx xxx XuppxXxd xx Ox gxxxOIg xlxxxX xI xxOX.  Xx, xxx quxXxOxI xxmxOIX wxxx xx dx Ixw?  XOxxxx wx mxkx xxx dxcOXOxI xx OgIxxx xxOX cxIdOxOxI xId xxvx Ox xxmxvxd xxxm XmxxxX, xx wx xxI xx xxXxxxcx xxp xxlkxxX xId Xxx Ox wx cxI Xxxp Xxmx xx xxx xxxxxOc, xx wx xxdxx x OOggxx cOxcuOx xx xxIdlx xxx OuxXxX wOxxxux xII dxxpX.  O'll xxI xx xuI xxOX OI mxIxgxmxIx xId xxx xxXx xx xxx xxxm xx Xxx wxOcx wxI wx wxIx xx gx".
    1#"
    DXX, JXXN X XddXd xxX xxllxAxng XnxrN xx Axrk xxAxxrN:
    A1S#1#"X dxn'x AXX xxxA xn AxnAxrd.  X AxA gxxng xx AxXAk xxX xnxXrxxAX xx AXX xx ApxkXA xn xxrxugxpux AXrX xbAXrvXd xA xxA bXXn AuggXAxXd, xxAXvXr, xxA nxx xn AxnAxrd.  X AxXAkXd Dxrx xnd dxn'x AXX xnN xndxAxxxxn xxxx xxxA xA xn xnN xlxrI grxupA xxr xxrXAxxld Ixnxxxrxng, Ax X'I AxndXrxng AxXrX xxX xlxrI xA AxIxng xrxI.  Xx Axuld bX xxxx xxXrX xA nx xnxXnxxxn xx bX xlxrIxng xn xxxA xx xll xnd xxX xlxrIA Axuld bX AxIxng xrxI xn xld Ixnxxxrxng AxurAX xxxx xA nx lxngXr vxlxd (xX, xxxA AlxppXd xxrxugx xxX ArxAkA AxIXxxA).  X AXnx xn XIxxl xx AurxxA JxnXA xx AXX xx xX Axn xXll Axxx xxX AxurAX xx xxX xlxrI xA (xX, Axxx Ixnxxxrxng ANAxXI xAxuxllN gXnXrxxXd xxX xlxrI)."
    0.5#
    DOE, JOHN A Xaaxa xax OolloxixI xxxIx xo xoIk aisxoIx:
    A1S#.05# "XIxxsOxIIixI xo IXS XixI x quxux OoI xaaixioxxl ixOoIoxxiox xxa Ixcoooaxxioxs."

  • Failed to convert Clob to String by using dbms_lob.substr

    it says that the cache is not enough to do this.
    I would like to get some infos from two tables as a View.
    and one of the table contains a Clob data which is large
    than 4k i think.
    and when I tried to create the view, it says that expecting
    - but got Clob, so I would like to change it to String by using
    dbmas_lob.substr function and met the cache limited problem.
    The database I am using is 10.2.0.1.0.

    Thanks for reply.
    and the problem was fixed.
    after I removed 'distinct', which specified after 'select'.

  • SUBSTR function in the where clause

    HI
    I want to get a number of 15 digits from a column where the user only know the last 10 digits.
    So that when the user enter a number with 10 digits, only the record of that specific number should be displayed.
    And then when the user did not enter any number all the records in the table should be displayed.(this part works fine)
    The problem is: when the user enters any last digits( last, second last, thirth last and so on) the records which satisfy this are retrieved, which is not supose to be the case.
    I' am trying to use the substr function in the where clause but I'm not sure if it's working or not becasue the result of the query is just the same as before i used the substr.
    Thanks

    better to pad with '*' me thinks in case u have a number ending with 0's:
      1  select empno,ename
      2  from emp
      3* where empno like '%'||lpad('&1',2,'*')
    SQL> /
    Enter value for 1: 0
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('0',2,'*')
    no rows selected
    SQL> /
    Enter value for 1: 00
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('00',2,'*')
         EMPNO ENAME
          7900 JAMES
    SQL> /
    Enter value for 1:
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('',2,'*')
         EMPNO ENAME
          7369 SMITH
          7499 ALLEN
          7521 WARD
          7566 JONES
          7654 MARTIN
          7698 BLAKE
          7782 CLARK
          7788 SCOTT
          7839 KING
          7844 TURNER
          7876 ADAMS
         EMPNO ENAME
          7900 JAMES
          7902 FORD
          7934 MILLER
    14 rows selected.

  • UCCX Script String Substring Function

    I cannot use the Substring function to obtain a specific value from a string variable.
    My substring position is variable, so I need to put a variable, loop and increment it the position.
    When I try to add the below command, this is getting the error message:
    Command: set STR_Resultado = STR_Valor.substring(P1,2+1)
    Error message:
    "Unable to parse expression; error while parsing string: STR_Valor.substring(P1,P2); nested exception is java.lang.NullPointerException"

    To ask the obvious: do either P1 or STR_Valor have a null value at the time that step executes? If they do, this is the expected result. Use an On Exception Goto step or other preventative code to protect the step from this exception.
    Why does your command and the error not match?
    Command: substring(P1,2+1)
    Exception: substring(P1,P2)
    If the command statement is what you're actually using (your image attachment isn't showing) then I believe you have a syntax error. The substring method documentation doesn't suggest you can do additive operations here.
    Most likely the first bullet though...
    PS- You may want to get the length of the string first and ensure that the startIndex and endIndex are less than or equal to it. I believe you'll get a IndexOutOfBoundsException if you try to pull a substring from outside the bounds of the actual string.
    Please remember to rate helpful responses and identify helpful or correct answers.

  • Using substring function with error

    Hi Guys,
    I have a source field with 1200 characters which need to map to multiple target segments for  132 count of this source field.
    This is not a mandatory field so it sometimes come without any value.
    I am using substring function to breakout the string for every 132 characters and mapped to the target segments.
    There are two problems, first it seems that if source is blank, there will be error.
    Second, if source field come with only eg. 300 characters, error will also occurs.
    I have searched thru SDN and try some of the UDF but to no avail.
    Appreciate your guidance on this problem.
    Regards
    FNG

    H Rahul,
    I have tried your quote but face some syntax error as follows
    Function calculate, Line 6:
    cannot find symbol symbol  : method length() location: class java.lang.String[] j = input.length();       
    Function calculate, Line 26:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]           
    result.addValue(input.subString(0,EndIndex));                                      ^
    Function calculate, Line 34:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]                result.addValue(input.subString(StartIndex,EndIndex));                                              ^
    Function calculate, Line 40:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]                result.addValue(input.subString(StartIndex,EndIndex));                                              ^ Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 4 errors

  • How to use Substring function with Case statement.

    Hello Everyone,
    I have one requirement where I have to use substring function on the field for report criteria.
    E.G.
    I have Branch Name Field where I have all branch names information, Now some of the branch names are too big with some extension after the name .
    now i want to substing it but the character length varies for each branch.
    so is there any way where we can use case statement where we can define that if branch name character are exceeding some value then substing it with this length.

    Try something like this:
    CASE WHEN LENGTH(tablename.Branch_Name) > n THEN SUBSTRING(...) ELSE tablename.Branch_Name END
    where n is the number of characters you want to start the break.

  • Error using Extended SQL Function substr

    I want to be able to look for the first three letters of a month in the XML and if found replace the 3 letter month (for example SEP-05 to September 05). I have tried the following which throw a namespace exception. Please let me know what I may be doing wrong?
    1. <?if:(xdofx:substr(../fsg:ColContext[2]/fsg:ColHeadLine2,1,3)='SEP'?>September<?end if?> should give me September.
    The above fails with: Font Dir: E:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: E:\Work\Bacardi\Reports\XML\US GAAP BALSHEET\XML BL Dir Rpt BS YTD_0126.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(XSLT10gR1.java:514)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:192)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:156)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:916)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:869)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:204)
         at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1535)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:925)
         at RTF2PDF.runRTFto(RTF2PDF.java:590)
         at RTF2PDF.runXDO(RTF2PDF.java:443)
         at RTF2PDF.main(RTF2PDF.java:237)
    Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.
         at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:782)
         at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:564)
         ... 15 more
    2. For the year, I would use another form field and do something like this next to the month above: <?xdofx:substr(../fsg:ColContext[2]/fsg:ColHeadLine2,5,2)?> for a result of '05'

    Hasan
    XSL has many native string manipulation functions so you do not need to use our SQL functions when a native XSL one will do:
    <?if:substring(normalize-space(../fsg:ColContext[2]/fsg:ColHeadLine2),1,3)='SEP'?>September<?end if?>
    See that dang normalize space function again ... had to use it on my FSG sample.
    Would it not be easier to either:
    1. Have the FSG generate the September YYYY format or
    2. Have FSG generate XSD date formats, 'YYYY-MM-DD', then you can just specify the date format in the form fields
    Regards, Tim

  • Using substr function loses index. Query tune help

    Hi
    when i use substr function in the join condition it loses index and the query is slow. How to fix this problem or tune this query. These are the lines in the query.
    and substr(a.invoice_num,1,9) = l.invoice_num
    and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
    and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key
    select
    pap.full_name employe_name,
         k.SEGMENT1 ||'.' ||k.segment2 Cost_Center,
         a.invoice_num Invoice_Number,
         b.item_description Line_Item,
         b.amount Amount,
         cc.trx_id Corporate_Card_Transaction_Id,
         cc.transaction_date Date_Charge_Incurred,
         cc.posted_date Date_Charge_Posted_To_USBank,
         cc.creation_date Date_Posted_To_IExpense,
         a.creation_date Expense_Report_Creation_Date,
         l.report_submitted_date Expense_Report_Submitted_Date,
         mgr_apprv_lst.activity_begin_date Managers_Approval_Begin_Date,
         mgr_apprv_lst.activity_end_date Managers_Approval_End_Date,
         pbl_apprv_lst.activity_begin_date AP_Approval_Begin_Date,
         pbl_apprv_lst.activity_end_date AP_Approval_End_Date,
         e.check_date Payment_Date_To_USBank,
         e.check_number Payment_Number,
         mgr_apprv_lst.activity_result_display_name Managers_Process_Result,
         pbl_apprv_lst.activity_result_display_name AP_Process_Result
    from
         ap_checks_all e,
         ap_invoice_payments_all d,
         ap_invoices_all c,
    ap_expense_report_headers_all a,
         ap_credit_card_trxns_all cc,
         per_all_people_f pap,
         ap_expense_report_headers_all l,
         ap_expense_report_lines_all b,
         gl_code_combinations k,
         (select ias1.user_key,
         ias1.activity_result_display_name,
         ias1.activity_begin_date,
         ias1.activity_end_date
    from wf_item_activity_statuses_v ias1,
    (select c1.invoice_num
         from ap_checks_all e1,
         ap_invoice_payments_all d1,
         ap_invoices_all c1
         where trunc(e1.check_date) between nvl(:From_Date, trunc(e1.check_date))
         and nvl(:To_Date, trunc(e1.check_date))
    and e1.org_id = 141
    and e1.void_date IS null
    and d1.check_id = e1.check_id
         and c1.invoice_id = d1.invoice_id) inv_lst1
    where ias1.item_type = 'APEXP'
    and ias1.user_key = inv_lst1.invoice_num
    and ias1.activity_name = 'AP_MANAGER_APPROVAL_PROCESS') mgr_apprv_lst,
    (select ias2.user_key,
         ias2.activity_result_display_name,
         ias2.activity_begin_date,
         ias2.activity_end_date
    from wf_item_activity_statuses_v ias2,
    (select c2.invoice_num
         from ap_checks_all e2,
         ap_invoice_payments_all d2,
         ap_invoices_all c2
         where trunc(e2.check_date) between nvl(:From_Date, trunc(e2.check_date))
         and nvl(:To_Date, trunc(e2.check_date))
    and e2.org_id = 141
    and e2.void_date IS null
    and d2.check_id = e2.check_id
         and c2.invoice_id = d2.invoice_id) inv_lst2
    where ias2.item_type = 'APEXP'
    and ias2.user_key = inv_lst2.invoice_num
    and ias2.activity_name = 'AP_PAYABLES_APPROVAL_PROCESS') pbl_apprv_lst
    where
    trunc(e.check_date) between nvl(:From_Date, trunc(e.check_date))
    and nvl(:To_Date, trunc(e.check_date))
    and e.org_id = 141
    and e.void_date IS null
    and d.check_id = e.check_id
    and c.invoice_id = d.invoice_id
    and a.invoice_num = c.invoice_num
    and a.source = 'CREDIT CARD'
    and a.employee_id = nvl(:Emp_id,a.employee_id)
    and a.report_header_id = b.report_header_id
    and cc.trx_id = b.credit_card_trx_id
    and pap.person_id = a.employee_id
    and pap.effective_start_date <= trunc(sysdate)
    and pap.effective_end_date >= trunc(sysdate)
    and k.code_combination_id = b.code_combination_id
    and k.segment2 between nvl(:From_Cost_Center,k.segment2)
    and nvl(:To_Cost_Center,k.segment2)
    and substr(a.invoice_num,1,9) = l.invoice_num
    and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
    and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key

    Hi
    If I understood correctly your logic, and if the columns involved are of type varchar2, you can use the like operator:
    and a.invoice_num like l.invoice_num || '%'
    and c.invoice_num like mgr_apprv_lst.user_key  || '%'
    and c.invoice_num like pbl_apprv_lst.user_key  || '%'In this case, Oracle will be able to use the indexes. If they are numeric, you need to do something like:
    and a.invoice_num between l.invoice_num * 1000000
                                and l.invoice_num * 1000000 + 999999I hope this makes sense...
    Luis

  • Can we use Trunc,Substr in Excel templates

    Hi All,
    I have a date xml tag with value like "2012/04/01 00:00:00" i need to show this in excel output as "01-APR-2012".
    I am using Excel template, need your help to achieve the same.
    I tired to use Trunc,Substr,Format date but nothing is working.
    Please give me your valuable inputs to solve this issue.
    Thanks
    Rajehs

    Varma,
    Thanks for the reply, i have already checked the link but it doesn't have syntax to use Trunc,substr etc. functions.
    Also date in example is - "1996-02-03T00:00:00.000-07:00" , but in my case date format is different "2012/01/01 00:00:00".
    Thanks
    Rajesh

  • How to use the pps function from JCOP?

    Hi
    I'm trying to use the pps function from JCTerminal (JCOP API: [url http://www.cs.ru.nl/~woj/jcopapi/com/ibm/jc/JCTerminal.html#pps(int, int)]pps function ) to connect my client to a virtual card with a specific protocol (T=0).
    But I always got the error: "Protocol and parameter selection not supported by this terminal!"
    I've tried to make an ATR that support both protocol : [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]3B 90 95 80 81 1F C7 DC.
    I really don't know what value to put in the second parameter (baud rate), I've tried with 150000, which is in the range of the ATR but I'm not sure this is correct. And I could't find any example of it.
    I'm also not sure where to put the pps command, the specification say directly after a reset, so I tried this implementation:
    System.out.print("Start");
              readers = TerminalFactory.getDefault().terminals().list(State.CARD_PRESENT);
              //If no readers has a card it ends the process
              if(readers.isEmpty()){
                   System.out.println("\nNo card in the reader...");
                   return;
              System.out.println("\nReader Type: "+readers.get(0).toString());
              term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
              term.open();
              System.out.println("\nTerminal opened");
              //Getting the ATR
              atr = new ATR(term.waitForCard(2000));
              try {
                   term.pps(JCTerminal.PROTOCOL_T0, (int)150000);
              } catch (Exception e) {
                   e.printStackTrace();
              System.out.println("ATR: "+toHex(atr.getBytes()));
              //sending a data 11223344
              System.out.println("\nsending data: 11223344");
              byte[] responsesend = term.send(0,cmdsend,0,cmdsend.length);
              System.out.println("Response data is:" + toHex(responsesend));
              //close terminal
              term.close();
              System.out.println("\nTerminal closed");I've got this output on the console:
    <font size="2">StartReader Type: PC/SC terminal Virtual CAD Reader 0
    Terminal opened
    ATR: 3b 90 95 90 00 81 1f c7 cc
    sending data: 11223344
    <font color="red">Protocol and parameter selection not supported by this terminal!</font>
         at com.ibm.jc.JCTerminal.pps(Unknown Source)
         at com.test.essai.main(essai.java:46)
    </font>>
    And If I take a look at the data exchanged with the card:
    <font size="2">Running in Virtual Card mode...
    ATR: 3B909580811FC7DC
    Waiting for event (power: off, protocol: unknown/undefined)...
    Waiting for event (power: off, protocol: unknown/undefined)...
    Raw event data: 01
    Event: VCAD_EC_POWER_ON (0x01)
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_ON) ATR: 3b909580811fc7dc
    Raw reply data: 003b909580811fc7dc
    Sending reply...
    Waiting for event (power: on, protocol: unknown/undefined)...
    Waiting for event (power: on, protocol: unknown/undefined)...
    Raw event data: 06ff11957b
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: ff11957b
    Accepting any PPS request parameters: Protocol: t=1; FI=9, DI=5
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: ff11957b
    Raw reply data: 00ff11957b
    Sending reply...
    </font>>
    This (above) is the PPS command but not from the PPS function, it is always sent with protocol T=1
    <font size="2">Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0501
    Event: VCAD_EC_SET_PROTOCOL (0x05) Protocol: t=1
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_SET_PROTOCOL)
    Raw reply data: 00
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0600c10120e0
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00c10120e0
    Handling protocol-specific command...
    Protocol block:
    NAD: 0x00
    PCB: 0xc1 (T1_S_BLOCK); S-Block type: T1_SBT_IFS_REQ
    LEN: 1
    INF:
    IFS: 20
    EDC: 0xe0
    Changing IFS(other) from 32 to 32
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00e10120c0
    Raw reply data: 0000e10120c0
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0600001300a404000d54657374436c69656e7441707000f0
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00001300a404000d54657374436c69656e74
    41707000f0
    Processing app. command...
    App. block:
    NAD: 0x00
    PCB: 0x00 (T1_I_BLOCK); Seq. #: 0; More data: 0
    LEN: 13
    INF:
    00a404000d54657374436c69656e7441707000
    EDC: 0xf0
    cmd name: N/A (class #4)
    cmd: 00a40400 0d 54657374436c69656e74417070 70
    Responding with the reversed command data, SW is hardcoded to 90<INS>
    rsp: 707041746e65696c4374736554 90a4
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00000f70704
    1746e65696c437473655490a475
    Raw reply data: 0000000f707041746e65696c437473655490a475
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 060040041122334400
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 0040041122334400
    Processing app. command...
    App. block:
    NAD: 0x00
    PCB: 0x40 (T1_I_BLOCK); Seq. #: 1; More data: 0
    LEN: 4
    INF:
    11223344
    EDC: 0x00
    cmd name: N/A (class #1)
    cmd: 11223344
    Responding with the reversed command data, SW is hardcoded to 90<INS>
    rsp: 9022
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 0040029022f
    0
    Raw reply data: 000040029022f0
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 03
    Event: VCAD_EC_POWER_OFF (0x03)
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_OFF)
    Raw reply data: 00
    Sending reply...
    Waiting for event (power: off, protocol: unknown/undefined)...
    </font>>
    If someone know how to use this function or have any advice to help me to select a specific protocol with Jcop API, please let me know.
    If you you need any more information don't hesitate to ask.
    Best regards
    Edited by: Cyril on Sep 22, 2011 9:54 AM

    -1
    I'm using a virtual terminal (windows driver), and I don't see how I could turn off the Auto-pps. I've also tried with a real reader and a card and I have the same error.
    -2
    I've tried value in the range of the atr (based on this analysis: [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc ). But I don't know if only I value of baud-rate is possible in the range. Anyway I just would like to change the protocol, not the baud-rate.
    -3
    I've already tried to call pps function before, after the first reset, or with another reset later and I always got the same thing.
              term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
              term.open();
              System.out.println("\nTerminal opened");
              //Getting the ATR
              atr = new ATR(term.waitForCard(2000));
              System.out.println("ATR: "+toHex(atr.getBytes()));
              jcard = new JCard(term,atr,0);
              jcard.reset();          
              try {
                   term.pps(JCTerminal.PROTOCOL_T0, (int)312500);
              } catch (Exception e) {
                   e.printStackTrace();
              }The same pps is always send after each reset...

  • Substr function problem in oracle

    my requirement is that i am writing the stored procedure in which use
    *substr( source_string, start_position, [ length ] )*
    my 1 requirement
    i have i problem that the source_string is dynamically being passed as a parameter into the stored procedure
    means its length can vary
    and start_position is dynamically being passed as a parameter into the stored procedure should be that is should start from start of the sting and it can also vary
    my 2 requirement
    as in SQL Server we have left and Right function
    if we use left like this
    this is code from SQL Server
    note: in SQL Server left function Returns the left part of a character string with the specified number of characters.
    *@FinalCode = left(@TempCode,Len(@TempCode)-1)*
    *@FinalCode : this user declared local variable in stored procedure*
    *@TempCode:this is the dynamic string i am passing in stored procedure*
    when we use left it starts the reading string from left side
    note: in SQL Server right function Returns the right part of a character string with the specified number of characters.
    Set @FinalCode = Right(@FinalCode,len(@FinalCode)-1)
    when we use Right it starts the reading string from Right side
    my requirement is how to do this oracle as i am new to oracle 10g with the use of
    *substr( source_string, start_position, [ length ] )*
    Edited by: user21354 on Feb 8, 2011 4:06 AM

    when we use Right it starts the reading string from Right sideStart from left:
    SQL> select substr('abc', 1, 1) from dual;
    S
    aStart from right:
    SQL> select substr('abc', -1, 1) from dual;
    S
    c

  • Illegal use of nonvirtual function call

    I'm trying to run this program....
    import java.io.*;
    import java.util.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import sun.net.nntp.*;
    import lotus.domino.*;
    public class WriteNewsFile implements Constants{
         private Store store;
         private Database db;
    public Store createNNTPConnection(String host, String protocol) throws Exception{
    // Create empty properties
    Properties props = new Properties();
    // Get session
    javax.mail.Session session = javax.mail.Session.getInstance(props, null);
    // Get the store
    Store store = session.getStore(protocol);
    store.connect(host, null, null);
    return store;
    public Vector getForumNames(String root) throws Exception {
    Vector result = new Vector();
    NntpClient nc = new NntpClient(NNTP_HOST);
    String line;
    nc.serverOutput.println(NNTP_COMMAND_LIST_ACTIVE);
    BufferedReader br = new BufferedReader(new InputStreamReader(nc.serverInput));
    while ((line = br.readLine()) != null) {
    if (line.equals("."))
    break;
    if (line.startsWith(root)) {
    result.add(line.substring(0, line.indexOf(" ")));
    nc.closeServer();
    return result;
    private void init(String root) throws Exception {
    Vector forums = getForumNames(root);
    for (Enumeration e = forums.elements(); e.hasMoreElements();) {
         System.out.println(readWriteNewsgroup((String)e.nextElement()));
         System.gc();
    public static void main(String args[]) {
         WriteNewsFile wns = new WriteNewsFile();
         try{
              wns.db = wns.openNotesDB(DOMINO_HOST, DOMINO_USER, DOMINO_PASSWD,
    DOMINO_DB);
              wns.store = wns.createNNTPConnection(NNTP_HOST, NNTP);     
              //wns.init("forums.software.");
              wns.init("forums.hardware.");
              //wns.init("forums.services.");
              wns.store.close();
         }catch(Exception e){
              e.printStackTrace();
    * Insert the method's description here.
    * Creation date: (12/10/2001 9:51:20 AM)
    * @param s java.lang.String
    public Database openNotesDB(String host, String user, String passwd, String dbName) throws
    NotesException {
    lotus.domino.Session session =
    NotesFactory.createSession(host, user, passwd);
    db = session.getDatabase(session.getServerName(), dbName);
    if (db == null)
         throw new NotesException();
    else
         return db;
    public String readWriteNewsgroup(String newsgroup) throws Exception {
    // Get folder
    Folder folder = store.getFolder(newsgroup);
    folder.open(Folder.READ_ONLY);
    // Get directory
    Message messages[] = folder.getMessages();
    for (int i = 0, n = messages.length; i < n; i++) {
    //System.out.println( i + ": " + messages.getFrom()[0] + "\t" +
    messages[i].getSubject());
    Document doc = db.createDocument();
    doc.replaceItemValue(MESSAGE_NUMBER,new Integer(messages[i].getMessageNumber()));
    doc.replaceItemValue(MESSAGE_ID, messages[i].getHeader(MESSAGE_ID)[0]);
    doc.replaceItemValue(DATE, messages[i].getReceivedDate());
    doc.replaceItemValue(FROM, messages[i].getFrom()[0].toString());
    doc.replaceItemValue(SUBJECT, messages[i].getSubject());
    doc.replaceItemValue(NEWSGROUPS, messages[i].getHeader(NEWSGROUPS)[0]);
    doc.replaceItemValue(ORGANIZATION, messages[i].getHeader(ORGANIZATION)[0]);
    RichTextItem rtitem = doc.createRichTextItem(BODY);
    try{
         rtitem.appendText(messages[i].getContent().toString());
    }catch(UnsupportedEncodingException e){
                   System.out.println("Could not convert body to String");
    //rtitem.recycle();                                   
    if (!doc.save())
    System.out.println("Did not save the document");      
    // Close connections and files
    folder.close(false);
    return newsgroup;
    but getting this runtime error.....
    C:\$user\java>java WriteNewsFile
    Exception in thread "main" java.lang.VerifyError: (class: com/ibm/CORBA/iiop/Gen
    ericServerSC, method: dispatch signature: (Lcom/ibm/CORBA/iiop/IIOPInputStream;L
    com/ibm/CORBA/iiop/IIOPOutputStream;)V) Illegal use of nonvirtual function call
    at java.lang.Class.forName1(Native Method)
    at java.lang.Class.forName(Class.java:134)
    at com.ibm.CORBA.iiop.ORB.registerSubcontracts(ORB.java)
    at com.ibm.CORBA.iiop.ORB.<init>(ORB.java)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:254)
    at org.omg.CORBA.ORB.create_impl(ORB.java:306)
    at org.omg.CORBA.ORB.init(ORB.java:355)
    at lotus.domino.cso.Session.OREFtoSession(Session.java:703)
    at lotus.domino.cso.Session.<init>(Session.java:57)
    at lotus.domino.cso.Session.createSession(Session.java:36)
    at lotus.domino.NotesFactory.createSession(NotesFactory.java:67)
    at WriteNewsFile.openNotesDB(WriteNewsFile.java:88)
    at WriteNewsFile.main(WriteNewsFile.java:66)
    and don't understand the nature of the error...... Can anyone help or direct me to some information that might help me understand?
    Thanks,
    Heather

    you have used a method that was implemented in JRE1.2 -- IE's native JVM 1.1.4 or 1.1.5 . You can do one of two things:
    1) convert your html file to make it use a new Java plug-in, or
    2) change your code to call a comparble method that is available before 1.2
    V.V.

Maybe you are looking for

  • Bluetooth headset setup in infinite loop

    I have been trying to pair my Bluespoon AX2 with my Macbook pro. Every time I go through the process of finding the headset, entering the access key, and then my mac goes into an infinite loop while it is "Gathering additional information about your

  • Pricing item 20 based on material of item 10 - can this work?

    I want to determine a price for line item 20 based on the material# of line item 10. If item 10 material = 123 and    item 20 material = abc,       item 20 price = $100 and because item 10 material = 123, discount = 10%. How can I do this?  I'm willi

  • HT1338 Help Please! WON'T UPDATE!!!!!

    on my mac, i can't do this! I don't even have the app store on my mac! I do the software update and it says no updates available but it is in Version: 10.6.8 i think... i need to update it and it wonk work PLEASE HELP! It is the earlyier version of t

  • JRE for various Unix flavors?

    I'm writing a Java application (no browsers) and I'd like it to be able to run on any platform/OS. I see that there are JRE implementations for Windows, Solaris, and Linux. Where do I get JRE's for other flavours of Unix (e.g. SCO). Thanks, Gary

  • Please I want to open network

    Phone Broken iPhone on existing networks in the Middle East