ProC from Form45 give ORA-01012

This should be easy, but I'm at my wits-end. I have a Form45 app against a 806 db. After connecting to the db, I call a ProC function via ora_ffi. The ProC was compiled with Proc80 and link with sqllib80.lib just like I've always done. But my first query in the ProC produces "ora-01012 not logged on". Can anyone help?
null

here is the test program i working on.
the output follows.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
EXEC SQL INCLUDE sqlca;
EXEC SQL INCLUDE sqlda;
int main(void)
EXEC SQL begin declare section;
char userid[10] = "blah",
password[10] = "blah",
db_string[10] = "blah";
long customerid;
char client[51];
char dateofsignon[10];
int salesrep;
char reference[51];
int status;
EXEC SQL end declare section;
EXEC SQL DECLARE DB_NAME DATABASE;
EXEC SQL connect :userid identified by :password
AT DB_NAME USING :db_string;
if (sqlca.sqlcode == 0)
printf("connected\n");
else
printf("no go\n");
sqlca.sqlerrm.sqlerrmc[sqlca.sqlerrm.sqlerrml] = '\0';
printf("%s\n", sqlca.sqlerrm.sqlerrmc);
EXEC SQL select client
into :client
from blah_clients
where customerid = 1;
if (sqlca.sqlcode == 0)
printf("Name: %s\n", client);
else
printf("error\n");
sqlca.sqlerrm.sqlerrmc[sqlca.sqlerrm.sqlerrml] = '\0';
printf("%s\n", sqlca.sqlerrm.sqlerrmc);
return 0;
-output-
connected
error
ORA-01012: not logged on
null

