Defining the name of the module in the program of the OIC

Hello

I was struggling with defining the name of the module in my OIC program. Here's the code in which
I create the environment, connect, try to set the module attribute, wait for the Enter key and clean
and exit after completing the Enter key.

I can say, I called OCISetAttr as the documentation says I should, and none of my return values
indicate a problem. Yet, when I v $session, I get what I assume is the default value of the module
and no value, I put in the code ("moduletest").

The physical file name programs is oci101.exe. It also connects to the Oracle instance as a named user
oci101. I check v$ session with this query:
Select the user name, the module from v$ session where the username is not null;

And the output is as follows:

USER MODULE NAME
------------------------------ ------------------------------------------------
OCI101 oci101.exe
SQL SYSTEM * more

I see a column value 'moduletest' for the OCI101 user MODULE.

Don't know what I'm missing. Any ideas? Here is the code:

Code BÉGIN:

OCIEnv * envhp;
UB2 charset_id = 0;
UB2 ncharset_id = 0;
UB4 mode = OCI_DEFAULT;

sword env_rc = OCIEnvNlsCreate () const
& envhp, mode,
(void *) 0, / / context for the allocation of memory to custom user defined
(void *) (*) (void *, size_t) 0, / / malloc user defined
(void * (*) (void *, void *, size_t)) 0, / / realloc user defined
(void (*) (void *, void *)) 0, / / / / free user defined
(size_t) 0, / / off user memory
(void *) 0,.
charset_id, ncharset_id
);

OCIError * errhp;
sword err_rc = OCIHandleAlloc () const
(dvoid *) envhp, (dvoid *) & errhp,.
OCI_HTYPE_ERROR (size_t) 0, (dvoid *) 0
);
checkerr (err_rc, errhp);

OCISvcCtx * svchp = 0;
sword l2rc = OCILogon2 () const
envhp, errhp, & svchp,
(const OraText *) zusername, (ub4) strlen (zusername).
(const OraText *) zpassword, (ub4) strlen (zpassword).
(const OraText *) zdatabase, (ub4) strlen (zdatabase).
mode
);
checkerr (l2rc, errhp);

Define the attrbute module
Extract the session descriptor in sessionhp.

OCISession * sessionhp = 0;
UB4 sh_size = 0;
sword oci_attr_get_status = OCIAttrGet (svchp,
OCI_HTYPE_SVCCTX,
& sessionhp,
& sh_size,
OCI_ATTR_SESSION,
errhp);
checkerr (oci_attr_get_status, errhp);

Configure the module
sword oas_rc = OCIAttrSet (sessionhp, OCI_HTYPE_SESSION,(void *) 'moduletest',
strlen ("moduletest"), OCI_ATTR_MODULE, errhp);

checkerr (oas_rc, errhp);

GetChar ();
Cleaning:
If (svchp) {/ / 0 when already disconnected}
OCISvcCtx * const tmp_svchp = svchp.
svchp = 0; reset the svchp error or not
const sword lorc = OCILogoff (tmp_svchp, errhp);
checkerr (lorc, errhp);
}

sword const rc = OCIHandleFree (envhp, OCI_HTYPE_ENV);
End of the Code.

Thanks for any help...

Karl

Hi Karl,

I'm certainly not an expert of BEAK, but after you set the module attribute, the value is updated when the next execution of the statement in my experience. There may be other ways in which this can happen, but I have not seen such cases.

Here is a short example:

#include 
#include 
#include 
#include 

