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

Oracle Discussion :

Comprendre une procédure


Sujet :

Oracle

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Décembre 2013
    Messages : 6
    Points : 3
    Points
    3
    Par défaut Comprendre une procédure
    * Bonjour, *

    lv_predicate := 'type_dos = ''NORMAL'' '; que reçoit le variable lv_predicate??

    et pourquoi on utilise type_dos ?

    * Merci *

  2. #2
    Membre éclairé Avatar de jkofr
    Homme Profil pro
    Senior Consultant DBA (Trivadis SA)
    Inscrit en
    Octobre 2006
    Messages
    484
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : Suisse

    Informations professionnelles :
    Activité : Senior Consultant DBA (Trivadis SA)
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2006
    Messages : 484
    Points : 724
    Points
    724
    Par défaut
    Ben type_dos=''NORMAL''

    jko
    OCM 11g, RAC and Performance & Tuning Expert 11g
    RMAN Backup & Recovery, Data Guard and Grid Control

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Décembre 2013
    Messages : 6
    Points : 3
    Points
    3
    Par défaut
    le type lv_predicate est varchar2 comment il va recoit 2 valeurs

  4. #4
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Décembre 2013
    Messages : 6
    Points : 3
    Points
    3
    Par défaut voici toute la fonction avec visionnage de la table
    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
    SQL> create or replace package body pkg_dossier_sec
      2     as
      3        function dossier_predicate(schema_name in varchar2,object_name in varchar2)
      4         return varchar2
      5         is
      6                 lv_predicate varchar2(1000):='';
      7         begin
      8                 if sys_context('scott_dossier','app_role') = 'manager' then
      9                         lv_predicate:='type_dos=''SECRET'''; -- a le droit de voir uniquement 
                                       --    les dossiers de type SECRET
     10                elsif sys_context('scott_dossier','app_role') = 'employe' then
     11                        lv_predicate:='type_dos=''NORMAL'''; -- a le droit de voir uniquement 
                                   --les dossiers de type NORMAL
     12                 else
     13                        lv_predicate:='1=2'; -- block access
     14                end if;
     15               return lv_predicate;
     16        end;
     17     end;
     
    Package body created.
    ====> que valeur peut avoir lv_predicate dans les trois conditions

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SQL> SELECT * FROM DOSSIER;
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    NO_DOS DT_DOS    TYPE_DOS
    ---------- --------- ------------------------------
             1 22-MAY-07 SECRET
             2 22-MAY-07 SECRET
             3 22-MAY-07 SECRET

  5. #5
    Membre éclairé Avatar de jkofr
    Homme Profil pro
    Senior Consultant DBA (Trivadis SA)
    Inscrit en
    Octobre 2006
    Messages
    484
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : Suisse

    Informations professionnelles :
    Activité : Senior Consultant DBA (Trivadis SA)
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2006
    Messages : 484
    Points : 724
    Points
    724
    Par défaut
    Manque un bout de ton jeu de test non?

    jko
    OCM 11g, RAC and Performance & Tuning Expert 11g
    RMAN Backup & Recovery, Data Guard and Grid Control

  6. #6
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Décembre 2013
    Messages : 6
    Points : 3
    Points
    3
    Par défaut merci pour votre patience
    oui, j'ai un grand programme qui parle sur la sécurité granulaire en oracle, et c'une partie du programme et je veut savoir la valeur iv_predicate dans les 3 conditions et si vous voulez aperçue tous le programme voici le lien
    http://schelabi.developpez.com/secur...laire/#LII-B-1

  7. #7
    Membre éclairé Avatar de jkofr
    Homme Profil pro
    Senior Consultant DBA (Trivadis SA)
    Inscrit en
    Octobre 2006
    Messages
    484
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : Suisse

    Informations professionnelles :
    Activité : Senior Consultant DBA (Trivadis SA)
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2006
    Messages : 484
    Points : 724
    Points
    724
    Par défaut
    Oui, ok c'est du fine grained access control.

    Et le lien donne toutes les instructions...

    Quelle est la question??

    jko
    OCM 11g, RAC and Performance & Tuning Expert 11g
    RMAN Backup & Recovery, Data Guard and Grid Control

  8. #8
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Décembre 2013
    Messages : 6
    Points : 3
    Points
    3
    Par défaut
    que reçoit iv_predicate dans les 3 conditions du bloc IF :

    lv_predicate:='type_dos=''SECRET''';
    lv_predicate:='type_dos=''NORMAL''';
    lv_predicate:='1=2';

    et est ce que (type_dos) implique le nom de colonne dans la base de données
    ou quoi??

  9. #9
    Membre éclairé Avatar de jkofr
    Homme Profil pro
    Senior Consultant DBA (Trivadis SA)
    Inscrit en
    Octobre 2006
    Messages
    484
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : Suisse

    Informations professionnelles :
    Activité : Senior Consultant DBA (Trivadis SA)
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2006
    Messages : 484
    Points : 724
    Points
    724
    Par défaut
    La fonction retourne une clause where qui s'applique à la colonne
    Type_dos,


    v_predicate:='type_dos=''SECRET''';
    lv_predicate:='type_dos=''NORMAL''';
    lv_predicate:='1=2';

    Jko
    OCM 11g, RAC and Performance & Tuning Expert 11g
    RMAN Backup & Recovery, Data Guard and Grid Control

  10. #10
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2013
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Décembre 2013
    Messages : 6
    Points : 3
    Points
    3
    Par défaut mercie pour votre aide
    merci bien, mais que veut dire

    lv_predicate:='1=2';

    c'est une fonction de blocage ??

  11. #11
    Membre éclairé Avatar de jkofr
    Homme Profil pro
    Senior Consultant DBA (Trivadis SA)
    Inscrit en
    Octobre 2006
    Messages
    484
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : Suisse

    Informations professionnelles :
    Activité : Senior Consultant DBA (Trivadis SA)
    Secteur : Conseil

    Informations forums :
    Inscription : Octobre 2006
    Messages : 484
    Points : 724
    Points
    724
    Par défaut
    C'est en quelque sorte une "filtre" de blocage.

    jko
    OCM 11g, RAC and Performance & Tuning Expert 11g
    RMAN Backup & Recovery, Data Guard and Grid Control

Discussions similaires

  1. passage d'un nom de table dans une procédure stockée
    Par thierry V dans le forum MS SQL Server
    Réponses: 7
    Dernier message: 26/07/2010, 16h48
  2. Transformation de date dans une procédure stockée
    Par bd0606 dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 27/10/2003, 11h31
  3. Réponses: 12
    Dernier message: 27/08/2003, 11h04
  4. Problème avec une procédure stockée
    Par in dans le forum Langage SQL
    Réponses: 4
    Dernier message: 27/05/2003, 15h33
  5. Fin de programme dans une procédure
    Par Sinclair dans le forum Langage
    Réponses: 13
    Dernier message: 29/11/2002, 22h30

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