Similar Messages

  • Select * from view gives ora-1467

    Create or replace view spec_temp_100474 as select spec_id,
    max(decode(atr_seq,101,spec_value,NULL))"101LocationId",
    max(decode(atr_seq,102,spec_value,NULL))"102OrganizationId",
    max(decode(atr_seq,103,spec_value,NULL))"103GeographyId",
    max(decode(atr_seq,104,spec_value,NULL))"104CreatedBy",
    max(decode(atr_seq,105,spec_value,NULL))"105ModifiedBy",
    max(decode(atr_seq,106,spec_value,NULL))"106CreatedTime",
    max(decode(atr_seq,107,spec_value,NULL))"107ModifiedTime",
    max(decode(atr_seq,108,spec_value,NULL))"108Type",
    max(decode(atr_seq,109,spec_value,NULL))"109Parent",
    max(decode(atr_seq,110,spec_value,NULL))"110LocationName",
    max(decode(atr_seq,111,spec_value,NULL))"111OrgName",
    max(decode(atr_seq,112,spec_value,NULL))"112GeographyName",
    max(decode(atr_seq,2,spec_value,NULL))"2Last Name",
    max(decode(atr_seq,3,spec_value,NULL))"3Type",
    max(decode(atr_seq,4,spec_value,NULL))"4Description",
    max(decode(atr_seq,5,spec_value,NULL))"5User Account",
    max(decode(atr_seq,6,spec_value,NULL))"6Password",
    max(decode(atr_seq,7,spec_value,NULL))"7User Type",
    max(decode(atr_seq,8,spec_value,NULL))"8Service Only"
    from ibs_spec_value where spec_template_id = 100474
    group by spec_id
    select * from spec_temp_100474 --- results in ora-1467 sort key too long.
    db_block_size for the database is 8k.
    Thanks,
    Avanti.

    Cause: A DISTINCT, GROUP BY, ORDER BY, or SET operation requires a sort
    key longer than that supported by Oracle. Either too many columns or too
    many group functions were specified in the SELECT statement.
    Action: Reduce the number of columns or group functions involved in the
    operation.

  • THE DATABASE CONNECTION IS LOST :;; WIERD  ORA-01012 NOT LOGGED ON ERROR

    ERROR: ORA-01012 NOT LOGGED ON ERROR
    I AM USING A JAVA SWING INTERFACE (JDK 1.1.8), WHICH USES JNI TO CALL C PROGRAMS WHICH IN TURN CONNECTS TO THE DATABASE, ORACLE 8.1.6.
    A DATABASE CONNECTION IS ESTABLISED IN THE MAIN CLASS BY CALLING A FUNCTION FROM THE CONSTRUCTOR.
    FOR ALL OTHER FUNCTION CALLS WHICH ARE MADE FROM WITHIN THIS CONSTRUCTOR, THE CONNECTION STAYS.
    BUT AFTER THE CONTRUCTOR CALL IS COMPLETE, DATABASE CONNECTION IS STRANGELY LOST. THUS ALL OTHER FUNCTION CALLS FAIL BECAUSE OF CONNECTION ISSUES GIVING ORA-01012. THOUGH IF I CHECK UP IN THE DATABASE, THE CONNECTION DOES FIND AN ENTRY.
    SO IT APPEARS THAT SOMEHOW THE JAVA INTERFACE LOOSES TRACK OF CONNECTION. BUT STRANGELY ALL THE FUNCTIONS WORK IF CALLED FROM THE CONSTRUCTOR......... BUT THATS NOT THE IDEA.
    PLEASE HELP, THIS PROBLEM IS BUGGING ME FOR WEEKS NOW.
    THANKS
    AMIT

    apologise for the caps lock.
    i am working on a previous system with java swing front end which alread uses jni, and connects to database using pro *c.
    My problem is that the connection is lost as soon as the constructor of the main class is run, giving an
    ORA-1012 NOT LOGGED ON ERROR.
    But if i place the same calls in the contructor all the database call work.
    It somehow appears that the java interface looses the connection context. Though the session does find entry in the oracle dynamic tables as long as i dont close the front end main window, thereby meaning that its the jave interface which looses the context.
    part of the code of the main class eiquser.
    //constructor
    public EiqUser() {
         super();
         initMRI();
    private void initMRI() {
         try {
              /* initialize geoManager environment */
              int rccc = new EiqCfuncs().eiqInitEnv();
    //eiqinitenv is a c function which connects to database using pro *C
              EiqCfuncs cfuncs = new EiqCfuncs();
              //EiqCfuncs has the prototypes of c functions used bye the java interface
              this.ivjFileMenu.setText(cfuncs.eiqGetText(resNum.getTEXT_FILE_MENU())); // sets the menu name
    and so on.........
    public void eiqUser_WindowClosed(java.awt.event.WindowEvent windowEvent) {
         new EiqCfuncs().eiqTermEnv(); // gives ora-1012 error
    //eiqtermenv is supposed to disconnect from data base, but returns an ora-1012 not logged on erro
         return;
    //eiqtermenv closes the connection with the data base. But fails in this case. if i place the same call ( eiqtermenv) in the initMRI function or the contructor it succeeds.
    Plus if i dont use the java interace and use a c stub for executing the same sequence of functions, then i dont face any problems.
    the proc calls exectuted ultimately by...
    :::eiqinitenv
    exec sql connect using :sqlid identified by sqlpw; // succeeds giving sqlerr.sqlcode=0;
    ::::eiqterm env
    exec sql commit work; //fails giving 0ra-1012 error
    exec sql rollback work;
    Why is the java interface loosing track of the connection once done with the constructor of the main class?? The session still finds an entry in the oracle dynamic tables.
    Please help
    Thx
    Amit

  • ORA-01012 Problem while Installing Delphi Application.

    Hi!
    I have developed a database application in Delphi 6 that uses BDE to connect to Oracle 9i.
    I have created the setup of my application with Installshield devstudio 9. I have also scanned and added all the dependencies using InstallShield's Dynamic Dependency Scanner.
    Now when I run my application on a Machine which don't have Delphi, Oracle etc, I get the following Error.
    ORA-01012 "Not Logged on".
    I have checked its detail on web but couldn't found a proper solution.
    Anybody there to give me a helping hand.
    Regards,
    Ahmad Jalil Qarshi

    This happens when you try to run a query or DML before you connect your database object to the database.
    Please note that even Borland does not recommend using the BDE. We are using Direct Oracle Access from http://www.allroundautomations.com/. It is faster and more reliable.

  • Help! ORA 01012 WHEN execute SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER

    I encounter ORA 01012 WHEN execute "SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;" in my ProC program, but under SQLPLUS it is ok. The whole scenarios are:
    1. My platform is Solaris 10, Oracle 10.2g / 64bit
    2. "alter system archive log current" failure, Oracle complaint about flash_recovery_area full, so I run
    delete obsolete;
    crosscheck backup;
    delete expired backup;
    3. Later I issued command "shutdown", oralce had no reponse after long time, so I issued command "shutdown abort" to shutdown the database, and then "startup" the database successfully to "READ WRITE", user application can also accessed the database.
    4. One of my ProC program get ORA-01012 when execute SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;
    5. But I got no error if I execute "SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL; " using SQLPLUS.
    Any suggestion about this problem? blow is my ProC function call.
    u_int32_t
    proc_GetLastSCN()
    char buf[300];
    u_int32_t scn=0;
    if (proc_ConnectDB() == APP_ERROR)
    return APP_ERROR;
    memset(buf, 0, sizeof(buf));
    snprintf(buf, sizeof(buf),
    "select DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from DUAL");
    oraca.orastxtf = ORASTFERR;
    EXEC SQL WHENEVER SQLERROR GOTO ora_sqlerror;
    EXEC SQL WHENEVER NOT FOUND DO break;
    EXEC SQL WHENEVER SQLWARNING CONTINUE;
    EXEC SQL PREPARE S5 FROM :buf;
    EXEC SQL DECLARE C5 CURSOR FOR S5;
    EXEC SQL OPEN C5;
    for (;;) {
    EXEC SQL FETCH C5 INTO :scn;
    EXEC SQL CLOSE C5;
    proc_DisconnectDB();
    return scn;
    ora_sqlerror:
    dyn_error("ORACLE error --proc_GetLastSCN\n");
    EXEC SQL CLOSE C5;
    proc_DisconnectDB();
    return 0;
    int32_t
    proc_ConnectDB()
    /* Declare variables. No declare section is needed if MODE=ORACLE. */
    VARCHAR username[DB_MAX_NAME_LEN];
    /* VARCHAR is an Oracle-supplied struct */
    VARCHAR password[DB_MAX_NAME_LEN];
    int32_t ret = APP_OK;
    strncpy((char *) username.arr, gateinfo.szSrvLogin, sizeof(gateinfo.szSrvLogin));
    username.len = (unsigned short) strlen((char *) username.arr);
    strncpy((char *) password.arr, gateinfo.szSrvPassword, strlen(gateinfo.szSrvPassword));
    password.len = (unsigned short) strlen((char *) password.arr);
    EX_SCREEN_INIT();
    EXEC SQL WHENEVER SQLERROR GOTO ora_sqlerror;
    EXEC SQL CONNECT :gateinfo.szSrvLogin IDENTIFIED BY :gateinfo.szSrvPassword;
    return ret;
    ora_sqlerror:
    errlog(ELOG_ERROR, "proc_ConnectDB@Failed to connect to %s!", gateinfo.szHistSrv);
    sql_error("ORACLE error proc_ConnectDB --\n");
    ret = APP_ERROR;
    return ret;
    }

    01012, 00000, "not logged on"
    // *Cause:
    // *Action:use COPY & PASTE so we can see what you do & how Oracle responds.

  • ERROR at line 1:ORA-01012: not logged on

    Hi ,i installed OID and the owner of the binaries and database(repository ) is Oracle and then i cahnged the permissions to 775 and now when i am trying to logon to a db(locally) using a different user x who is member of DBA group its saying not logged on .Is something wrong with permissions?
    env|grep ORA
    ORACLE_SID=oidtest
    PS1=[${ME}:${UNAME}:${ORACLE_SID}] ${PWD} >
    ORACLE_HOME=/amoidts1/OID
    [amoidts1:panther:oidtest] /home/amoidts1 > sqlplus
    SQL*Plus: Release 10.1.0.5.0 - Production on Wed Nov 21 19:24:37 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter user-name: / as sysdba
    Connected.
    SQL> select * from v$database;
    select * from v$database
    ERROR at line 1:
    ORA-01012: not logged on

    What oracle version?
    Probably there is not enough OS resources.
    *Process J000 died, kkjcre1p: unable to spawn jobq slave process [ID 833613.1]*

  • ORA-01012 NOT LOGGED ON

    Hi All,
    Today I faced a new kind of problem. Today morning I had load testing of our application(JDE APPLICATION) when I reached office and monitor ORACLE PROCESS for that database it shown me 604 where as I defined the processes=600... I am using 10.2.0.4 and OS -> HP-UX...
    $ ps -ef|grep -i "<DBNAME>|wc -l is the command I used to check the number of OS Oracle process.
    So I immediately tried to log in via listener and as expected it was giving error regarding TNS could not resolved service name bla bla bla...
    Then I saw the listener process was in a blocked state :-(
    I thought of killing some inactive sessions by connected as sysdba..
    SO I wrote export ORACLE_SID=<DBNAME>
    sqlplus / as sysdba
    shown me connected...
    but when I issued
    show parameter db_name
    then it gave me
    SQL> ORA-01012 not connected...
    previously I have seen such overflowing of Oracle processes But then for sysdba login never thrown me this error...
    I asked my application team to stop the services so that I can kill some oracle processes from OS level...
    But I am not sure what to do with this kind of situation if that too happened in my PRODUCTION DB.. :-(
    Please suggest.....
    Please let me know if you need any other information regarding this...
    Thank you..

    1 lsnrctl stop
    2 kill a few sessions
    3 logon as / AS SYSDBA
    4 SELECT USERNAME, MACHINE , COUNT(*) FROM V$SESSION GROUP BY USERNAME, MACHINE;
    thank you for your reply...
    after stopping I tried to log in same error I got.... after stopping how can I kill few sessions when I don't get a chance to log in as sysdba ? :-(
    are talking kill few session from OS??
    thank you..

  • Getting Error ORA-01012: not logged on while connecting as sys

    We have just upgraded from Oracle 8.1.7 to Oracle 9.2.0.5. Currently we have 2 databases in oracle 9i - db2 and scen. scen has been newly upgraded to Oracle 9i.
    When I set the ORACLE_SID to scen (as per entry in oratab), and connect to sqlplus using sys / as sysdba, it connects to an idle instance. and displays the error message ORA-01012: not logged on. I do not encounter this when I connect to the other database db2. There should be some settings which have been missed out.
    Could anybody help me out with this....

    I managed to get the settings corrected.Thanks anyway....

  • Oracle Instance shows connected,Yet am ORA-01012: not logged on

    Hi experts,
    Please help in log in to my database, which unfortunately was happening an hour before, but now it is not working
    In between I only did a change in some permission stuff for my base directory, but later brought it back to original permissions.
    Still it is haunting me..
    I have set up my SID/HOME/PATH perfectly, tried to check processes at OS level, they are less, still nothing is happening though database is up and running.
    I can see it at OS level and through ALert log..
    ==================
    oracle@dap-csw-ora01 /home/oracle > ps -ef|grep pmon
    oracle 3145946 1 0 18 feb - 0:44 asm_pmon_+ASM1
    oracle 7995430 1 0 18 feb - 0:50 ora_pmon_adobe_2
    oracle 13828212 11141232 0 14:59:09 pts/0 0:00 grep pmon
    oracle 7471386 1 0 18 feb - 0:57 ora_pmon_fxss_1
    oracle@dap-csw-ora01 /home/oracle > sqlplus
    SQL*Plus: Release 11.2.0.3.0 Production on Thu Feb 21 14:59:12 2013
    Copyright (c) 1982, 2011, Oracle. All rights reserved.
    Enter user-name: /as sysdba
    Connected.
    SQL> show user
    USER is "SYS"
    SQL> select instance_name,status from v$Instance;
    select instance_name,status from v$Instance
    ERROR at line 1:
    ORA-01012: not logged on
    Process ID: 0
    Session ID: 0 Serial number: 0

    CKPT wrote:
    Now I understood,..it is not a problem with permission something else is making this mess..though unknown..
    I bounced one of the database after taking permission from apps team, Now it works perfect...no issue whatsoever..
    But I want to know the reason..I dont want to face it any more...Whenever oracle installs[OUI], It knows well what the permissions to be assigned and what needed.
    You should not disturb them, What are the users, groups, executable, read, write permissions earlier and after changes and now?
    And i interestingly wanted to know why you wanted to test such things on production. Its like playing with fire so be cautious or else it costs a lot :)Basha,
    I don't think that there was any other way for the OP to solve the error. Either he could wait (which doesn't help normally in this error) or had to bounce the db, which he did. Also, with permission he meant, telling to the App team and than going for a bounce. I can't a mentioning of changing permissions anywhere .
    Aman....

  • 9.0.1: select on dba_users as sys gives ORA-03106

    Hi,
    Select username from dba_users logged as sys gives
    ORA-03106: fatal two-task communication protocal error.
    Install done from zipped OTN files, server 9.0.1, OS Linux SuSe 7.2. Character set UTF8. Is UTF8 incompatible with 9i?
    Any treatment ideas are greatly appreciated.
    Thanks
    Anatoliy Smirnov

    resolved
    thanks

  • ORA - 01012 during the install of 8.1.5 on solaris 2.6

    Hi There,
    I am trying to install oracle 8i on Sun Solaris 2.6 system using
    OUI. During the installation and while creating the database
    using DB configuration assistant, i am getting error ora -01012
    Oracle not logged on, i have selected ignore and completed
    installation. While using SVRMGRL again it is giving ORA -01012
    Not Logged on error message . Can someone help me out.. Thanks.

    Hi all,
    I hope I am not alone in facing this problem.
    Would greatly appreciate any suggestions from you.
    Thanks,
    Raghu.

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • Error: ORA-01012: not logged on

    Hi all,
    i have a program to update 2 tables and will commit every transaction for each table. firstly, my program will commit transaction in Table A then once it's done, it will commit Table B and loop again(both table) until all transactions finish.But at the end of the process, i get the error msg:
    Error: ORA-01012: not logged on
    I suspected this error because of COMMIT issue in my program.
    Kindly need someone to assist me.
    Here i attached my code for your reference.
    EXEC SQL DECLARE fs_cursor CURSOR FOR SELECT fs.FILE_ID FROM FILE_STATUS fs
    where fs.JOB_ID = 'brm_pymntd01l' and fs.status = 'N'
    FOR UPDATE OF fs.STATUS;
    EXEC SQL OPEN fs_cursor;
    EXEC SQL WHENEVER NOT FOUND DO break;
    for (;;)
    rec_ctr = 0;
    /** Reset the sqlcode **/
    sqlca.sqlcode=0;
    EXEC SQL FETCH fs_cursor INTO :FILEID;
    EXEC SQL DECLARE ft_cursor CURSOR FOR SELECT FT.RECORD_ID FROM FILE_DETAIL FT WHERE FT.STATUS = 'N' AND FT.FILE_ID = :FILEID;
              EXEC SQL OPEN ft_cursor;
    EXEC SQL WHENEVER NOT FOUND DO break;           
    if ( sqlca.sqlcode == 0)
    for (;;)
                   EXEC SQL FETCH ft_cursor INTO :RECORD_ID;
    EXEC SQL DECLARE fd_cursor ...
    FROM FILE_DETAIL fd where fd.RECORD_ID = :RECORD_ID and fd.file_id = :FILEID FOR UPDATE OF fd.STATUS;
    EXEC SQL OPEN fd_cursor;
    /** Reset the sqlcode **/
    sqlca.sqlcode=0;
    EXEC SQL FETCH fd_cursor INTO :COL1, :COL2, :COL3, :COL4, :COL5, :COL6, :COL7, :COL8, :COL9,
    :COL10, :COL11, :COL13, :COL14, :COL15,
    :COL16, :COL19, :COL20, :COL21, :COL22, :COL24, :COL25, :COL26, :COL27, :STATUS;
    if (validate_record(dbschema,logfp,&ebuf))
    trim_spaces();
    process_flag = process(ctxp, database, &ebuf, logfp, dbschema);
    time(&status_upd_date);
    strcpy(current_time, ctime(&status_upd_date));
    if(process_flag == PROCESS_SUCCESS)
    if (updateChargeEvent == 1) {
    PIN_ERR_LOG_MSG(PIN_ERR_LEVEL_DEBUG, "*******Update Charge Event\0");
    ret = update_charge_event(ctxp, database, &ebuf, ACCOUNT_NO, PAYMENT_DATE);
    if(ret != 1)
    strcpy(NEW_STATUS, "P");
    sprintf(msg,"Transaction [PUKAL update status] error. Please check cm.pinlog.");
    strcpy(REC_ERROR_CODE, ERR_GET_UPD_PUKAL_EVENT);
    strcpy(REC_ERROR_DESCR,msg);
    log(msg, logfp);
    log("\n",logfp);
    }else{
    strcpy(NEW_STATUS, "C");
    strcpy(NEXT_BILL_T, NEXT_BILL_DATE);
    else if (rebateSucess != 0)
    strcpy(NEW_STATUS, "P");
    sprintf(msg,"Transaction [apply_rebate] error. Please check cm.pinlog.");
    strcpy(REC_ERROR_CODE, ERR_GET_APPLY_REBATE);
    strcpy(REC_ERROR_DESCR,msg);
    log(msg, logfp);
    log("\n",logfp);
    else {
    strcpy(NEXT_BILL_T, NEXT_BILL_DATE);
    strcpy(NEW_STATUS, "C");
    EXEC SQL UPDATE FILE_DETAIL
    SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY'),
    COL23 = :NEXT_BILL_DATE,
    COL27 = :COLUMN_27
    WHERE RECORD_ID = :RECORD_ID;
    else
    strcpy(NEW_STATUS, "F");
    EXEC SQL UPDATE FILE_DETAIL
    SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY'),
    ERROR_CODE = :REC_ERROR_CODE,
    ERROR_DESC = :REC_ERROR_DESCR
    WHERE RECORD_ID = :RECORD_ID;
    ret = JOB_WARNING;
    else
    strcpy(NEW_STATUS, "F");
    EXEC SQL UPDATE FILE_DETAIL
    SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY'),
    ERROR_CODE = :REC_ERROR_CODE,
    ERROR_DESC = :REC_ERROR_DESCR
    WHERE RECORD_ID = :RECORD_ID;
    ret = JOB_WARNING;
    else{   
    PIN_ERR_LOG_MSG(PIN_ERR_LEVEL_DEBUG, "Error running query");
    printf("\nError: %.70s \n",sqlca.sqlerrm.sqlerrmc);
    EXEC SQL CLOSE fd_cursor;
         EXEC SQL COMMIT;
         rec_ctr ++;
         EXEC SQL CLOSE ft_cursor;
    time(&status_upd_date);
    strcpy(current_time, ctime(&status_upd_date));
    if (rec_ctr > 0)
    /* Check if all records had failed, one record had failed
    or everything is successfully processed. Then update
    file_status table. */
    int ret_status;
    ret_status = updateFileStatus(dbschema, FILEID, logfp);
    if (ret_status == ALL_REC_FAILED)
    strcpy(NEW_STATUS, "F");
    EXEC SQL UPDATE FILE_STATUS SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY')
    WHERE CURRENT OF fs_cursor;
    else if (ret_status == ONE_REC_FAILED)
    strcpy(NEW_STATUS, "P");
    EXEC SQL UPDATE FILE_STATUS SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY')
    WHERE CURRENT OF fs_cursor;
    else if (ret_status == ALL_SUCCESS)
    strcpy(NEW_STATUS, "C");
    EXEC SQL UPDATE FILE_STATUS SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY')
    WHERE CURRENT OF fs_cursor;
    /* Else do nothing error handling is done within
    * the function. */
    else{}
    else{
    /*If its an empty file, update file_status to 'C'
    so that the program will no longer fetch this record
    on the next run. */
    strcpy(NEW_STATUS, "C");
    EXEC SQL UPDATE FILE_STATUS SET STATUS = :NEW_STATUS,
    STATUS_UPD_DATE = to_date(:current_time,'DY MON DD hh24:mi:ss YYYY')
    WHERE CURRENT OF fs_cursor;
         EXEC SQL COMMIT WORK RELEASE;
    //process by not update by per transaction at staging
         EXEC SQL CLOSE fs_cursor;
    if(sqlca.sqlcode == 0)
    ret = JOB_SUCCESS;
    else
    EXEC SQL ROLLBACK WORK RELEASE;
    Thank a lots!

    what data did not get COMMITted?

  • ORA-01012

    WHEN I TRY TO CREATE A DATABASE ORACLE VERSION 8.0.5.0.0, ON WINDOWS 2000 ADVANCED SERVER, I GET CONNECTED ON TO SVRMGR30 BY LOGGING ON AS INTERNAL/ADMIN. IT SHOWS ME THAT I AM CONNECTED.
    BUT WHEN I GIVE THE STARTUP NOMOUNT PFILE=D:\ORANT\DATABASE\INITCDC.ORA. IT GIVES ME AN ERROR ORA-01012. NOT LOGGED ON.
    COULD SOMEBODY HELP ME OUT ON THIS ????

    Please, specify the OS and DB versions you are working with.
    This error means:
    ORA-01012:     not logged on
    Cause:     A host language program issued an Oracle call, other than OLON or OLOGON, without being logged on to Oracle. This can occur when a user process attempts to access the database after the instance it is connected to terminates, forcing the process to disconnect.
    Action:     Log on to Oracle, by calling OLON or OLOGON, before issuing any Oracle calls. When the instance has been restarted, retry the action.
    When originally creating a database this error is raised because the DBCA was unable to authenticate the user. DBCA uses the connect / as sysdba which means the user must be authenticated by the OS. In a windows platform it means the user must belong to the ORA_DBA group, and in a unix like system, it means user must belong to the os authenticated group dba (or the one defined at install time).
    Ensure you are properly connected with the same user who performed oracle installation and retry operation.
    ~ Madrid.

  • Fine Grain Access Control gives ORA-02014

    Using Fine Grain Access Control on Oracle 8i 8.1.6, when a policy is enabled on a table then queries of the form "select * from table for update nowait" give "ORA-02014 cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.".
    Similar queries without the "for update nowait" work OK.
    Does anyone have a fix or workaround?
    null

    I ran into this. If you're using a function to add to/add a where clause to your statement, when the where clause gets appended to the end and generates an error. You should be seeing trace files in the udump area of oracle that show you the actual sql line that is being created in error. I modified my function to add the FOR UPDATE NOWAIT in the correct place.

Maybe you are looking for

  • Want to boot XP from an external disk? Here's how:

    Has to be a USB 2.0 drive: http://forum.onmac.net/showthread.php?t=1015 By: gradenko Source: www.onmac.net [edit: you have to keep the 5GB NTFS parition on your internal drive for this to work] Hello, I cannot find a working solution for this posted

  • Wlp10/wls10: Remote access to Portal Customization

    Hi! I am developing a portlet that will be used to customize some portal content in the same domain, but in a different server environment (A preview environment will be used to let users with an editor role publish some portal inventory items to the

  • Win 8 Pro Recovery

    Hi I can not get to HP for assistance... Warranty expired. I have a HP Pavilion G7 laptop. I had a crash and lost my OS Win 8 Pro w/MCenter  and need a revovery disk. The one I made when I bought the laptop 1 1/2 years ago...has no Boot info so it is

  • How to pass the Validated Prospected in ECC from SAP CRM

    Hi Folks , As initially Customer will be treated as Prospect in SAP CRM , Once after he is giving the order how he has to be converted as customer in SAP CRM and the same has to be replicated in SAP ECC. Please let me know , how to validate in SAP EC

  • How to retreieve a Sql?

    I am trying to change the code from javaScript to java. I trying to show the sql database from our servlet system but I have failed many times as there are many errors due to class and strings. I would prefer to continue using javaScript but my proje