Problems in Handling String Variables with Pro*C

I have a Pro*C program that select one record from a table. Although I don't have any NULL values in this record, I got the following error:
ORA-01405: fetched column value is NULL.
This problem only accurs when I try to retrieve[b] characters. Everything works fine when I handle numbers.
I also tried to use indicators with the output value from the query. Another error was returned:
ORA-03106: fatal two-task communication protocol error.
I am not sure wheather the problem is from my program or some configuration of the environment or the client.
The database (Oracle 9i) is in a remote machine, and I am using Oracle Client (9i) in my machine running Tru64 OS.
The code that I am using is as follows:
EXEC SQL BEGIN DECLARE SECTION;
int db_classId;
char db_neId[101];
EXEC SQL END DECLARE SECTION;
EXEC SQL SELECT class_id, ne_id INTO :db_classId, :db_neId
FROM NE_ROUTE WHERE ne_id like 'BA%';
Can anyone help on this issue? Is it something to do with NLS_LANG parameter?
I just want to note down that all queries work fine with SQL Plus

Hi,
I used different select statements as you suggested, but I still get the same error. I also changed the statement to make sure it doesn't return a NULL value.
I tried the following cases
1. EXEC SQL SELECT 'name' INTO :db_neId FROM DUAL;
and I get >> ORA-01405: fetched column value is NULL.
2. EXEC SQL SELECT NVL('name','name2') INTO :db_neId FROM DUAL;
and I get >> ORA-01405: fetched column value is NULL.
3. EXEC SQL SELECT 'name' INTO :db_neId :ind_ne FROM DUAL;
and I get >> ORA-03106: fatal two-task communication protocol error.
I haven't try to change the precompiler options yet. The program is very simple as I only use to test the connection with the database. I am just trying to retieve any character from the database.
Any suggestions?

