IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Forms Oracle Discussion :

Forms 9: Savoir si on est en QUERY_ONLY


Sujet :

Forms Oracle

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    McM
    McM est déconnecté
    Expert confirmé

    Homme Profil pro
    Développeur Oracle
    Inscrit en
    Juillet 2003
    Messages
    4 580
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Oracle

    Informations forums :
    Inscription : Juillet 2003
    Messages : 4 580
    Billets dans le blog
    4
    Par défaut Forms 9: Savoir si on est en QUERY_ONLY
    J'ai des appels entre forms qui se font soit en mode query_only soit en mode normal.

    J'ai des affectations qui se font dans des WHEN-CREATE-RECORD qui sortent en erreur
    FRM-40208: Form running in query-only mode. Cannot change database fields.
    lorsque je fais un clear_block(no_validate).

    Je voulais savoir s'il y a un moyen de savoir si la form est en mode query_only ?
    (Pas trouvé dans l'aide de get_application / form / block / item) qui corerspond à ça.

  2. #2
    Expert confirmé
    Avatar de SheikYerbouti
    Profil pro
    Inscrit en
    Mai 2003
    Messages
    6 760
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2003
    Messages : 6 760
    Par défaut
    Vous pouvez toujours traper cette erreur dans un trigger ON-ERROR.

  3. #3
    McM
    McM est déconnecté
    Expert confirmé

    Homme Profil pro
    Développeur Oracle
    Inscrit en
    Juillet 2003
    Messages
    4 580
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Oracle

    Informations forums :
    Inscription : Juillet 2003
    Messages : 4 580
    Billets dans le blog
    4
    Par défaut
    Ok, c'était la solution que je voulais utiliser s'il n'y avait pas d'autres moyens.


    Merci.

  4. #4
    Rédacteur

    Homme Profil pro
    Développeur et DBA Oracle
    Inscrit en
    Octobre 2006
    Messages
    878
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur et DBA Oracle

    Informations forums :
    Inscription : Octobre 2006
    Messages : 878
    Par défaut
    Tu peux t'inspirer de cet article de METALINK
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
     
    Subject:  Passing Parameters Between Forms Using Shared Library and Global Record Group 
      Doc ID:  Note:73307.1 Type:  BULLETIN 
      Last Revision Date:  12-JUL-2007 Status:  PUBLISHED 
     
     
    Introduction:
    =============
    This note will try to help with the following questions:
     
      - HOW TO PASS PARAMETERS BETWEEN FORMS?
      - HOW TO FIND OUT IF A SET OF FORMS ARE OPENED AND IF SO, WHAT IS THE
        STATUS OF THE FORM - WHETHER QUERY_ONLY OR NOT?
      - WHAT IS A SHARED LIBRARY TECHNIQUE?
     
    In Forms 5.0 + you could use a shared PL/SQL library (see the Forms online help
    on CALL_FORM and OPEN_FORM on how to define this). The Library could contain a 
    PL/SQL package with a public variable of length 2000. Two forms could write to 
    and read this variable.  This will only work if the two forms share the same 
    session.
     
    Shared PL/SQL Library:
    ======================
     
    The shared library technique in Forms 6.0 + includes the following:
    1) You have a common library which is attached to all your forms.
     
    2) Within the library you have a PL/SQL package which you define an array of 
       PL/SQL records.  For example:
     
       package FORM_LIST is
         TYPE tFormData is Record (FormName VARCHAR2(30),  QueryOnly BOOLEAN);
         /* plus any other data you want to store */
         TYPE arrFormData is table of tFormData index by binary integer;
           -- Now the public array 
         FormData arrFormData;
       end;
     
    3) When you open or call any forms that you wish to share this library with,
       you do so with the SHARE_LIBRARY_DATA option in the CALL_FORM or OPEN_FORM.
     
       CALL_FORM('form2',hide,no_replace,no_query_only,SHARE_LIBRARY_DATA);
     
    4) You insert a value into the PL/SQL table whenever you call or open a new form.
       You can use the id of the form (the value you get using FIND_FORM) to act as 
       the index for the PL/SQL table using the notation FormId.ID to get a pls_integer
       version of the form id.
     
    5) The Library could contain a PL/SQL package with a public variable of length
       2000.  Both forms could write to and read this variable. This only works if
       the Forms share the same session.
     
    Advantages of using shared library:
    -----------------------------------
     
    1)  If you need to pass composite types like EMP%ROWTYPE, then use a package
        in a PL/SQL library that is shared by the two forms in question.
     
    2)  For passing Forms types such as FORMMODULE, ITEM, WINDOW etc. then you
        can pass these as an integer by accessing the ".ID" of the object.
        This technique works but is not documented - e.g use at your own risk.
     
    Example: 
      declare
        MyForm FORMMODULE;
        FormID  NUMBER;
      begin
        MyForm := FIND_FORM('EMP_DATA')
        FormId := MyForm.ID;
        /* Then pass FormId as a normal Number param or even in a Global */
      end;
     
     
    Because you have used SHARE_LIBRAY_DATA, all of the forms share the same instance
    of the PL/SQL package and hence the same instance of the PL/SQL table. So you could
    do something like:
     
      declare 
        hFormId FORM; 
      begin 
        hFormId := FIND_FORM(:SYSTEM.CURRENT_FORM);
        if FORM_LIST.FormData(hFormId.id).QueryOnly then
        /* this is going to return the boolean variable of queryonly is true or false */
     
       .....
        end if;
      end;
     
    Question:
    ---------
    Why PARAMLIST packaged variables in library cannot be shared among the forms 
    even though DATA_MODE is SHARE_LIBRARY_DATA?
     
    Answer:
    -------
    SHARE_LIBRARY_DATA provide sharing of package variables only.  So the ID of
    parameter list may be shared, but the actual list is not.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Forms 6i] Savoir si un processus est lancé.
    Par kikouu dans le forum Forms
    Réponses: 0
    Dernier message: 08/12/2008, 11h27
  2. Savoir quel OS est installer sur une machine
    Par batmat86 dans le forum C++Builder
    Réponses: 4
    Dernier message: 15/06/2004, 16h16
  3. [C#] Comment savoir si on est logué ou pas?
    Par pc152 dans le forum ASP.NET
    Réponses: 3
    Dernier message: 22/05/2004, 09h47
  4. Réponses: 2
    Dernier message: 16/07/2003, 14h40
  5. [fichier] savoir si X est fichier ou répertoire
    Par iubito dans le forum Langage
    Réponses: 2
    Dernier message: 31/03/2003, 13h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo