ERROR   OGG-00146  VAM function VAMInitialize returned unexpected

I am configuring Golden Gate for MySQL and when i start extract it says extract started successfully but when i see its log file then i see this
2011-03-04 01:55:10 ERROR OGG-00146 VAM function VAMInitialize returned unexpected
result: error 600 - VAM Client Report <CAUSE OF FAILURE : Log index file
does not exist,please check if binary logging is enabled - /var/lib/mysql//Hassan-bin.index
WHEN FAILED : While initializing binary log configuration
WHERE FAILED : MySQLBinLog Reader Module
CONTEXT OF FAILURE : No Information Available!>.
2011-03-04 01:55:10 ERROR OGG-01668 PROCESS ABENDING.
then i changed MySQL bin log file name format to what it is saying and restarted MySQL service and again tried to start extract process. Now I am getting this error which is not clear to me
011-03-04 23:13:14 ERROR OGG-00146 VAM function VAMInitialize returned unexpected
result: error 600 - VAM Client Report <CAUSE OF FAILURE : Position time is
prior then earliest time available in the log : Earliest time available in the
log is 2011-03-04 23:08:25
WHEN FAILED : SetInitialPosition by time stamp
WHERE FAILED : MySQLBinLog Reader Module
CONTEXT OF FAILURE : No Information Available!>.
2011-03-04 23:13:14 ERROR OGG-01668 PROCESS ABENDING.
any one can help me out why this is occuring

I have just deleted all extract & replicat and reconfigured , now things are working fine.