Similar Messages

  • Padding a string variable with blanks

    I need to put one blank space in fromt of a string variable.
    for instance an order number would be x192102 with x being a blank space.
    Thanks

    useString oldString = "192102";
    String newString = " ";
    newString = newString.concat(oldString);to be brief use:oldString = "192102";
    oldString = " ".concat(oldString);

  • Comma problem with global string variable

    Hi,
    I'm fiighting with comma problem for global string variable. I've on page string for example "7nndqrr52vzyb,0" and by dynamic column link I'm assigning this string to global variable. Then I'm trying to display value of that global variable on another page but I see only string till comma, nothings more. I'm not sure what I'm doing wrong because when I'm trying to assign that value normally by computation process as a constant value is fine and see on another page correct string. I'll be really glad for help.
    Thanks
    Cheers,
    Mariusz

    When it tries to display the string, it sees the comma and wants to believe the string is terminated. You could escape the , in the string or replace it with a different character..
    See this link: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#BEIGDEHF
    Thank you,
    Tony Miller
    Webster, TX
    If vegetable oil is made of vegetables, what is baby oil made of?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Problem with String variable

    I am new to Java Programming.
    I have a line of code that works and does what is supposed to.
    faceData.getProfile("Lisa").removeFriend("Curtis");
    If I assign the strings to variables such as-
    String name = "Lisa";
    String fName = "Curtis";
    and then plug those into the same line of code, it does not work
    faceData.getProfile(name).removeFriend(fName);
    What could be causing the problem?
    I even added some lines to print out what is stored in the variables to verify that they are what they should be, but for some reason the variables do not work while putting the strings in quotes does. Any ideas?

    I guarantee that something about your assertions are incorrect. Those variables are either not equal to the values you claim, or something else is going on. But it's not a problem with string variables versus string constants.
    Edit: My best guess in lack of a real example from you, is that the strings in question have non-printable characters in them, such as trailing spaces or line feeds.

  • Problem with a String[] variable

    Hi
    I'm reading values from a table and I need to store them in a String[] variable.
    This example shows I would do it without accesing to the database: String[] data = new String[] {"a","b","c"};
    Now, I want to do the same thing but reading it from a database table. I do know how to read each value from the table, the problem is that I'm not sure on how to concatenate the values in the string[].
    Thank you all in advance =)
    Yesenia

    int count = triptypeDataProvider.getRowCount();
    String[] triptypes = new String[count];
    int row=0;
    try {
    triptypeDataProvider.cursorFirst();
    do {
    triptypes[row] = triptypeDataProvider.getValue("triptype.name").toString();
    row++;
    } while (triptypeDataProvider.cursorNext());
    } catch (Exception ex) {
    error("put your message here" +
    ex.getMessage());
    log("put your message here: " +
    ex.getMessage(), ex);
    }

  • Problem with Pro*C/C++ complie in linux

    I install Oracle8.1.7 in my Mandrake 7.2 ( like redhat7.1) , and it works well except with proc not works well.
    when I complie the precomp demo program, it gives much errors. I note the proc config file length was zero.
    The following is errors I get when do:
    cd precomp/demo/proc
    make -f demo_proc.mk sample1
    it print very large errors, like follow:
    Pro*C/C++: Release 8.1.7.0.0 - Production on PGFZNe 7TB 6 11:46:04 2001
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    System default option values taken from: /home/u01/precomp/admin/pcscfg.cfg
    Error at line 33, column 11 in file /usr/include/stdio.h
    # include <stddef.h>
    ..........1
    PCC-S-02015, unable to open include file
    Error at line 38, column 11 in file /usr/include/stdio.h
    # include <stdarg.h>
    ..........1
    PCC-S-02015, unable to open include file
    Error at line 29, column 10 in file /usr/include/bits/types.h
    #include <stddef.h>
    .........1
    PCC-S-02015, unable to open include file
    Error at line 14, column 10 in file /usr/include/_G_config.h
    when I run proc without file, it print options as following:
    Pro*C/C++: Release 8.1.7.0.0 - Production on Mon Jul 9 11:19:38 2001
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    System default option values taken from: /home/u01/precomp/admin/pcscfg.cfg
    Option Name Current Value Description
    auto_connect no Allow automatic connection to ops$ account
    char_map charz Mapping of character arrays and strings
    close_on_commitno Close all cursors on COMMIT
    code kr_c The type of code to be generated
    comp_charset multi_byte The character set type the C compiler supports
    config default Override system configuration file with another
    cpp_suffix none Override the default C++ filename suffix
    dbms native v6/v7/v8 compatibility mode
    def_sqlcode no Generate '#define SQLCODE sqlca.sqlcode' macro
    define none Define a preprocessor symbol
    duration transaction Set pin duration for objects in the cache
    dynamic oracle Specify Oracle or ANSI Dynamic SQL Semantics
    errors yes Whether error messages are sent to the terminal
    errtype none Name of the list file for intype file errors
    fips none FIPS flagging of ANSI noncompliant usage
    header none Specify file extension for Precompiled Headers
    hold_cursor no Control holding of cursors in the cursor cache
    iname none The name of the input file
    include none Directory paths for included files
    intype none The name of the input file for type information
    lines no Add #line directives to the generated code
    lname none Override default list file name
    ltype none The amount of data generated in the list file
    maxliteral 1024 Maximum length of a generated string literal
    maxopencursors 10 Maximum number of cached open cursors
    mode oracle Code conformance to Oracle or ANSI rules
    nls_char none Specify National Language character variables
    nls_local no Control how NLS character semantics are done
    objects yes Support object types
    oname none The name of the output file
    oraca no Control the use of the ORACA
    pagelen 80 The page length of the list file
    parse full Control which non-SQL code is parsed
    prefetch 1 Number of rows pre-fetched at cursor OPEN time
    release_cursor no Control release of cursors from cursor cache
    select_error yes Control flagging of select errors
    sqlcheck syntax Amount of compile-time SQL checking
    sys_include none Directory where system header files are found
    threads no Indicates a multi-threaded application
    type_code oracle Use Oracle or ANSI type codes for Dynamic SQL
    unsafe_null no Allow a NULL fetch without indicator variable
    userid none A username/password [@dbname] connect string
    varchar no Allow the use of implicit varchar structures
    version recent Which version of an object is to be returned
    PCC-F-02135, CMD-LINE: User asked for help
    How can I do to solve this problem now?
    Note: I need pro*c/c++ to works well in my project.
    Thank you very much for your kindly help!
    chen chuanwen: [email protected]
    null

    Sorry! I have not explain it clearly.
    To solve it , you do following :
    1. locate stdarg.h ( or find /usr -name stdarg.h ), assume you find a stdarg.h in /usr/lib/gcc-lib/XXX/XXX/include/stdarg.h
    2.ln -s /usr/lib/gcc-lib/XXX/XXX/include/stdarg.h /usr/include/stdarg.h or cp /usr/lib/gcc-lib/XXX/XXX/include/stdarg.h /usr/include
    ( above 2 step was to make Pro*C can find stdarg.h in /usr/include )
    3. for file stddef.h do like step 1,2
    4. append a line in your Pro*C config file:
    CODE=ANSI_C
    null

  • Good practice to initalize all instance variables with type String to emptr

    Is it a good practice to initalize all instance variables with
    type String to emptry string?
    #1 approach:
    public class A
    { private String name = "";
    private String address ="";
    //etc...
    rather than
    #2 approach:
    public class A
    { private String name;
    private String address;
    //etc...
    When I read Java books, the examples don't usually do #1 approach.
    The problem is if we don't initialize to empty string, when we call
    the getter method of that instance variable, it will return null.
    Please advise. Thanks!!

    Please advise. Thanks!!It depends on your coding style. If you can avoid lots of checks for null Strings in the rest of the code then why not initialize to "".
    You have the same situation when a method returns an array. If you under circumstances return a null array reference then you have to always check for this special case, but if you return a zero length array instead you have no special case. All loops will just run 0 iterations and everything will work fine.
    So in general I guess the return of zero objects instead of null references really boils down to whether it simplicates the rest of your code by removing lots of extra checks for the special null case. This usage is especially favourable in the zero length array case. See Effective Java by Bloch, item 27.

  • Problems with Pro*C and the double datatype

    Hi!
    I'm working with Pro*C 8.1.7 on HPUX 11.0, but I've a problem
    with the datatype double.
    On runtime, I got a Bus Error (core dumped) when try assign a
    double bind_variable (Pro*C) with a double variable (ANSI_C)
    For example:
    typedef struct xxxx
    float item_ANSI_C;
    double variable_ANSI_C;
    } xxxx;
    void procedure_name()
    EXEC SQL BEGIN DECLARE SECTION;
    xxxx *POINTER;
    double double_bind_variable_PRO*C;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL WHENEVER SQLERROR DO (...);
    for (i = 0; ; i++)
    EXEC SQL WHENEVER NOT FOUND DO break;
    EXEC SQL FETCH cursor INTO (...),
    :double_bind_variable_PRO*C,
    POINTER.item_ANSI_C = other_bind_variable_PRO*C;
    (***)POINTER[i].variable_ANSI_C = double_bind_variable_PRO*C;
    (***): In this point the program throw BusError(core dumped).
    However, the float datatype does not.
    ------- End Example -------------
    Somebody have any solution for this problem? Please.
    Thanks, in advance.
    Alex.

    Hi Franz,
    Though it's a bit late, I'll leave this trace for those who follow.
    IRecordset also has Fields->Item.
    What might work is:
    IField * field;
    field = rec->Fields->Item(0);
    field->get_Value(0); (or something similar for your environment).                
    I couldn't find any documentation either.
    The C++ examples are not overwhelming, are they?
    Worse, they are not supported. Otherwise SBO-support is very hilfsbereit.
    Cheers,
    Evert

  • I have a wireless network at home. I run my iphone and ipad on it with no problems. Just purchased a MacBook Pro, and now my wi-fi keeps disconnecting and i get an error message saying another device is using the same IP address. What does all this mean?

    I have a wireless network at home. I run my iphone and ipad on it with no problems. Just purchased a MacBook Pro, and now my wi-fi keeps disconnecting and i get an error message saying another device is using the same IP address. What does all this mean?

    Hello AKCamus
    To give you some ideas of what to do next, I have provided a few articles that will give some troubleshooting Wi-Fi connections and recommended Wi-Fi settings.
    iOS and OS X: Recommended settings for Wi-Fi routers and access points
    http://support.apple.com/kb/HT4199
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    Troubleshooting Wi-Fi issues in OS X Lion and Mac OS X v10.6
    http://support.apple.com/kb/HT4628
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Setting VarChar Variable with String Parameter in Crystal Report Add Command

    Setting a VarChar Variable with a String Parameter in a Crystal Report 2008 SP6.3 Add Command is causing an error with a SQL State of 42000.  The Error Code depends on which value I select for the parameter.  I created the @DateOpt string parameter in the Modify Command window, not in the report. If I comment out line 14 of the SQL the error does not occur.
    I have attached the SQL Code and screen shots of the errors.   Please tell me what I am doing wrong.

    Since your parameter is of type STRING, you need to enclose references to it within the Command inside single quotes.
    For example, instead of
    SET @BeginDate ={?BeginDate}
    use
    SET @BeginDate ='{?BeginDate}'
    hth,
    - ido

  • Im about to buy a macbook pro. but I dont know if there are too much techproblems with the retina model,such as overheating, malfunction of the fans, screen problems?. or is the macbook pro non retina in tech problems a better option? thanxa lot

    Im about to buy a macbook pro. but I dont know if there are too much techproblems with the retina model,such as overheating, malfunction of the fans, screen problems?. or is the macbook pro non retina in tech problems a better option? thanxa lot

    I have a brand new rMBP and have not seen any of those problems.

  • I'm having problems printing from my 15" macbook pro to my HP wireless printer. It works sometimes but not reliably, it can spend hours "seating for printer". I can print from my i pad with no problems

    I'm having problems printing from my 15" macbook pro to my HP wireless printer. It works sometimes but not reliably, it can spend hours "seating for printer". I can print from my i pad with no problems

    Hi,
    Apple's AirPrint only support specific models while using wired or wireless network connection.
    Plugging a printer into a USB port of Apple base is not supported for AirPrint:
    AirPrint printers connected to the USB port of the Apple AirPort Base Station or Time Capsules are not supported with AirPrint.
    As well you must use AirPrint enabled printers for a such, none of your printers are AirPrint enabled:
    http://support.apple.com/kb/ht4356
    There are 3rd party solutions which allow sharing a printer connected to your Mac as AirPrint, Printopia as example provide a such:
    http://www.ecamm.com/mac/printopia/

  • Hi, can anyone help with the problem I am having with pro book 4440s? I can't boot into windows 7.

    Hi, can anyone help with the problem I am having with pro book 4440s?  I can't boot into windows 7, nor can I enter the bios cause i fogot the password. the error I am getting says "windows failed to start. a recenr hardware or software change might be the cause.   it then gives me options to boot from a disc but I can't do that cause I am unable to get into the bios to change it to boot from a disc.
    The error message goes on :
    File: \Boot\BCD
    Status: oxcoooooof
    info: An error occurred while attempting to read the boot configuration.
    the only two options on the screen are enter=continue and ECS=exit
    I just can't get pass this screen.
    Please help.
    Thanks

    Hi,
    If you don't already have one, use another PC to create a Windows 7 Rescue CD.  Download the relevant ISO from the links below.
    Windows 7 32bit
    Windows 7 64bit
    You should use an application such as ImgBurn to burn the ISO to a CD - a guide on using ImgBurn to write an ISO to a disc is Here.  Once created, or if you already have this, tap away at the esc key as you start the notebook to enter the Start-up Menu.  Insert the Rescue CD.  Select Boot options ( usually f9 ), use the arrow keys to select the CD/DVD drive and hit enter.  You may also get a prompt to 'Press any key to continue' - do this if asked.
    When loaded, select Repair Your Computer and choose the Command Prompt.  When this loads, enter the following commands and hit enter after each one - include spaces as shown.
    Bootrec.exe
    bcdedit /export C:\BCD_Backup
    c:
    cd boot
    attrib bcd -s -h -r
    ren c:\boot\bcd bcd.old
    bootrec /RebuildBcd
    bootrec /fixmbr
    bootrec /fixboot
    Remove the Rescue CD and try rebooting the notebook.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • APD - error when activating, problem: 7.0 variable with long technical name

    Hello everybody!
    I have got the following problem:
    I created an APD, with one filter on 0calday using a variable. This variable was created on our own and works without any problems. It's a 7.0 variable with a long description "W_E_M_0CALDAY_WDLAS"
    If I try to activate the APD I get an error message "Analysis Process Has Errors, Activation Is Not Possible" and "Variable W_E_M_0CALDAY_WDLAS does not exist actively". But this variable is active!
    My colleague told me, that there seems to be a problem with long technical names of variables in APD. I tried to find a SAP note to this topic, but I didn't.
    Had anyone else this problem? How was it solved? Or are there any SAP notes I didn't find?
    Thanks for your help!
    Bettina

    In the meantime I copied the variable to a shorter name, but it still doesn't work. I tried it with a 3.x variable and a 7.0 variable. In the exit I first added an OR condition to the when-case, but this didn't also help. Afterwards I copied the whole coding in a separate when-clause.
    Stil not successful. Factory calender is OK. The variables also work in a normal query but not in the APD - the result of the last workday is always '00000000'.
    Any ideas?
    Kind regards,
    Bettina

  • External Hard Drive & Problems With Pro Tools LE

    Alright... my friend has the same computer as me, Powerbook G4, with the same specs and everything (OSX 10.3.9), and has a Digi 002 Rack with Pro Tools LE 6.2.2 He can record and playback everything perfectly through his Lacie 150 GB external HD. However, when i installed the software on my laptop and tried to load the same files he was working on, i get an error message that tells me that the audio files are "unsuitable for playback" and that the Lacie HD is "not an audio playback volume", which it really is!! The only way to get the songs to play, is to copy all the files onto my internal HD... then it all works fine. (besides the fact that is uses up all my memory!!!) Is there any way to fix this problem?? Some update or driver that i'm missing?? I'm assuming it has something to do with my laptop software/hardware??? ALSO, i run Final Cut Pro, and it won't let me set my external HD as the target disk, because it is, again, unsuitable for playback!!! I have to import tapes to the internal, then send them to the external after the fact! really annoying....
    ANY help would be greatly appreciated!!!!!!

    How big is the drive?  It's possible that Spotlight indexing is running and slowing things down.  If you are unplugging the drive when you run into problems, the indexing will never complete and will start again the next time you plug in the drive.  You can exclude the external drive from being indexed in the Spotlight system preferences:
    You might also want to use Disk Utility to check the disk for errors, especially if you've been unplugging it while activity has been going on.

Maybe you are looking for

  • Address Book as a Data Base

    I added a new name in Address Book of my Mac and Sync'd it to my Curve. The "name" is Passport and I changed a phone # to Custom "number". It moved the name over but none of the other data. Any thoughts?  I don't have enough data to go out and buy a

  • Move iphoto library to external drive

    Hi everyone. I'm a first-timer here. I'm trying to free up space off my local hard drive and want to move an iphoto librabry to an expernal drive. When I do I get this message after more than an hour: "The Finder can't complete the operation because

  • Filechooser question

    Hi, Using my program you save a png screenshot of the GUI screen to file, this all works fine. My question is, using the JFilechooser is it possible to locate the png file and print it. Thanks

  • Whenever I open safari app, it crashes in a second.

    I'm using iPhone4s and ios7. And my safari won't start. Can I reinstall it?

  • I can't see the movies whit my laptop, and i don't know what to do

    when i'm introduce the disc on the computer, only hear a noise on the unit. anybody knows what is the problem?