int main(int argc, char *argv[]) {
  OCIEnv      *envhp = NULL;  /* OCI Environment handle     */
  OCIError    *errhp = NULL;  /* OCI Error handle           */
  OCISvcCtx   *svchp = NULL;  /* OCI Service Context handle */
  OCISession  *usrhp = NULL;  /* OCI User Session handle    */

  OCIStmt     *stmtp = NULL;  /* OCI Statement handle       */

  /* the statement to execute   */
  /* this is purely for example */
  oratext *sqlstmt = "begin null; end;";

  /* connection information */
  oratext *username = "scott";
  oratext *password = "tiger";
  oratext *database = "orademo";

  /* used to hold the results of each OCI call */
  sword result = 0;

  /* Initialize and create a default environment */
  result = OCIEnvCreate(&envhp,
                        OCI_DEFAULT,
                        (dvoid *) 0,
                        0,
                        0,
                        0,
                        (size_t) 0,
                        (dvoid **) 0);

  /* allocate an error handle */
  result = OCIHandleAlloc((dvoid *) envhp,
                          (dvoid **) &errhp,
                          OCI_HTYPE_ERROR,
                          0,
                          (dvoid **) 0);

  /* create connection */
  result = OCILogon2(envhp,
                     errhp,
                     &svchp,
                     username,
                     (ub4) strlen(username),
                     password,
                     (ub4) strlen(password),
                     database,
                     (ub4) strlen(database),
                     OCI_DEFAULT);

  /* get the user session handle */
  result = OCIAttrGet(svchp,
                      OCI_HTYPE_SVCCTX,
                      (void *) &usrhp,
                      NULL,
                      OCI_ATTR_SESSION,
                      errhp);

  /* set the module attribute */
  result = OCIAttrSet(usrhp,
                      OCI_HTYPE_SESSION,
                      (void *) "My Module",
                      (ub4) strlen("My Module"),
                      OCI_ATTR_MODULE,
                      errhp);

  /* allocate the statement handle */
  result = OCIHandleAlloc((dvoid *) envhp,
                          (dvoid **) &stmtp,
                          OCI_HTYPE_STMT,
                          0,
                          (dvoid **) 0);

  /* prepare the statement for execution */
  result = OCIStmtPrepare(stmtp,
                          errhp,
                          sqlstmt,
                          (ub4) strlen((char *) sqlstmt),
                          OCI_NTV_SYNTAX,
                          OCI_DEFAULT);

  /* execute the statement - after execution the */
  /* MODULE value should be updated in v$session */
  result = OCIStmtExecute(svchp,
                          stmtp,
                          errhp,
                          (ub4) 1,
                          (ub4) 0,
                          (CONST OCISnapshot *) NULL,
                          (OCISnapshot *) NULL,
                          OCI_DEFAULT);

  /* print a simple prompt    */
  /* view session in SQL*Plus */
  printf("program paused, ENTER to continue...");
  getchar();

  /* disconnect from the server */
  result = OCILogoff(svchp,
                     errhp);

  /* deallocate the environment handle */
  /* OCI will deallocate child handles */
  result = OCIHandleFree((void *) envhp,
                         OCI_HTYPE_ENV);

  return OCI_SUCCESS;
}

When the program is paused I see this in SQL * more in my test:

SQL> select sid, username, program, module from v$session where username = 'SCOTT';

       SID USERNAME         PROGRAM                          MODULE
---------- ---------------- -------------------------------- --------------------------------
       136 SCOTT            OCIModuleTest.exe                My Module

Maybe it's a little help.

Kind regards

Mark

Published by: Mark Williams on December 22, 2008 11:06

Put a little sample.

Tags: Database