Similar Messages

  • Error: OGG-00146 - error 600 - Failed to connect to mysql database

    Dear All,
    I am replicating Data from MySQL to Oracle.
    Version of my MySQL is Server version: 5.5.19 MySQL Enterprise Server - Advanced Edition
    Version of Oracle is : Oracle 11gR2
    My extract is giving the following error and I am unable to identify the problem:
    *2012-12-25 14:18:48 ERROR OGG-00146 Oracle GoldenGate Capture for MySQL, netfors.prm: VAM function VAMInitialize returned unexpected result:*
    error 600 - VAM Client Report <CAUSE OF FAILURE : Failed to connect to mysql database WHEN FAILED : While initializing mysql context WHERE FAILED :
    MySQLBinLog Reader Module CONTEXT OF FAILURE : No Information Available!>
    Following are the contents of my /etc/odbc.ini file
    *[netfors]*
    Driver = /usr/lib/libmyodbc3.so
    Description = Connector/ODBC 3.51 Driver DSN
    Server = 10.168.20.226
    Port = 6629
    User = replication
    Password = ******
    Database = netfors
    Option = 3
    Socket = /tmp/mysql_sandbox5519.sock
    When i isql -v netfors replication ***** *
    it say Connected!
    This is my extract:
    EXTRACT NETFORS
    DBOPTIONS HOST 10.168.20.226, CONNECTIONPORT 6629
    SOURCEDB [email protected]:6629, USERID replication, PASSWORD ******
    RMTHOST 10.168.20.31, MGRPORT 7809
    RMTTRAIL /u01/app/oracle/oradata/GG/dirdat/n1
    TRANLOGOPTIONS ALTLOGDEST /root/sandboxes/msb_5_5_19/data/mysql-bin.index
    TABLE netfors.syslog;
    Extract gets ABENDED
    Kindly help on this.
    Regards, Imran

    Got it solved some how, golden gate was trying to connect with default socket file.
    */tmp/mysql.sock*
    while my socket file was
    */tmp/mysql_sandbox5519.sock*
    I changed it to default and got rid of the error.
    Thanks for the help.
    Regards, Imran

  • Error MySQL to Oracle Replication   ERROR   OGG-00146 Failed to Query Meta

    Hello Guys,
    I have a configured replication between MySQL database and Oracle Database using Golden Gate.
    Extract data from MySQL is replicated to Oracle.
    MySQL is on Linux and version is 5.5
    Oracle is 11gR2 RAC on Linux (I am using one node for replication)
    When i start extract and replicat they works fine, but as soon as record is inserted in source database i.e MySQL extract ABENDED with this error in the log file:
    *2013-04-11 16:24:40 ERROR OGG-00146 Oracle GoldenGate Capture for MySQL, smpp7.prm: VAM function VAMRead returned unexpected result: error 600 - VAM Client Report* *<CAUSE OF FAILURE : Failed to Query Metadata from Table : smpp7.sent_sms WHEN FAILED : While Sending Insert and Delete Record WHERE FAILED : MySQLBinLog Reader Module*
    CONTEXT OF FAILURE : No Information Available!>.
    *2013-04-11 16:24:40 ERROR OGG-01668 Oracle GoldenGate Capture for MySQL, smpp7.prm: PROCESS ABENDING*
    This is my extract and replicat:
    Extract
    GGSCI>ADD EXTRACT SMPP7, TRANLOG, BEGIN NOW
    GGSCI>EDIT PARAMS SMPP7
    EXTRACT smpp7
    DBOPTIONS HOST 10.168.20.253, CONNECTIONPORT 14422
    SOURCEDB [email protected]:14422, USERID "*******", PASSWORD "*******"
    RMTHOST 10.168.20.31, MGRPORT 7809
    RMTTRAIL /u01/app/oracle/oradata/GG/dirdat/D2
    TRANLOGOPTIONS ALTLOGDEST /mysql/node3/data/mysql-bin.index
    TABLE smpp7.sent_sms;
    GGSCI>ADD RMTTRAIL /u01/app/oracle/oradata/GG/dirdat/D2, EXTRACT SMPP7, MEGABYTES 5
    GGSCI>INFO RMTTRAIL *
    GGSCI>START EXTRACT SMPP7
    Replicat
    GGSCI>ADD REPLICAT smpp7, EXTTRAIL /u01/app/oracle/oradata/GG/dirdat/D2, checkpointtable ggs_owner.checkpoint
    3) edit params smpp7
    REPLICAT SMPP7
    USERID *******, PASSWORD *******
    ASSUMETARGETDEFS
    HANDLECOLLISIONS
    SOURCEDEFS /u01/app/oracle/oradata/GG/dirdef/smpp7.def
    DISCARDFILE /u01/app/oracle/oradata/GG/dirrpt/smpp7.dsc, PURGE
    MAP "smpp7.sent_sms", TARGET MYSQL_SMPP7.sent_sms, COLMAP (usedefaults,COMPRESS_=compress,SERVICE=@STRCAT(service,"_sms"));
    GGSCI>START REPLICAT smpp7
    I have given full rights to MySQL user:
    GRANT ALL PRIVILEGES ON *.* TO '**********'@'localhost' IDENTIFIED BY 'kannel' WITH GRANT OPTION;
    GRANT ALL PRIVILEGES ON *.* TO '**********'@'10.168.20.253' IDENTIFIED BY 'kannel' WITH GRANT OPTION;
    Can you please help me to get through this problem.
    Regards, Imran

    Hi,
    I have the same error between two Mysql 5.5.
    I have added this line in the extact param file :
    vam params (arliberror -14 warn)
    And on my replicate param file :
    map "aix"."etat", target "FR"."etat", REPERROR (-1403, EXCEPTION);
    It looks working better.
    But I can't modify my max_binlog_size to 4069 (4k). It make have to much file and slow my system.

  • Error while calling the function which returns SQL Query!!!

    Hi,
    I have a Function which returns SQL query. I am calling this function in my APEX report region source.
    The query is dynamic SQL and its size varies based on the dynamic "where clause" condition.
    But I am not able to execute this function.It gives me the following error in APEX region source.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Even in SQL* Plus or SQL developer also same error .
    The length of my query is more than 4000. I tried changing the variable size which holds my query in the function.
    Earlier it was
    l_query varchar2(4000)
    Now I changed to
    l_query varchar2(32767).
    Still it is throwing the same error.
    Can anybody help me to resolve this.???
    Thanks
    Alaka

    Hi Varad,
    I am already using 32k of varchar2. Then also it is not working.
    It is giving the same error. I think there is something to do with buffer size.
    My query size is not more than 4200. Even if i give 32k of varchar2 also buffer is able to hold only 3997 size of the query only.
    Error is
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Tried CLOB also. It is not working.
    Any other solution for this.
    Thanks
    Alaka

  • ERROR   0GG-00146 FOR SQLSERVER 2000

    Hi
    I used oggs 11g for sqlserver 2000 on WinXp sp3,
    when I started the extract named exbs
    it can be a running stutas ;
    my parameter file setting are :
    extract exbs
    seTenv (ODBCINI=C:\WINDOWS\ODBC.INI)
    SOURCEDB MSTZSW , USERID SA , PASSWORD oracle
    RMTHOST 127.0.0.1 , MGRPORT 7810
    RMTTRAIL ./DIRDAT/bs
    table dbo.* ;
    after a lot of minute passed , it will be abending ;
    the report are the folloowing :
    ====================================
    Database Version :
    Microsoft SQL Server
    verison 08.00.0194
    odbc version 03.52.0000
    database language and character set :
    Warning : unable to detemine the application and database codepage settings.
    Please refer to user manual for more information .
    2010-12-29 14:24:23 INFO OGG-01226 Socket buffer size set to 27985 (flush size 27985 ) .
    ............... OGG-01055 Recovery initilazation completed for target file ./dirdat/bs000003 , at RBA 812.
    ................................. OGG-01478 Output file ./dirdat/bs is using format RELEASE 10.4/11.1.
    ................................... OGG-01026 Rolling over remote file ./dirdat/bs000004.
    ................................... OGG-01053 Recovery i completed for target file ./dirdat/bs000003 , at RBA 812.
    ................................... OGG-01057 Recovery completed for all targets.
    ................................... OGG-00182 VAM API running in single-threaded mode.
    ................................... OGG-01515 Positioning to begin time..........
    Source Context :
    SourceModule : [ggvam.gen]
    SourceID : [../gglib/ggvam/cvamgen.cpp]
    SourceFuntion : [com_goldengate_vam: : CVamGen::vamInitialize ]
    SourceLine : [418]
    time ERROR OGG-00146 VAM funtion VAMInitialize returnde unexpected resutl : error 600 -VAM Client Report <MSSqlVam :<1> [CLogReader ::Open] [DBNETLIB][ConnectionOpen  (Connect()).]SQL Server does not exists or denied . Error (-2147467259) : [DBNETLIB] [ConnectionOpen  (Connect()).]SQL Server does not exists or denied . >.
    tmie ERROR OGG-01668 PROCESS ABENDING.
    Hao can I do to solution this ERROR ,
    or What is the reason .
    Can some body help me.
    I can ensure the odbc can Connectivity by use sourcedb mstzsw , userid sa , password oracle

    the reason that my friend told me is :
    can not telnet port 1433;
    for my question , the windows firewall or wall of fire is closed ,
    and my sqlserver 2000's version is 8.00.194 ,
    till I update the sqlserver's version to 8.00.2039 (sp4)
    this question is solutioned ;
    forgive the low-level of my English Language skill ;

  • Unable to process function body returning query

    I have a table called ACCESS. The table has two columns, PERSON_ID NUMBER (holds employee reference) and SQL_QUERY VARCHAR2(4000) (holds query 'SELECT COL1, COL2, COL3 FROM APEX_TABLE;' )
    I am in the process of generating SQL Report. In the Create SQL Report (Page > SQL Report >Create SQL Report),
    I want to dynamically fetch the SQL_QUERY from the ACCESS table something like the below one.
    DECLARE
    strSql VARCHAR2(4000);
    BEGIN
    SELECT SQL_QUERY INTO strSql FROM ACCESS WHERE PERSON_ID=100;     
    RETURN strSql;
    END;
    I get the error Unable to process function body returning query when I try to run the page.
    However if I hardcode the query in the PL/SQL block, it works for example:
    DECLARE
    strSql VARCHAR2(4000);
    BEGIN
    strSql := 'SELECT COL1, COL2, COL3 FROM APEX_TABLE';
    RETURN strSql;
    END;
    How to resolve this?
    Regards,
    Anand

    Hi Denes,
    In your demo application you are using the below query (function returning sql). Is it possible to store this query as VARCHAR2 in a database table and query the table to return the QUERY ('SELECT deptno....')? Can you explain me with an example?
    DECLARE
    q VARCHAR2 (1000);
    BEGIN
    q := q || 'SELECT deptno, DECODE(deptno, ';
    q := q || '10, ''&lt;img src="#IMAGE_PREFIX#bullet1.gif" >'', ';
    q := q || '20, ''&lt;img src="#IMAGE_PREFIX#bullet2.gif" >'', ';
    q := q || '30, ''&lt;img src="#IMAGE_PREFIX#bullet3.gif" >'', ';
    q := q || '40, ''&lt;img src="#IMAGE_PREFIX#bullet4.gif" >'') ';
    q := q || 'image, dname FROM DEPT ';
    q :=
    q
    || 'WHERE CASE WHEN TO_NUMBER (:p1_dept) != -1 THEN deptno '
    || 'ELSE 1 END = CASE WHEN TO_NUMBER (:p1_dept) != -1 '
    || 'THEN TO_NUMBER (:p1_dept) ELSE 1 END';
    RETURN q;
    END;
    Thanks
    Anand

  • UDPWrite in a loop. "A Windows Sockets function call returned an unexpected error."

    Hello together,
    i use UDP Support Library in NI CVI 9.0. When i wait for receiving a packet at the pc to send then a packet from the pc, the functions UDPRead and UDPWrite work fine. If i want to test the maximum throughput, i put the UDPWrite in a loop, but then an error occurs. It is "kUDP_UnexpectedWinsockError"
    Error Popup:
    "NON-FATAL RUN-TIME ERROR:   "main.c", line 53, col 22, thread id
    0x00000C18:   Library function error (return value == -6822
    [0xffffe55a]). A Windows Sockets function call returned an unexpected
    error."
    Line 53:
    status = UDPWrite (channel, 60100, "192.168.1.10", pOutputBuffer, 1458);
    the whole loop:
    while(1)
    status = UDPWrite (channel, 60100, "192.168.1.10", pOutputBuffer, 1458);
    counter++;
    if(counter>50)
    break;
    else{;}
    The error occurs after 3-16 packets have been sent. If i step through the programm, no error occurs. So i guess its because the UDPWrite command is invoked too fast. pOutputBuffer has static data. I could use a delay in the loop, but then i dont know how to configure for maximal throughput.
    Any ideas how to avoid this error?
    Regards Florian

    Hello and thank you for your answer. Sorry that i reply a month later.
    I dont know what you mean by "let 'er rip approach". Do you mean something like:
    status = UDPWrite (channel, 60100, "192.168.1.10", pOutputBuffer, 1458);
    if(status==0)
     counter++;
    else
      Delay(0.00005);
    I did not yet try to put the packet number in the payload, but there is just a 30 cm crossover cable between the two devices, no switch, no router. So the sequence should not be interruptet. And even if they arrive in chaos, i dont mind.
    I have contacted the NI support 2 weeks ago, but no response yet.
    I did some tests with a delay between the execution of UDPWrite(). The code:
    float time = 0.0;
     for(i = 1; i < 1000; i++)
      status = UDPWrite (channel, 60100, "192.168.1.10", pOutputBuffer, 1458);
      time = 1.0 / i;
      Delay(time);
    The results:
    For i between 1 and 1000: no error, the speed of the last ten packets was about 6.5 MBit/s
    For i between 1000 and 2000: error occured at i = 1585 (variable time in Delay was 0.0006313), the speed of the last ten packets was about 8 MBit/s
    Then i put some constant values in Delay and ran 100 UDPWrite iterations:
    Delay(0.0006): 7.48 MBit/s
    Delay(0.0001): 10.7 MBit/s
    Delay(0.00001): error occured at i=31, speed of 31 packets was 12.0 MBit/s
    Delay(0.00008): 100 of 100 packets, speed 10.9 MBit/s
    Delay(0.00005): error at i=41, speed of 41 packets 11.1 MBit/s

  • PL/SQL function body returning SQL - report error:ORA-01403: no data found

    Hi,
    I am working on Application Express 4.0.2.00.06, and 11G database.
    I have a problem with classic report area of type - PL/SQL function body returning SQL query. Query works if I define region area as - Use Generic Column Names (parse query at runtime only), and does not when I define it - Use Query-Specific Column Names and Validate Query.
    I am getting error:
    report error:ORA-01403: no data found
    This is my query that is returned from function, and displayed with htp.p, and it works ok and returns data in SQL Developer and SQL Workshop (in Apex).
    <code>
    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA
    </code>
    As you can see, I even tried with workaround that I found on the previous post on the forum, and that is to put /* select 1 from dual */ to start query.
    Any help would be appriciated.

    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA

  • PL/SQL function body returning SQL query - ORA-06502: PL/SQL: numeric or value error

    I'm attempting to dynamically generate a rather large SQL query via the "PL/SQL function body returning SQL query" report region option.  The SQL query generated will possibly be over 32K.  When I execute my page, I sometimes receive the "ORA-06502: PL/SQL: numeric or value error" which points to a larger than 32K query that was generated.  I've seen other posts in the forum related to this dynamic SQL size limitation issue, but they are older (pre-2010) and point to the 32K limit of the DNS (EXECUTE IMMEDIATE) and DBMS_SQL.  I found this post (dynamic sql enhancements in 11g) which discusses 11g no longer having the 32K size limitation for generating dynamic SQL.  Our environment is on 11gR2 and using ApEx 4.2.1.  I do not know which dynamic SQL method -- DNS or DBMS_SQL -- ApEx 4.2.1 is using.  Can someone clarify for me which dynamic SQL method ApEx uses to implement the "PL/SQL function body returning SQL query" option?
    As a test, I created a page on apex.oracle.com with a report region with the following source:
    declare
      l_stub varchar2(25) := 'select * from sys.dual ';
      l_sql  clob := l_stub || 'union all ';
      br     number(3) := 33;
    begin
      while length ( l_sql ) < 34000 loop
        l_sql := l_sql || l_stub || 'union all ';
      end loop;
      l_sql := l_sql || l_stub;
      for i in 1 .. ceil ( length ( l_sql ) / br ) loop
        dbms_output.put_line ( dbms_lob.substr ( l_sql, br, ( ( i - 1 ) * br ) + 1 ) );
      end loop;
      return l_sql;
    end;
    The dbms_output section is there to be able to run this code in SQL*Plus and confirm the size of the SQL is indeed larger than 32K.  When running this in SQL*Plus, the procedure is successful and produces a proper SQL statement which can be executed.  When I put this into the report region on apex.oracle.com, I get the ORA-06502 error.
    I can certainly implement a work-around for my issue by creating a 'Before Header' process on the page which populates an ApEx collection with the data I am returning and then the report can simply select from the collection, but according to documentation, the above 32K limitation should be resolved in 11g.  Thoughts?
    Shane.

    What setting do you use in your report properties - especially in Type and in Region Source?
    If you have Type="SQL Query", then you should have a SELECT statement in the Region Source. Something like: SELECT .... FROM ... WHERE
    According to the ERR-1101 error message, you have probably set Type to "SQL Query (PL/SQL function body returning SQL query)". In this situation APEX expects you to write a body of a PL/SQL function, that will generate the text of a SQL query that APEX should run. So it can be something like:
    declare
    mycond varchar2(4000);
    begin
    if :P1_REPORT_SEARCH is not null THEN
    mycond:='WHERE LAST_NAME like :P1_REPORT_SEARCH ||''%''';
    end if;
    return 'select EMPLOYEE_ID, FIRST_NAME, LAST_NAME from EMPLOYEES ' ||mycond;
    end;
    And for escaping - are you interested in escaping the LIKE wildcards, or the quotes?
    For escaping the wildcards in LIKE function so that when the user enters % you will find a record with % and not all functions, look into the SQL Reference:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm
    (You would than need to change the code of your function accordingly).
    If you are interested in escaping the quotes, try to avoid concatenating the values entered by the user into the SQL. If you can, use bind variables instead - as I have in my example above. If you start concatenating the values into the text of SQL, you are open to SQLInjection - user can enter anything, even things that will break your SQL. If you really need to allow users to choose the operator, I would probably give them a separate combo for operators and a textfield for values, than you could check if the operator is one of the allowed ones and create the condition accordingly - and than still use bind variable for inserting the filtering value into the query.

  • Error in report when executing pl/sql function body returning sql query.

    Hi,
    I have used the pl/sql function body returning sql query for creating a report. I have created a datepicker(
    P10_TASK_DATE) which can be submitted.The code is as below
    DECLARE
    v_sql varchar2(3000);
    BEGIN
    if :P10_TASK_DATE is not null THEN
    v_sql:='select
          * from tasks';
    return v_sql;
    else
    v_sql:='select * from discovery';
    return v_sql;
    END IF;
    END;if the date field is empty "select * from discovery" is executed and report is getting generated. But when we give a
    date using date picker the page is submitted and i get "report error: ORA-01403: no data found" even
    though the "tasks" table has data in it. Plz help
    Thanks,
    TJ

    hi
    Please try this
    1. Create 2 region
    1st region source=
    select * from tasks'
    go to the tab -> condition =
    item NOT NULL
    EXpression1 =:P10_TASK_DATE
    this will run whenever the item have any date
    2. open your 2 nd region source code= select * from discovery
    put the condition
    item is  NULL
    EXpression1 =:P10_TASK_DATE
    thanks
    Mark Wyatt

  • SQL Query (PL/SQL function body returning SQL query) Error

    I'm an ApEx newbie, not a PL/SQL developer (more of a Web application developer) and I'm getting an error that prevents me from saving some PL/SQL code. I've looked over it all afternoon, but can't tell what's wrong. I may even be trying to do something inappropriately, or really stupid.
    The code is below. The error I get is - "Function returning SQL query: Query cannot be parsed within the Builder". Any help is appreciated, and thanks in advance. If you need more details of what I'm trying to do let me know.
    = = = = = = =
    DECLARE
    v_ID NUMBER;
    v_SITE_ID NUMBER;
    v_SITE_CODE VARCHAR2(15);
    v_ADDR1 VARCHAR2(240);
    v_CITY VARCHAR2(25);
    v_STATE VARCHAR2(150);
    v_ZIP VARCHAR2(20);
    v_ORG_ID VARCHAR2(10);
    BEGIN
    IF :G_ORG_ID = '' THEN
    SELECT "VENDOR_ID", "VENDOR_SITE_ID", "VENDOR_SITE_CODE", "ADDRESS_LINE1", "CITY", "STATE", "ZIP", "ORG_ID"
    INTO v_ID, v_SITE_ID, v_SITE_CODE, v_ADDR1, v_CITY, v_STATE, v_ZIP, v_ORG_ID
    FROM "PO_VENDOR_SITES_ALL_V"
    WHERE ("VENDOR_ID" = :P4_VENDOR_ID);
    ELSE
    SELECT "VENDOR_ID", "VENDOR_SITE_ID", "VENDOR_SITE_CODE", "ADDRESS_LINE1", "CITY", "STATE", "ZIP", "ORG_ID"
    INTO v_ID, v_SITE_ID, v_SITE_CODE, v_ADDR1, v_CITY, v_STATE, v_ZIP, v_ORG_ID
    FROM "PO_VENDOR_SITES_ALL_V"
    WHERE (("VENDOR_ID" = :P4_VENDOR_ID) AND ("ORG_ID" = :G_ORG_ID));
    END IF;
    END;

    Denes,
    Good question.
    Before I answer that question I'll give some detail on the application. That may help too. The application is a supplier search which searches the Oracle vendor tables (po.vendors, po_vendor_sites_all, po_vendor_contacts). The vendor/vendor site relationship is one to many. The site is based on the Org_ID. The supplier search is built to work solo, or to be called by another application. If it is called by another application one of the values passed is the Org_ID, so that only the sites that pertain to the user's org_id are shown. If the appl is called solo the Org_ID is not known, so the SQL should return all sites.
    I figured the easiest way to check if the program was running solo or was called was to check the G_ORG_ID value in my PL/SQL that builds the site report. You helped me with that code. (I am hiding buttons by checking if the G_ORG_ID field is null and they display/hide properly.)
    So, how is G_ORG_ID populated? It is on Page Zero, and is populated via the URL when the appl is called. (That aspect works great.) If it is called by another application G_ORG_ID is populated and my PL/SQL works. But, if the appl is called solo the field is not populated. When the PL/SQL runs I cannot get it to run the code for when G_ORG_ID is not populated.
    I am at the point that I don't know if I need to populate G_ORG_ID in some way when the appl is running solo (kinda tricky, because I need to use that field to determine if it is running solo), or if I need to check it differently in the PL/SQL IF.
    I have experimented with both the default value, and have checked for different values in the PL/SQL IF, but nothing works.
    Thanks for your help, and let me know if you have any other questions on this matter.
    Thanks, Tony

  • Error with function that returns a rowtype...

    i have a function that returns a rowtype. below is a simplified version:
    create or replace function "GETC"
    return mytable%rowtype
    is
    rec mytable%rowtype;
    begin
    rec.rowid := 1;
    return rec;
    end;
    eventually i'll want to call this from java. but for now i'd settle for calling it from the XE web front end (and sqlplus).
    SQLPLUS: i try to call it from sqlplus by first declaring a variable where i can store the return:
    var a mytable%rowtype;
    it instantly stops me saying that i can only declare a var of a particular type. so what do i do?
    XE interface: i tried various ways to call getc(), but they were all unsuccessful. what should i be doing?
    thanks so much for your time.
    marko

    Given a function like this:
    CREATE OR REPLACE FUNCTION get_employee
         ( p_empno emp.empno%TYPE )
         RETURN emp%ROWTYPE
    AS
         v_result emp%ROWTYPE;
    BEGIN
         SELECT * INTO v_result
         FROM   emp
         WHERE  empno = p_empno;
         RETURN v_result;
    END get_employee;You can call it within PL/SQL like this:
    DECLARE
         rec emp%ROWTYPE;
    BEGIN
         rec := get_employee(7902);
         DBMS_OUTPUT.PUT_LINE(rec.ename);
    END;However,
    1. Unless there is a column named "ROWID" in the table (unlikely since it would conflict with the actual rowid and is therefore not allowed), the type will not have an attribute named "rowid".
    2. "1" would not be a valid rowid anyway.
    3. %ROWTYPE defines a PL/SQL type, which will not be recognised in other environments such as SQL and Java.

  • I get an error when i try to execute a function that returns a date value

    Hi,
    I'm new in ODP.NET, i'm make a package that contains a function that returns a date i.e.
    Package Body General_pkg is
    Function Get_Day Return Date is
    vd_day date;
    Begin
    select sysdate into vd_day from dual;
    return vd_day;
    end Get_Day;
    End General_pkg;
    i use the next code to execute the function:
    OracleCommand cmdData = new OracleCommand("General_pkg.Get_Day", cnx);
    cmdData.CommandType = Commandtype.StoredProcedure;
    OracleParameter PRM;
    PRM = new OracleParameter();
    PRM.ParameterName = "VDATE";
    PRM.OracleDbType = OracleDbType.Date;
    PRM.Direction = ParameterDirection.ReturnValue;
    cmdData.Parameters.Add(PRM);
    try
    cmdData.ExecuteNonQuery();
    catch(OracleException e);
    When i execute this code, i have and exception, which say "identifier GENERAL_PKG.Get_Day must be declare..."
    Obviously the package is correctly created in ORACLE i tested first in sql plus and it works but in ODP.NET they don't recognize the package or the function i don't know... please help!!!

    OOOOOPSS.... i forgot that i change the user in my conecction string that's why it didn't work...
    i guess i had to much beer last night.;. :)
    thanks.

  • ADM message TBX buffer: function ThAdmToMys returns RC = -1

    Hello to everyone, I have wrote a program which is loading all our products (aprox. 1300 matnrs) and then in a LOOP at itab is doing the following:
      LOOP AT ITAB.
        CLEAR WMENGE.
        EXPORT WMENGE TO MEMORY ID 'ZGRMENG'.
        SUBMIT ZGRRM07MLBD WITH MATNR = ITAB-MATNR
                           WITH WERKS = ITAB-WERKS
                           WITH DATUM IN SDATUM
                           WITH LGBST      = 'X'
                           WITH XSUM       = 'X'
                           EXPORTING LIST TO MEMORY
                           AND RETURN.
        IMPORT  WMENGE FROM MEMORY ID 'ZGRMENG'.
        IF ITAB-MTART <> 'PACK'.
          IF ITAB-MEINS = 'EA'.
            ITAB-EACH = WMENGE.
            ITAB-KILOS = WMENGE * ITAB-NTGEW.
            ITAB-LITRE = WMENGE * ITAB-VOLUM.
          ELSE.
            IF ITAB-MATNR <> 'WSTE13'.
              ITAB-EACH = 0.
              ITAB-KILOS = WMENGE.
              ITAB-LITRE = WMENGE * ITAB-VOLUM.
            ELSE.
              ITAB-EACH = WMENGE.
              ITAB-KILOS = 0.
              ITAB-LITRE = 0.
            ENDIF.
          ENDIF.
        ELSE.
          ITAB-EACH = WMENGE.
          ITAB-KILOS = 0.
          ITAB-LITRE = 0.
        ENDIF.
        MODIFY ITAB.
      ENDLOOP.
      After 50 minutes I can see the following warning message in the log file:
    18:20:34 Be 020 EKEKAKOS          BBB W ADM message TBX buffer: function ThAdmToMys returns RC = -1
    18:20:39 Be 020 EKEKAKOS          BBB W ADM message TBX buffer: function ThAdmToMys returns RC = -1
       This message is appearing 3 times in a minute. Also in details of this message you can see the followings:
    Time     TA Cl. User         Tcod MNo C Text                  Date : 14.12.06                      
    18:20:34 Be 020 EKEKAKOS          BBB W ADM message TBX buffer: function ThAdmToMys returns RC = -1                                                                               
    Details                                                                               
    Recording at local and central time........................ 14.12.2006 18:20:34                     
    Task................ 17692 Be Background processor No. 14                                           
    User................ EKEKAKOS                                                                       
    Client.............. 020                                                                            
    Terminal............                                                                               
    Session............. 1                                                                               
    Transaction code....                                                                               
    Program name........ ZMMSTOCKS_EK                                                                   
    Problem class....... W    Warning                                                                   
    Development class... SBAC Kernel Objekte                                                                               
    Module name.........                                                                               
    Line................ 1300                                                                           
    Table name.......... ThAdmToMys                                                                     
    Field name..........        -1                                                                               
    Documentation for system log message BB B :                                                         
    During the definition or processing of an ADM message in the                                       
    100%/generic table buffer an unexpected return code has occurred. The C                            
    function is specified in the error text.  In the coding an asynchronous                            
    call for replacement or reorganization is submitted at this point.  The                            
    functions concerned may be functions for packing and unpacking                                     
    parameters and for sending the ADM message.             ,                                                                               
    Technical details                                                                               
    File................ 000378                                                                         
    Position............ 0000494820                                                                     
    Entry type.......... h      ( Database error (non SQL)       )                                      
    Message ID.......... BB B                                                                           
    Variable parts...... ThAdmToMys       -1                                         1300                                                                               
    The version of our SAP is 4.0B and is running in UNIX Solaris and our database is Oracle 8.1.7.
      Can anyone suspects what is causing this message?
      Thanks in advance.

    It seems that this is a difficult problem. I think that the problem is in the SUBMIT statement which I use in order to take the stock of each material of each plant. I do not know I am still searching in the internet.
      Thanks

  • Error while calling a function.

    Hi,
    below is my callable statement through which am calling a function which returns the service years of a person with personid as parameter.
    But dont know why am getting an error which is returning the serviceyrs as 0.
    when i try to debug, the problem is in this statement
    System.out.println("the output1 is "+cs.getInt(1));
    is there any problem with my code.
    please look the code below
    thanks
    kumar
    OADBTransaction txn=getOADBTransaction();
    OracleCallableStatement cs = (OracleCallableStatement) txn.createCallableStatement("begin :1:=LMIG_UTILITY_PKG.GET_TOTAL_SERVICE(p_person_id => :2); end;",1);
    try
    cs.registerOutParameter(1,Types.INTEGER);
    cs.setInt(2,Integer.parseInt(pid));
    System.out.println("person id is "+pid);
    System.out.println("the output1 is "+cs.getInt(1));
    cs.execute();
    serviceyrs= cs.getInt(1);
    cs.close();
    catch(SQLException sqle)
    System.out.println("ERROR"+sqle.toString());
    System.out.println("Service years are "+serviceyrs);

    Hi, Guess u are missing the connection to the JDBC call.
    Try the following...it worked for me..
    Connection conn = this.getOADBTransaction().getJdbcConnection();
    OracleCallableStatement ocs = null;
    String param = null;
    try {       
         String stmt = "BEGIN :1 := <PkgName>.<FunctionName>(:2); end;";
         ocs = (OracleCallableStatement)conn.prepareCall(stmt);
         ocs.registerOutParameter(1, OracleTypes.CHAR);
         ocs.setString(2, <param>);
         ocs.execute();
         param = ocs.getString(1);
    } catch(SQLException se)
    {       throw OAException.wrapperException(se);    
    finally
         try {               
              ocs.close();
              return(param);
         } catch(Exception e)
              throw OAException.wrapperException(e);
    }

Maybe you are looking for

  • Can charts in JavaFX SDK include 3D type (x, y, z axis)?

    Can charts in JavaFX SDK include 3D type (x, y, z axis)? It is to say the XYZChart.

  • My Siri dissappeared, how do I get it back?

    A couple of days ago, Siri was on my iPhone 4, 6.1.....today I turned it on, downloaded the app "ShopShop" and then tried to use Siri, and it is gone.  How do I get it back....how do I find where it goes?  I am very senior and need simple instruction

  • Error with stored procedure block datasource

    Hi all, I tried to base a datablock on a stored procedure in order to get better runtime performance. I work with Forms Builder 6i with patch 17 , and our database is oracle 8.1.7.1.4 But when compiling I got errors. Here are what I did : create or r

  • F4 Search Help for Opportunities

    Hi, I have written a report in which the customer can select opportunities and restrict te search by several criteria. For the selection field for the opportunity number I tried to add the general F4 search help by using the match code object  crm_or

  • StringTokenizer...I'm almost there...give me a nudge??

    Following is a class with a tokenAt() method. This method will take a parameter int i and will return the i-th token in the tokenized string. For some reason, I can't return a null when needed and can't return the resulting token as a String. Isn't a