Précédent   Forum des professionnels en informatique > Bases de données > Oracle > Outils > Forms
Forms Forum d'entraide sur Oracle Forms
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 14/12/2007, 15h02   #1
McM
Expert Confirmé Sénior
 
Inscription : juillet 2003
Messages : 3 453
Détails du profil
Informations forums :
Inscription : juillet 2003
Messages : 3 453
Points : 4 215
Points : 4 215
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
Citation:
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.
__________________
More Code : More Bugs. Less Code : Less Bugs
McM est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 14/12/2007, 15h57   #2
Rédacteur

 
Avatar de SheikYerbouti
 
Inscription : mai 2003
Messages : 6 533
Détails du profil
Informations forums :
Inscription : mai 2003
Messages : 6 533
Points : 6 469
Points : 6 469
Vous pouvez toujours traper cette erreur dans un trigger ON-ERROR.
__________________
Rédacteur Oracle (Oracle ACE)
Guide Oracle ,Guide PL/SQL, Guide Forms 9i/10g, Index de recherche
Je ne réponds pas aux questions techniques par MP
Blogs: Forms-PL/SQL-J2EE - Forms Java Beans
SheikYerbouti est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 14/12/2007, 16h20   #3
McM
Expert Confirmé Sénior
 
Inscription : juillet 2003
Messages : 3 453
Détails du profil
Informations forums :
Inscription : juillet 2003
Messages : 3 453
Points : 4 215
Points : 4 215
Ok, c'était la solution que je voulais utiliser s'il n'y avait pas d'autres moyens.


Merci.
__________________
More Code : More Bugs. Less Code : Less Bugs
McM est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 14/12/2007, 20h47   #4
Rédacteur
 
Homme Salim
Développeur et DBA Oracle
Inscription : octobre 2006
Messages : 872
Détails du profil
Informations personnelles :
Nom : Homme Salim
Localisation : Canada

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

Informations forums :
Inscription : octobre 2006
Messages : 872
Points : 1 100
Points : 1 100
Tu peux t'inspirer de cet article de METALINK
Code :
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.
salim11 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 02h46.


 
 
 
 
Partenaires

Hébergement Web