Similar Questions

  • What defines the reference name in a type library

    I've created a DLL in CVI 9.1 for use with VB6.  I used a function (.fp) workgroup file to define the functions exported from the DLL.

    We add the DLL as a reference to the VB6 project, which allows functions defined in the .fp to be used directly from VB6 without using info prototype of any kind.

    One problem with this regime removes a reference from Visual Basic 6 development environment - there is no obvious way to do it - there is no possibility to "remove the reference.  We invariably liquidation brute force tearing all this reference to the DLL in the registry and remove the DLL itself the facility so that VB6 keep find it and insisting on using it.

    One aspect is the name of the reference.  What estblishes the name of the reference to the VB6 development environment?  What is the name of the DLL?  It is the name of the .fp file?

    I could run an experience I guess, but maybe someone knows and can tell me.

    Thank you.

    Menchar

    Menchar-

    It turns out that the name of the file function group (.fp) establishes the name of the reference when the DLL is added to the Visual Basic 6 development environment.

    The developer can see the associated DLL name, but the reference itself is the name of the group file function that may or may not be the same name as the DLL, the project, space to work or anything else.

    Thanks for the help, Menchar, you're always on the ball.

    Menchar

  • Is it possible to define the name of the path and inside the MSI log file

    Is it possible to define the name of the path and inside the MSI log file, so that it should not be set from the command line.  This way just race the msi causes always a logfile in a specific path and the file name?

    Read the following article and see if it helps.  In my view, it is possible to use InstallShield, but I'm not sure.  It's just a little out of my League. http://www.flexerasoftware.com/webdocuments/PDF/msi_writing_to_the_log_file.pdf.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • ADF - listener to download files of component - defining the name of the output file

    Studio Edition Version 11.1.1.2.0


    Hi, I would like to learn how to set the name of the output than the current data file + file name. I have a button with the component listener downloading files with theses parameters

    Content/Type: application/pdf
    File name: test.pdf
    Method: fullReportPDF()

    I needed when the user clicks the button, it returns the current date + the statically defined file name.


    How can I do this?

    A bean, you implement a method that returns the date soul filen and static part concatenated and set it as EL in the af: fileDownloadActionListener

    // on the page
    
    
    // in the bean
        public String getFilename()
        {
            String fn = (new Date()).toString() + "static_part.xyz";
            return fn;
        }
    
        public void fullReportPDF(FacesContext facesContext, OutputStream outputStream) { ... }
    

    where XYZBean is the bean where you have implemented, the method fullReportPDF.

    Timo

  • How to define the rules of navigation in faces - config.xml dynamically?

    In jdev 12.1.2 I am studying and performing the adf faces demo (12.1.2 version).

    I am trying to implement the function of navigation like this:

    1. in the navigation tree in the left panel of the accordion will show the features of an application which is read from database tables;

    2. When you click on a node in the navigation tree, a corresponding function/page will be launched in the Panel to the right of the home page;

    3. the navigation tree nodes display names and information pages target will be resident in the database tables and will be read in my case, the control of data bindings.

    and now I know, the click action was executed in this file in the demo: componentGallerySideBarTree.jsff:

    ->action = "#{stamp.actionOutcome}"

    < af:tree id = "tree" value = "#{attrs.menuModel}" var = "stamp" = "single" rowSelection fetchSize = "200" "

    Summary = "#{uploading." Summary}"disclosedRowKeys =" #{attrs.menuModel.foldersTreeState} "autoHeightRows = '0'"

    displayRow selectedRowKeys = "#{attrs.menuModel.selectionState}" = "selected" "

    contentDelivery = 'immediate' emptyText = "there are no demos for this category.

    styleClass = "AFStretchWidth" >

    < f: facet name = "nodeStamp" >

    < af:panelGroupLayout id = "nodePgl" >

    < af:image source = "#{stamp.ico}" styleClass = "GalleryIcon" shortDesc = "Image of a tree node" "

    ID = "nodeImg" / >

    < af:switcher facetName = "#{stamp.children == null?' leaves ': 'notLeaf'}" id = "nodeSw" > "

    < f: facet = "journal batch name" >

    < af:link id = text = "#{stamp.label"leafLink"} '"

    shortDesc = "#{stamp.label} #{stamp.deprecated eq 'real'?" (not recommended) " :"} »

    action = "#{stamp.actionOutcome}"

    inlineStyle = "#{stamp.deprecated eq 'true'?-style: italic; color: gray':"} ' "

    selected = "true" >

    < af:target execute="@this"/ >

    < / af:link >

    < / f: facet >

    < f: facet name = "notLeaf" >

    < af:outputText id = value = "#{stamp.label"notLeafText"} ' shortDesc =" #{stamp.label} "/ >"

    < / f: facet >

    < / af:switcher >

    < / af:panelGroupLayout >

    < / f: facet >

    < / af:tree >

    and the value of actionOutcome was entered in this file DemoConfusedComponentsMenuModel.java:

    (for the case of the confused component navagation tree folder)

    private TreeModel _initConfusedComponents()

    {

    Confused components

    The list < DemoItemNode > confusedComponentsNodes = new ArrayList < DemoItemNode >)

    {

    {

    ..

    Add (new DemoItemNode ("Tabs", "/ confusedComponents/tabs.jspx","/adfdt/panelTabbed.png","confused.tabs"));

    Add (new DemoItemNode ("iterators","/ confusedComponents/iterators.jspx","/adfdt/iterator.png","confused.iterators" ""));

    }

    };

    DemoItemNode confusedComponentsGroup = new DemoItemNode ("Often confused", "/ images/folder.png", confusedComponentsNodes);

    List ConfusedComponentsList = new ArrayList();
    confusedComponentsList.add (confusedComponentsGroup);

    TreeModel confusedComponents = new ChildPropertyTreeModel (confusedComponentsList, _CHILDREN);
    Return confusedComponents;
    }

    In addition, there are elements in faces-config .xml to define the rules of navigation for the actions 'by clicking on the tree node.

    <>navigation-case

    < from outcome >confused.iterators< / de-results >

    < to view - id > /confusedComponents/iterators.jspx< / to-view-id >

    <!-< redirect / >->

    < / navigation-case >

    So, I can add a new entry in the navigation tree, like this:

    1. in DemoConfusedComponentsMenuModel.javaof the file: Add

    Add (new DemoItemNode ("Iterators", "/confusedComponents/cms.jspx","/ adfdt/iterator.png","confused.cms" ""));

    2. in the file faces - config.xml, add:

    <>navigation-case

    < from outcome >confused.cms< / de-results >

    < to view - id > /confusedComponents/cms.jspx< / to-view-id >

    <!-< redirect / >->

    < / navigation-case >

    and it works!- I have successfully added a new node in the navigation tree, called a new page created by myself cms.jspx.

    If I implement them using database tables (links datacontrols EO/VO),.

    I think I can put action = "#{stamp.actionOutcome}" by links.

    But how can I pay the entry in the faces-config file. XML? -That is to say:

    How to define the rules of navigation in faces - config.xml dynamically?

    Thanks in advance!

    ADF 12 c comes with support for JSF 2.0, you can use the implicit navigation feature.

    In short: you don't need to add case action property, any set of navigation in the name of the page (and include the path if necessary).

    In your case, the name of the action will be: ' / confusedComponents/cms.jspx ' and of course, you can link the action property of method that returns this string.

    If you want to add by the case of navigation program, try ConfigurableNavigationHandler.

    For example:

    Manager of ConfigurableNavigationHandler = (ConfigurableNavigationHandler) FacesContext.getCurrentInstance () .getApplication () .getNavigationHandler ();

    handler.getNavigationCases () .put (...);

    Dario

  • How to define the Type of connection using the New-VirtualPortGroup

    Using PowerCLI 4.1, is there way to define the port group (VM or VMKernel) connection type when you create the port group?

    Thank you

    OK, try it like that.

    $VMHostObj = Get-VMHost $ESXHost
    $vsw = get-virtualswitch -name vSwitch0 -VMHost $VMHostObj
    
    New-VMhostNetworkAdapter -VMHost $VMHostObj -VirtualSwitch $vsw -PortGroup "VMotion" -IP 10.110.40.43 -SubnetMask 255.255.255.0 -VMotionEnabled:$true
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Define the new service of tangosol-coherence - override.xml

    Hi all
    I am new to consistency. Have a problem to define the new service.

    I am trying to create a new service replied to a few caches and intend to run this service only on some nodes in the cluster.

    So I created the new definition of service in tangosol-coherence - override.xml by copying the definition for ReplicatedCache (id = "1"). I changed the ID number to + 101 + and changed the service type for "newReplicatedCache."
    Then in my cache - config.Xml. I put the tag < service name > "myService" to "newReplicatedCache".

    It starts and runs ok, and Jconsole MBean I see there is a "newReplicatedCache" with "myService" running, which is great.

    Now, the problem comes, tangosol-coherence - override.xml, <>lease-granularity for "ReplicatedCache" is set to Member.
    And I need put < lease-granularity > to 'newReplicatedCache' to wire.

    I did and seems consistency is without taking account of this parameter and always using members to 'newReplicatedCache '.

    Then I removed the definition for 'newReplicatedCache' in tangosol-coherence - override.xml, and consistency is always be able to run, and there always create a new service "newReplicatedCache". I guess this is just to get the name of cache-config. XML and then use "ReplicatedCache" default service definition in column a new service.

    So my question is how to define new services?

    I checked the documentation for the serial number, it does not explain how to create a new service. I understand that this is a very simple matter of installation, will be more than happy to read the documentation if you can direct me to that useful :)

    Hello

    To achieve what you want, delete ... your file tangosol-coherence - override.xml and change your schema definition reproduced in you cache configuration to:

    
      myNewCache-scheme
      myNewReplicatedCache
    
       thread
    
      
        
        
      
    
    

    Andy

  • Is it possible to define the image poster in browser FCPX?

    Is it possible to define the poster frame of the browser FCPX to the last frame of the clip?

    My use case:

    I have bunches of clips on a SD card, good and bad, taken from several scenes. Clusters.

    Each bad take is cut while now a red card to the camera. So if I had some way of looking at the last picture of the clips, I would not put the clip in the timeline or skim even the clip had been sloppy and should be rejected. I have confirmed with Canon that our XA25 will only display the first image of the scene. FCPX seems to like to display the middlemost image like the poster. If it is can not editable in FCPX someone Adviser of another method?

    Thank you!

    You can post a screenshot of the place where in FCP you are talking about? The browser may display several images and view film, you can zoom in the film of the clip. There is no single framework for the poster frame.

  • How to define the range of data to a strict typdef through the control reference

    Hello world

    I'm trying to define the range of data to a strict typdef through the reference of the order, when I do, I get an 'error of property node.

    Is it possible to set the range of the strict typdef.

    Thank you

    Vignesh

    Vignesh1987 wrote:

    I'm trying to define the range of data to a strict typdef through the reference of the order, when I do, I get an 'error of property node.

    Is it possible to set the range of the strict typdef.

    Try to set the original control (type-def) and not its instances... to open the reference of the original type-def command, use 'Open VI reference'.

    Published:

    These properties are not available with STRICT TYPE DEF.

    a. data entry limits: increment property

    b. data entry property of limits: Maximum

    c. property limits: Minimum for the data entry

  • Can we (re) define the colorbox for any 16-bit output?

    Dear users,

    can we (re) define the colorbox for any 16-bit output? Currently, the colobox out U32.

    See you soon,.


  • I get the message 'the' device name' cannot be stopped because a program accesses still it."when using safely remove hardware program.

    Trying to read an external drive "Xcraft", by chance the power supply cable was disconnected. I ' v ereconnected the cable and try to remove the device using the ' renove safely» The unit is not stopped after selection and | I get the message 'the' device name' cannot be stopped because a program is accessed again. ' Y at - it patches or wrap-around work. Just, I can't access the drive. Appreciate any help.

    Try this and see if you can get it to unlock. If it does not just try to restart your computer without USB drive.

    The download is from Microsoft so it's safe!

    Good luck!  Please rate me upward if you find my post helpful. Thank you!

  • When windows starts, the user name is not displayed, almost all programs do not work, or I get a message saying that they do not have authorization to run the service

    When windows starts the user name is not displayed, almost all programs do not work, or I get a message saying that they have permission to run the service, sometimes windows not loading some programs of initialization and I can't turn off the pc by using the start menu, when it arrives, sometimes everything works normally when I turn on the pc except of my antivirus (avast!) and firewall (comodo) , they are responsible, but avast! said that the service is disabled and when I him there is a message saying that he had ceased to maximize or in an inconsistent state and comodo said that the application of the agent is not running.

    My Windows is XP Professional SP3.

    Thanks in advance.
    (Sorry for my English)

    * original title - I have starting problems I've ever had and I can't find a TomTom.*

    Salvation exodus REV,

    You did it of any material changes or software on the computer before this problem?

    I recommend you to uninstall Avast! & Comodo temporarily from Add / Remove Programs. Later, check to see if the problem persists.

    To uninstall Avast!, you can use utility aswClear to uninstall Avast!.

    For more information, refer to this link: Uninstall Utility

    You can not install Comodo since Avast! has a built-in & antivirus firewall.

    Hope the helps of information.
    Please post back and we do know.

  • Does anyone know if there is a way to define the layout of icons on the desktop when it is a 'bureau', then a different configuration for when it's a laptop?

    Original title: desktop themes?

    I use my cell phone as both a laptop and a "desktop"(connecter à un moniteur 24''). "»  Does anyone know if there is a way to define the layout of icons on the desktop when it is a 'bureau', then a different configuration for when it's a laptop?  I don't want to keep moving icons and I'm a little OCD about where they are.

    Hi MelissaES,

    You can follow these links & check if it helps.

    Set up multiple monitors

    Understanding multiple monitors

    Multiple monitors: frequently asked questions

    Hope the helps of information.
    Please post back and we do know.

  • If I click on anything whatsoever on my desk, a window appears: this file does not have a program associated with it for performing this action. Create an association in the control panel to define the Associations. "

    Original title: all my programs have become more associated with their shortcuts in my windows start.

    All my programs became most associated with their shortcuts. If I click on anything whatsoever on my desk, a window appears: "this file has no program associated with it for performing this action. Create an association in the control panel to define the Associations. " I must do this for each shortcut? Microsoft Word, all my accessories, none of the links are attached to nothing. Y at - it a quick fix to my problem, or I am looking at a restore of the entire system?  Help, please!

    Look at the tutorial on changing to default file associations.
    http://www.mydigitallife.info/how-to-edit-or-change-file-type-or-extension-associations-default-programs-in-Windows-Vista/

    It should help to solve your problem.

    Thank you

    Marilyn

  • Help! All programs will not work. I get the error message: "this file has no program associated with it for performing this action. Create an association in the control panel to define the Associations. "

    When I try to run a program (Internet Explorer, Firefox, CCleaner, etc..) I get the same message: "this file has no program associated with it for performing this action. Create an association in the control panel to define the Associations. "

    I can't find the "Set Associations control panel" and am not sure that he would go if I could find it, and if it work I do not know I know what to do. Help!

    Should I re - publish so that else soeone looks like?

    If you wish.
    Make sure you add a line right at the beginning: you are reposting because we could not have solved other fold it.

    Alternatively, you wait for the next person coming.

    The choice is yours, although generally you would be advised to stay put and wait. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

Maybe you are looking for