Bonjour,
J'ai une procédure à exécuter en Php. Mais lorsque je le la lance, j'ai l'erreur suivante :
"ORA-01008: toutes les variables ne sont pas liées"
Voici le code de ma procédure, testée et fonctionnelle.
Voici le code d'exécution de la procédure en PHP :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 create or replace procedure TEST( id in number, nom in varchar2, prenom in VARCHAR2, arrive in date, depart in date, fonction in VARCHAR2, societe in VARCHAR2, service in VARCHAR2, lieu in VARCHAR2, bureau in VARCHAR2, sortant in CHAR, demande in date, statut in CHAR) is f_file_id UTL_FILE.FILE_TYPE; v_file_location VARCHAR2(400) := 'Mon_rep'; BEGIN dbms_output.put_line(v_file_location); f_file_id := UTL_FILE.FOPEN(v_file_location, 'ICI.txt', 'w'); UTL_FILE.PUT_LINE(f_file_id, id||chr(9)||nom||chr(9)||prenom||chr(9)||arrive||chr(9)||depart||chr(9)|| fonction||chr(9)||societe||chr(9)||service||chr(9)||lieu||chr(9)||bureau||chr(9)||sortant||chr(9)||demande||chr(9)|| statut|| 'TEST'); UTL_FILE.FCLOSE(f_file_id); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(SQLERRM); UTL_FILE.FCLOSE_ALL; END;
La connexion à la BD est valide.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 $statement = oci_parse ($connect, "BEGIN TEST(:id, :nom, :prenom, :arrivee, :depart, :fonction, :societe, :service, :lieu, :bureau, :sortant, :demande, :statut); END;"); oci_bind_by_name($stmt, ":id", &$table['ID'][$index], -1); oci_bind_by_name($stmt, ":nom", &$table['NOM'][$index], -1); oci_bind_by_name($stmt, ":prenom", &$table['PRENOM'][$index], -1); oci_bind_by_name($stmt, ":arrivee", &$table_['ARRIVEE'][$index], -1); oci_bind_by_name($stmt, ":depart", &$table['DEPART'][$index], -1); oci_bind_by_name($stmt, ":fonction", &$table_['FONCTION'][$index], -1); oci_bind_by_name($stmt, ":societe", &$table['SOCIETE'][$index], -1); oci_bind_by_name($stmt, ":service", &$table['SERVICE'][$index], -1); oci_bind_by_name($stmt, ":lieu", &$table['LIEU'][$index], -1); oci_bind_by_name($stmt, ":bureau", &$table['BUREAU'][$index], -1); oci_bind_by_name($stmt, ":sortant", &$table['SORTANT'][$index], -1); oci_bind_by_name($stmt, ":demande", &$table['DATE_DEMANDE'][$index], -1); oci_bind_by_name($stmt, ":statut", &$table['STATUT'][$index], -1); oci_execute($statement);
Dans ma table, il n'y a aucune valeur nulle.
Merci !