Using unmanaged ctAPI Library always get wrong results

Hi, My code is as below:
public void Init()
IntPtr hCTAPI = CTAPI.ctOpen(null, "u1", "1", 2);
TestMe(hCTAPI);
[DllImport(@"C:\Program Files (x86)\Schneider Electric\Vijeo Citect 7.10\Bin\ctapi.dll", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern IntPtr ctOpen(string sComputerName, string sUsername, string sPassword, UInt32 nMode);
[DllImport(@"C:\Program Files (x86)\Schneider Electric\Vijeo Citect 7.10\Bin\ctapi.dll", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern bool ctTagRead(IntPtr hCTAPI, [MarshalAs(UnmanagedType.LPStr)] string tag, [MarshalAs(UnmanagedType.LPStr)] System.Text.StringBuilder value,
int length);
public static void TestMe(IntPtr ip)
var tag = "tag1";
var tagPtr =
Marshal.StringToHGlobalAnsi(tag);
System.Text.StringBuilder vsl = new StringBuilder(20);
bool b = ctTagRead(ip, tag, vsl, 20);//, tagValueItemsPtr);
signature of ctTagRead is as below:
extern    BOOL    CTAPICALL    ctTagRead(HANDLE,LPCSTR,LPSTR,DWORD);
bool b is always false. I dont know what to do!
EDIT:
I used GetLastError Function and I found out there is a "No connection could be made because the target machine actively refused it" error. but I am trying to connect to citect on my own computer which has an installed and working citect on it.

Hi, My code is as below:
public void Init()
IntPtr hCTAPI = CTAPI.ctOpen(null, "u1", "1", 2);
TestMe(hCTAPI);
[DllImport(@"C:\Program Files (x86)\Schneider Electric\Vijeo Citect 7.10\Bin\ctapi.dll", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern IntPtr ctOpen(string sComputerName, string sUsername, string sPassword, UInt32 nMode);
[DllImport(@"C:\Program Files (x86)\Schneider Electric\Vijeo Citect 7.10\Bin\ctapi.dll", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern bool ctTagRead(IntPtr hCTAPI, [MarshalAs(UnmanagedType.LPStr)] string tag, [MarshalAs(UnmanagedType.LPStr)] System.Text.StringBuilder value,
int length);
public static void TestMe(IntPtr ip)
var tag = "tag1";
var tagPtr =
Marshal.StringToHGlobalAnsi(tag);
System.Text.StringBuilder vsl = new StringBuilder(20);
bool b = ctTagRead(ip, tag, vsl, 20);//, tagValueItemsPtr);
signature of ctTagRead is as below:
extern    BOOL    CTAPICALL    ctTagRead(HANDLE,LPCSTR,LPSTR,DWORD);
bool b is always false. I dont know what to do!
EDIT:
I used GetLastError Function and I found out there is a "No connection could be made because the target machine actively refused it" error. but I am trying to connect to citect on my own computer which has an installed and working citect on it.
what happens if you use "localhost" as the machine name rather than the loopback IP address?
Cap'n

Similar Messages

  • When I make sincronization my photos from PC to IPhone using ITunes why I always get a duble copy of folders wit photos ??

    When I make sincronization my photos from PC to IPhone using ITunes why I always get a duble copy of folders wit photos ??

    That is correct.
    I just explained thatto you.
    Thre are NOT duplicates.
    ALL photos synced to iphone will be in the "Photo mediateka".  You can ALSO access those exact same photos from you named folder. If you had mulitiple photos, then all of the photos would be in the "Photo mediateka" and you could also access the exact same pics from each of the folders.
    You do not have duplicates.  it is working exactly as it should.

  • I can't use FaceTime because I always get "cannot sign in at this time. Check your network connection and try again."  Help please.

    I can't use FaceTime because I always get the following message:  "Cannot sign in. Check your network connection and try again."  My connection is good.

    Check your timezone settings.
    I've seen numerous people passing with FaceTime & iMessage issues and almost always the problem was the time zone.
    For some odd reason sometimes the timezone sticks to Cupertino and Facetime & iMessage won't work.

  • When I send email out in Chinese from iPad,Receiver(PC)always  get wrong text

    When I send out a Email in Chinese to any person,they always receive wrong text .

    It is probably an encoding problem.  The only thing you can try is to switch the OS language between English and Chinese and see if it makes a difference.  Otherwise the recipient will have to adjust at their end.
    Send me a test message if you like so I can see what is happening (tom at bluesky dot org).

  • "FF is already running, but is not responding. To open a new window, you must first close existing FF, or restart your system. So have to use Int Exp Would like to talk about this, but always get the results that support is closed

    I prefer using Firefox, and do all the time. However, this used to happen occasionally, then go away. Now it is happening all the time.
    If I try to enter aol email, I receive the message: "Firefox is already running, but is not responding. To open a new window, you must first close the existing FF process, or restart your system.
    And I can find no way to close it when that happens.
    Would really like to have this solved. Do not believe it is a computer or internet problem - just had my computer repaired because of a faulty disc drive. It is a three year old Dell, with Windows XP

    See "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    *https://support.mozilla.com/kb/Firefox+hangs
    * http://kb.mozillazine.org/Profile_in_use
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • OBIEE 10g Getting wrong results when adding calculated columns to a report

    Hi,
    I'm experiencing a possible misbehaviour with OBIEE 10g (10.1.3.4.1).
    I have a simple report with a table. Columns are simply selected from dimensions and facts. In this case the generated query is:
    WITH
    SAWITH0 AS (select sum(T30604.TOTAL_TIME) as c1,
    sum(T30604.MATERIALS_QTT_COST) as c2,
    sum(T30604.AMNT) as c3,
    sum(T30604.QNTY) as c4,
    T30622.BRANCH_CODE as c5,
    T25064.SRP1_CODE as c6,
    T25064.SRP1_DESC as c7,
    T25064.SRP2_CODE as c8
    from
    THK_BRANCHES T30622,
    THK_ITEMS T25064,
    THK_INVENTORY_TRANSACTIONS T30604
    where ( T25064.ITEM_ID = T30604.ITEM_ID and T30604.BRANCH_ID = T30622.BRANCH_ID )
    group by T25064.SRP1_CODE, T25064.SRP1_DESC, T25064.SRP2_CODE, T30622.BRANCH_CODE)
    select distinct SAWITH0.c5 as c1,
    SAWITH0.c6 as c2,
    SAWITH0.c7 as c3,
    SAWITH0.c8 as c4,
    SAWITH0.c4 as c5,
    SAWITH0.c3 as c6,
    SAWITH0.c2 as c7,
    SAWITH0.c1 as c8,
    SAWITH0.c4 as c9,
    SAWITH0.c3 as c10,
    SAWITH0.c2 as c11,
    SAWITH0.c1 as c12,
    SAWITH0.c4 as c13,
    SAWITH0.c3 as c14,
    SAWITH0.c2 as c15,
    SAWITH0.c1 as c16,
    SAWITH0.c4 as c17,
    SAWITH0.c3 as c18,
    SAWITH0.c2 as c19,
    SAWITH0.c1 as c20
    from
    SAWITH0
    Results of this report / query are correct.
    I then add a simple calculation (subtraction between two fields). The generated query is:
    WITH
    SAWITH0 AS (select sum(T30604.MATERIALS_QTT_COST) as c1,
    sum(T30604.AMNT) as c2,
    T30622.BRANCH_CODE as c3,
    T25064.SRP1_CODE as c6,
    T25064.SRP1_DESC as c7,
    sum(T30604.TOTAL_TIME) as c8,
    sum(T30604.QNTY) as c11,
    T25064.SRP2_CODE as c12
    from
    THK_BRANCHES T30622,
    THK_ITEMS T25064,
    THK_INVENTORY_TRANSACTIONS T30604
    where ( T25064.ITEM_ID = T30604.ITEM_ID and T30604.BRANCH_ID = T30622.BRANCH_ID )
    group by T25064.SRP1_CODE, T25064.SRP1_DESC, T25064.SRP2_CODE, T30622.BRANCH_CODE),
    SAWITH1 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10,
    D1.c11 as c11,
    D1.c12 as c12
    from
    (select sum(SAWITH0.c1) over (partition by SAWITH0.c3) as c1,
    sum(SAWITH0.c2) over (partition by SAWITH0.c3) as c2,
    SAWITH0.c3 as c3,
    sum(SAWITH0.c1) over (partition by SAWITH0.c6, SAWITH0.c3) as c4,
    sum(SAWITH0.c2) over (partition by SAWITH0.c6, SAWITH0.c3) as c5,
    SAWITH0.c6 as c6,
    SAWITH0.c7 as c7,
    sum(SAWITH0.c8) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c8,
    sum(SAWITH0.c1) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c9,
    sum(SAWITH0.c2) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c10,
    sum(SAWITH0.c11) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c11,
    SAWITH0.c12 as c12,
    ROW_NUMBER() OVER (PARTITION BY SAWITH0.c3, SAWITH0.c12 ORDER BY SAWITH0.c3 ASC, SAWITH0.c12 ASC) as c13
    from
    SAWITH0
    ) D1
    where ( D1.c13 = 1 ) ),
    SAWITH2 AS (select sum(T30604.MATERIALS_QTT_COST) as c1,
    sum(T30604.AMNT) as c2
    from
    THK_INVENTORY_TRANSACTIONS T30604)
    select SAWITH1.c3 as c1,
    SAWITH1.c6 as c2,
    SAWITH1.c7 as c3,
    SAWITH1.c12 as c4,
    SAWITH1.c11 as c5,
    SAWITH1.c10 as c6,
    SAWITH1.c9 as c7,
    SAWITH1.c8 as c8,
    SAWITH1.c10 - SAWITH1.c9 as c9,
    SAWITH1.c11 as c10,
    SAWITH1.c10 as c11,
    SAWITH1.c9 as c12,
    SAWITH1.c8 as c13,
    SAWITH1.c11 as c15,
    SAWITH1.c10 as c16,
    SAWITH1.c9 as c17,
    SAWITH1.c8 as c18,
    SAWITH1.c11 as c20,
    SAWITH1.c10 as c21,
    SAWITH1.c9 as c22,
    SAWITH1.c8 as c23,
    SAWITH1.c5 as c26,
    SAWITH1.c4 as c27,
    SAWITH1.c2 as c28,
    SAWITH1.c1 as c29,
    SAWITH2.c2 as c30,
    SAWITH2.c1 as c31
    from
    SAWITH1,
    SAWITH2
    Results of this report / query are wrong: it seems as if some rows "disappear".
    If I delete the filter in SAWITH1 query above ( D1.c13 = 1 ) results are correct.
    Anyone experiencing the same problem? The strange thing is that I have a number of similar reports (on other subject areas) and everyting is working fine.
    Please also note that I don't want to add this kind of calculated items in the RPD (they can be simple calculations that are made on-the-fly).
    Any help would be greatly appreciated.
    Thanks a lot and regards,
    Cristina

    I have the same issue, everything OBIEE server generate query using ROW_NUMBER() over () function, it will hardcode Dx.cx = 1, this will cause issue if you have rows of the same distinct value, thus causing missing rows and the final results will be wrong.
    I have open a SR with Oracle Support since March 2011, but till today, they have not resolve the issue yet.
    Hope they solve the issue soon.
    Best Regards
    KT

  • Stateless EJB 3: update / query on same ejb-method get wrong results

    I have a JavaEE application using EJB3 Stateless and DAOs with JDBC statements, simple transfer objects for data.
    The EJB business method update some questionnaire structure, after that query on database for new questionnaire (need for get autogenerated ID's on subelements: questions, sections, ...), the ejb-method code look like:
    public Questionnaire modifyQuestionnaire(Questionnaire questionnaire) {
       QuestionnaireDAO dao = getQuestionnaireDAO();        
        // Update questionnaire info
       dao.modifyQuestionnaire(questionnaire);
       // Get new info
       Questionnaire newQuestionnaire = dao.getQuestionnaireById(questionnaire.getId());
       return newQuestionnaire;
    }The problem is: when invoke "getQuestionnaireById" method on DAO at this time, I get old information ... seems as if UPDATE operations executes on DAO not has been flushed.
    After EJB method finish, the information is up to date on physical database, and after that I query the questionnaire using the same DAO "getQuestionnaireById" method, and all is up to date ! ...
    When I'm wrong?, I'm using default transaction (required) on ejb, I get the JDBC connection from a DataSource using JNDI lookup to a Container managed connection pool, I close all connection and JDBC resources ... mmm I'm using "executeBatch" for updates/inserts.
    My system:
    AppServer: SJSAS PE 9
    Database: Postgresql 8.1
    JDBC Driver: 8.2dev Build 503
    O.S.: Linux Ubuntu Dapper Drake
    Thanks any help ! .. please.
    null

    There seem a Postgresql JDBC driver problem, I change datasourceclassname from
    org.postgresql.ds.PGSimpleDataSource to org.postgresql.xa.PGXADataSource (of course, resource type: javax.sql.XADataSource) and work fine.

  • How to use CONNECT BY LEVEL to get this result?

    Hi all,
    my DB version is 10gR2.
    here is the table and the data:
    create table t (from_dt date, to_dt date, eno varchar2(2), deptno varchar2(10));
    insert into T values (TO_DATE('2010-01-01','yyyy-mm-dd'),TO_DATE('2010-04-30','yyyy-mm-dd'),'A','DEPTA');
    insert into T valueS (TO_DATE('2010-05-01','yyyy-mm-dd'),TO_DATE('2010-12-31','yyyy-mm-dd'),'A','DEPTB');
    insert into T values (TO_DATE('2010-01-01','yyyy-mm-dd'),TO_DATE('2010-06-30','yyyy-mm-dd'),'B','DEPTA');
    insert into T valueS (TO_DATE('2010-07-01','yyyy-mm-dd'),TO_DATE('2010-12-31','yyyy-mm-dd'),'B','DEPTB');
    from_dt       to_dt           ENO   DEPTNO
    2010-01-01 2010-04-30  A     DEPTA
    2010-05-01 2010-12-31  A     DEPTB
    2010-01-01 2010-06-30  B     DEPTA
    2010-07-01 2010-12-31  B     DEPTBHere is the result I want:
    MONTH    ENO   DEPTNO
    2010-01    A      DEPTA
    2010-02    A      DEPTA
    2010-03    A      DEPTA
    2010-04    A      DEPTA
    2010-05    A      DEPTB
    ...............Here is what I came up with:
    select distinct ADD_MONTHS(TRUNC(FROM_DT,'MON'),level-1) as MONTHS,
           ENO,
           DEPTNO
    from (
        select FROM_DT, TO_DT, ENO, DEPTNO, ROUND(MONTHS_BETWEEN(TO_DT, FROM_DT)) as BET from T
    ) connect by level<=BET
    order by eno, deptno,months ;the problem with this is that, many duplicate rows are generated if I remove DISTINCT from the sql.
    and I don`t know how that happens? How CONNECT BY LEVEL, returns me so many duplicate rows?
    Anyone have any idea about this?
    And is there any other way to do this as well?
    Thanks

    In this case,model clause is one way :-)
    with t(from_dt,to_dt,eno,deptno) as(
    select date '2010-01-01',date '2010-04-30','A','DEPTA' from dual union
    select date '2010-05-01',date '2010-12-31','A','DEPTB' from dual union
    select date '2010-01-01',date '2010-06-30','B','DEPTA' from dual union
    select date '2010-07-01',date '2010-12-31','B','DEPTB' from dual)
    select *
      from t
    model
    partition by(RowNum as PID)
    dimension by(0 as soeji)
    measures(from_dt,to_dt,eno,deptno)
    rules iterate(100)
    UNTIL (add_months(from_dt[0],ITERATION_NUMBER+1) > to_dt[0])
    (from_dt[ITERATION_NUMBER]=add_months(from_dt[0],ITERATION_NUMBER),
    eno[ITERATION_NUMBER]=eno[0],
    deptno[ITERATION_NUMBER]=deptno[0])
    order by eno,from_dt;
    PID  SOEJI  FROM_DT   TO_DT     E  DEPTN
      1      0  10-01-01  10-04-30  A  DEPTA
      1      1  10-02-01  null      A  DEPTA
      1      2  10-03-01  null      A  DEPTA
      1      3  10-04-01  null      A  DEPTA
      3      0  10-05-01  10-12-31  A  DEPTB
      3      1  10-06-01  null      A  DEPTB
      3      2  10-07-01  null      A  DEPTB
      3      3  10-08-01  null      A  DEPTB
      3      4  10-09-01  null      A  DEPTB
      3      5  10-10-01  null      A  DEPTB
      3      6  10-11-01  null      A  DEPTB
      3      7  10-12-01  null      A  DEPTB
      2      0  10-01-01  10-06-30  B  DEPTA
      2      1  10-02-01  null      B  DEPTA
      2      2  10-03-01  null      B  DEPTA
      2      3  10-04-01  null      B  DEPTA
      2      4  10-05-01  null      B  DEPTA
      2      5  10-06-01  null      B  DEPTA
      4      0  10-07-01  10-12-31  B  DEPTB
      4      1  10-08-01  null      B  DEPTB
      4      2  10-09-01  null      B  DEPTB
      4      3  10-10-01  null      B  DEPTB
      4      4  10-11-01  null      B  DEPTB
      4      5  10-12-01  null      B  DEPTB

  • When I try to use "store locator", e.g., Eddie Bauer, I get no result with Firefox 4 on Mac OS. Chrome and Safari work OK.

    At various web sites, e.g., Eddie Bauer and Walmart, when I try to use their "store locator", I get no result.

    go to '''TOOLS '''then '''OPTIONS''' then '''ADVANCED''' then '''NETWORK tab''' then '''SETTINGS tab''' and select the options '''NO PROXY''' click '''OK''' and '''OK '''again in the next screen. With that you have disabled the proxy settings.
    ''if you like to not disable the proxy settings choose'' : '''Auto-detect proxy settings for this network''' (it is in the same session)
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Wrong results for context search on empty element tags

    I'm using Oracle DBMS 11.1 and 11.2 and created a context index on an XML column (section group: PATH_SECTION_GROUP).
    When entering a query like
    SELECT count(*) FROM my_table t WHERE contains (t.co_xml,'hasPath(/tag1/tag2)') > 0
    I get wrong results if tag2 is an empty element tag (<tag2/>) that appears somewhere within the
    XML instance, but NOT directly under tag1.
    E.g., the following XML instance is found (but shouldn't!):
    <a>
    <tag1>bla<tag3>bla</tag3></tag1>
    <tag4>bla<tag2/></tag4>
    </a>
    This seems to happen only for empty element tags. Is this a known bug and does anybody know a workaround?
    Thanks in advance for your help!
    Roman

    I am unable to reproduce the problem. Can you provide a copy and paste of an actual run, including create table, insert data, create index, and select, as I have done below?
    SCOTT@orcl_11g> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE     11.1.0.6.0     Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SCOTT@orcl_11g> create table my_table
      2    (co_xml     xmltype)
      3  /
    Table created.
    SCOTT@orcl_11g> insert into my_table values (
      2  xmltype ('<?xml version="1.0"?>
      3  <tag5>
      4    <tag1>bla<tag3>bla</tag3></tag1>
      5    <tag4>bla<tag2/></tag4>
      6  </tag5>'))
      7  /
    1 row created.
    SCOTT@orcl_11g> create index my_idx
      2  on my_table (co_xml)
      3  indextype is ctxsys.context
      4  parameters ('section group ctxsys.path_section_group')
      5  /
    Index created.
    SCOTT@orcl_11g> SELECT count(*)
      2  FROM   my_table t
      3  WHERE  contains (t.co_xml, 'hasPath (//tag1/tag2)') > 0
      4  /
      COUNT(*)
             0
    SCOTT@orcl_11g> SELECT count(*)
      2  FROM   my_table t
      3  WHERE  contains (t.co_xml, 'hasPath (//tag1/tag3)') > 0
      4  /
      COUNT(*)
             1
    SCOTT@orcl_11g>

  • Getting poor results with Refine Edge tool

    Not sure if anyone else has run into this issue. But after following numerous tutorials on lynda.com as well as tv.adobe.com and youtube, I just can't get good selection results using the Refine Edge tool in Photoshop CC and I'm convinced it's something I'm doing wrong, but I have no idea what.
    After downloading this Wikipedia image of Bismarck for a history documentary, I tried isolating the figure from the background using Refine Edge and keep getting poor results. Maybe it's my settings, I'm just not sure. But after painting over my edges, I end up with terrible results. Unfortunately, I'm getting poor results with other images as well. Can anyone venture to guess what I might be doing wrong? Thanks very much in advance.

    Hi ninose11,
    For this type of project and idea, I would recommend trying some of the magnetic lasso tool. The tool is located as the third tool in the toolbar (you should see a lasso or rope looking icon), hold down the icon and it should expand - then select the magnetic lasso tool. The magnetic lasso tool will allow you to scroll over the edge of his profile and it will automatically detect the outline edges. The slower you roll-over the shape the higher the accuracy will be. If the magnet is not detecting a particular edge or sharp corner (for example, the ear) you can manually drop points by simply right-clicking at any point during the selection. If the edge is too sharp, you can also create a light feather which will blend the edge softly (this should be located at the top).
    If this is unsuccessful still, you can try selecting by color, using the Magnetic Wand Tool (forth icon in the toolbar, again hold down for all options). Once you are using the magnetic wand tool, you should be able to select all the black areas of the background to delete. You can increase or decrease the tolerance to change the sensitivity of the selection.
    Hope this helps!

  • Simple query with like return wrong result

    Hi,
    I run simple query with like.
    If I use parameter I get wrong results.
    If I use query without parameter results are ok.
    My script:
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    -- drop table abcd;
    create table abcd (col1 varchar2(10));
    INSERT INTO ABCD VALUES ('122222');
    insert into abcd values ('111222');
    SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
    COL1
    122222
    *111222*
    select * from abcd where col1 like '12%'; -- result ok
    COL1
    122222
    I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    and query run in Oracle SQL Developer 3.1.07.

    Hi,
    welcome to the forum.
    When you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should specify exactly how you run your code.
    If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
    Session altered.
    SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    Session altered.
    SQL>
    SQL> -- drop table abcd;
    SQL> create table abcd (col1 varchar2(10));
    Table created.
    SQL>
    SQL> INSERT INTO ABCD VALUES ('122222');
    1 row created.
    SQL> insert into abcd values ('111222');
    1 row created.
    SQL>
    SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
    SP2-0552: Bind variable "1" not declared.
    SQL>
    I got this error. So I wonder how you set value 12%
    Please specify exactly how you run your test as we cannot reproduce your problem.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How I can change this query? to get the results I want

    This query
    select
    SHRTGPA_pidm,
    SZSTCLA_TERM_CODE,
    SHRTGPA_GPA_HOURS
    from  szstcla,SHRTGPA
    where szstcla_pidm = 74246
    and SHRTGPA_pidm = szstcla_pidm
    and SZSTCLA_TERM_CODE <> SZSTCLA_TERM_CODE_MATRIC
    and SHRTGPA_TERM_CODE = SZSTCLA_TERM_CODEreturns
    74246     201020     4
    74246     201120     4
    74246     201110     4
    74246     201210     4
    74246     201220     4 I want to aggregate so the query will return
    74246 201020     4
    74246 201120     8
    74246 201110     12
    74246 201210     16201220     20

    Hi,
    So, instead of shrtgpa_gpa_hours, you want a cumulative total of shrtgpa_gpa_hours, adding up all the previous values.
    That's a job for the analytic SUM function:
    select
    SHRTGPA_pidm,
    SZSTCLA_TERM_CODE,
    SUM (SHRTGPA_GPA_HOURS) OVER (ORDER BY x)  as running_shrtgpa_gpa_hours     -- *****  CHANGED  *****
    from  szstcla,SHRTGPA
    where szstcla_pidm = 74246
    and SHRTGPA_pidm = szstcla_pidm
    and SZSTCLA_TERM_CODE  SZSTCLA_TERM_CODE_MATRIC
    and SHRTGPA_TERM_CODE = SZSTCLA_TERM_CODEwhere x is the expression (or list of expressions) that determines what are the "previous" rows.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Can't get iPhone 4s out of recovery mode and always get error 40 during restore

    I tried updating to ios 6.1.2 and I left it for a while since I had to do some stuff. When I came back, my iPhone is in recovery mode and I can't get it to restore using itunes. I always get error 40. I tried restoring on a different pc but it's still a no go. Is it possible that this has something to do with the hardware? I've already looked up possible solutions but my iphone's still in recovery mode. I never had this phone opened nor did I attempt to jailbreak it or anything. I tried asking my carrier for assistance but they're charging me for repairs. The fee's pretty expensive.

    Read here:
    http://support.apple.com/kb/ts3694#error40
    Usually caused by security software on your computer.

Maybe you are looking for

  • Is it possible to map the cmp fields of the entity bean with out dictionary

    Dear sirs, I have created the EJB project module and WEB Module. Now i have to map the CMP fields of the entity bean to the underlying table. Is it possible to map the cmp fields of the entity bean with out java dictionary? If yes how can we do that.

  • High cpu usage for garbage collection (uptime vs total gc time)

    Hi Team, We have a very high cpu usage issue in the production. When we restart the server, the cpu idle time would be around 95% and it comes down as days goes by. Today idle cpu is 30% and it is just 6th day after the server restart. Environemnt de

  • Problem with PDF Reader and Create PDF plugins

    Hello, I use Internet Explorer Nine. The Adobe PDF Reader plugin disappeared from my browser. When I look at the listing of my add-ons, Adobe PDF reader appears in the list of all add-ons but not in the list of currently loaded add-ons. I have tried

  • What to do while I wait for the new battery?

    The recall website says to not use the old battery, but it's going to take 4-6 weeks to get a new one, so what should I do to cover up the empty spot on the bottom of my computer? I thought about using the battery and just making sure the computer's

  • IPhoto book not correctly printed.

    Two books ordered last week just arrived. Apparently on a random basis, pictures are missing and I have around 15 white pages (only some photo captions appearing). Within iPhoto (latest version) everything looks fine. Ordering process went smoothly a