Sql problem with " ' "
can someone tell me how to be able to pass this word: boy'z into the sql query without it giving me a syntax error for the " ' " before z?
name=boy'z
String sql="update prod set name=" +"' " name"' ";
thanks alot
but im doing updating of table, not retrieveing the
records. so i dont have to use LIKE. am i
misintepreting your reply?The reply you are referring to is incomple.
You are using a SQL special character in data (not SQL.) Because of that you must do something special.
Your choices are.
1. Explicitly write code that correctly 'escapes' special characters which is specific to the database/driver that you are using. You must write this code yourself.
2. Use a prepared statement.
Similar Messages
-
In sql statements with JSP. Heres the deal:
Access database:
Tablename: EVENT
FieldName: event_id
DataType: Number
I want to compare the event_id to an integer variable called "var" in a WHERE clause in an SQL statement through a JSP.
String query = "SELECT * FROM EVENT WHERE EVENT.event_id = 'var' ";
It says "Data type mismatch in criteria expression."
Any Suggestions? I thought this should be straight forward! am i missing something?if i am reading correctly "var" is an int variable correct? If this is the case then the following will work;
String query = "SELECT * FROM EVENT WHERE EVENT.event_id = " + Interger.toString(var) ;
Hope that helps ( and i hope i read your problem correctly) -
PL/SQL :: Problem With Large Number Computation.
Greetings Experts,
I am relatively new to Oracle-DB. And I have a question regarding PL/SQL. I was trying to find the factorial of a number 100 as this is the most common programming problem for the beginners. But when I tried to execute the same, I was getting weird result(~) instead of actual value, i. e. 100!. I would highly appreciate if you experts can guide me in this regard. I have posted the program herewith for your reference.
SQL> DECLARE
2 X NUMBER := 100;
3 INDX NUMBER := 1;
4 BEGIN
5 INDX := X;
6 WHILE X > 1
7 LOOP
8 X := X - 1;
9 INDX := INDX * X;
10 END LOOP;
11 DBMS_OUTPUT.PUT_LINE('The Factorial of 100 is : '
12 || INDX || '.');
13 EXCEPTION
14 WHEN OTHERS THEN
15 RAISE_APPLICATION_ERROR(-20156,SUBSTR(SQLERRM,1,500));
16 END;
17 /
The Factorial of 100 is : ~.
PL/SQL procedure successfully completed.
TIA.
Hex.This is PL/SQL and works up to 1463:
SQL> CREATE OR REPLACE FUNCTION factorial(
2 pNumber IN NUMBER)
3 RETURN VARCHAR2
4 IS
5 f VARCHAR2(32767);
6
7 FUNCTION multiply(
8 pX IN VARCHAR2,
9 pY IN VARCHAR2)
10 RETURN VARCHAR2
11 IS
12 xManLength PLS_INTEGER;
13 yManLength PLS_INTEGER;
14 BEGIN
15 xManLength := LENGTH(RTRIM(pX, '0'));
16 yManLength := LENGTH(RTRIM(pY, '0'));
17 RETURN TO_CHAR(TO_NUMBER(SUBSTR(pX, 1, xManLength)) * TO_NUMBER(SUBSTR(pY, 1, yManLength)))
18 || RPAD('0', LENGTH(pX) - xManLength + LENGTH(pY) - yManLength, '0');
19 END multiply;
20 BEGIN
21 f := 1;
22
23 FOR n IN 1 .. pNumber LOOP
24 f := multiply(f, n);
25 END LOOP;
26
27 RETURN f;
28 END factorial;
29 /
Funktion wurde erstellt.
SQL>
SQL> SELECT 1463, factorial(1463) AS fact
2 FROM DUAL;
1463
FACT
1463
229804713272032214845417447319796313384000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000 -
PL/SQL problem with too many lines - can not apply changes
I have a complex PL/SQL that requires checking 90 check boxes and the query works to a certain point then it just stops being able to be saved (apply changes) after a high no. of lines has been typed in. (The PL/SQL query is to check against a file, that the file has all the check boxes as yes. If there is only 1 or 2 boxes checked, then the sql created only checks those 2 fields for yes.) Is there a way to increase the coding space (or number of lines) that APEX can save/use.
This is the whole PL/SQL coding. At this point, we cannot add any more lines or it will come up with "web page cannot be found" message.
declare
q varchar2(32767); -- query
new varchar2(1):='Y'; -- first one
begin
q := 'select a."CONTR_ID", a."NAME", b."PHONE_NO", b."EMAIL_ADDR" FROM contractor a, contacts b where a.contr_id = b.contr_id and a.contr_id not in (Select unique a."CONTR_ID" from contractor a, contractor_competency b where a."CONTR_ID" = b."CONTR_ID" ';
-------------------Start ENV
if :P33_AIR_QUALITY_TESTING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Air Quality Testing'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_ASBESTOS_REMOVAL_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Asbestos Removal De-Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_ASBESTOS_REMOVAL_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Asbestos Removal Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_BUILDING_ASBESTOS_REMOVAL = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Building Asbestos Removal'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_ENVIRONMENTAL_CONSULTING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Environmental Consulting'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_MANHOLE_ASBESTOS_REM_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Manhole Asbestos Removal De-Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_MANHOLE_ASBESTOS_REM_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Manhole Asbestos Removal Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_OIL_FILTERING = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Oil Filtering'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_OIL_SAMPLING = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Oil Sampling'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_OIL_SPILL_CLEANUP = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Oil Spill Cleanup'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_PUMPING_OUT_MANHOLES = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Pumping Out Manholes'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_SIGNED_ENVIRO_DOCS = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Signed Enviro Docs PRO-MS-008'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_TRANSPORTATION_OF_D_GOODS = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Transportation of Dangerous Goods'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_TRANSPORTATION_OF_PCB = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Transportation of PCB'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_WASTE_PICK_UP = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Waste Pick-Up'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
-------------------- start OCM
if :P33_GREENFIELD_POLELINE_CONST = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Greenfield Poleline Construction'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_HV_OVERHEAD_MAINTENANCE = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''HV Overhead Maintenance'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_INSULATOR_WARNING = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Insulator Warning'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_LV_OVERHEAD_MAINTENANCE = 'YES' then
if new = 'Y' then q := q || ' and (';
new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''LV Overhead Maintenance'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_OVERHEAD_INFRARED_SCAN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Overhead Infrared Scanning'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_POLEHOLES_AND_ANCHORS = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || ' (instr(upper(b."JOB"),upper(''Poleholes and Anchors'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_POLELINE_INSPECTION = 'YES' then
if new = 'Y' then q := q || ' and( '; new := 'N';
else
q := q || ' or '; end if;
q := q || ' (instr(upper(b."JOB"),upper(''Poleline Inspection'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_POLELINE_WORK_TO_35KV = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || ' (instr(upper(b."JOB"),upper(''Poleline Work to 35KV'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_POLELINE_TO_44KV = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || ' (instr(upper(b."JOB"),upper(''Poleline to 44KV'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_ROCK_DRILLING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Rock Drilling'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_TENSION_STRINGING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || ' (instr(upper(b."JOB"),upper(''Tension Stringing'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_TREE_TRIMMING_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Tree Trimming (De-Energized)'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_TREE_TRIMMING_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Tree Trimming (Energized)'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_WOOD_POLE_TESTING_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Wood Pole Testing De-Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_WOOD_POLE_TESTING_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Wood Pole Testing Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
------------------ start UCM
if :P33_CO2_CLEANING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''CO2 Cleaning'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_CABLE_PULLING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Cable Pulling'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_CABLE_TESTING_DEENERGIZED = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Cable Testing De-Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_CABLE_TESTING_ENERGIZED = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Cable Testing Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_CONC_DUCT_MAN_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Conc. Duct & Manhole (De-Energized)'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_CONC_DUCT_MAN_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Conc. Duct & Manhole (Energized)'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_DIR_BURIED_DUCT_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Direct Buried (De-Energized)'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_DIR_BURIED_DUCT_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Direct Buried (Energized)'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_DIRECTIONAL_BORING_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Directional Boring De-Energized'')) > 0) and
((instr(upper(b."SET_YES_NO"),''NO'') > 0) or
(instr(upper(b."CRAFTMAN_YES_NO"),''NO'') > 0) and
(instr(upper(b."PROBATION_YES_NO"),''NO'') > 0)) ';
end if;
if :P33_DIRECTIONAL_BORING_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Directional Boring Energized'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_GENERAL_EXCAVATION = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''General Excavation Around Plant'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_HV_UG_MAINTENANCE = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''HV Underground Maintenance'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_LV_UG_MAINTENANCE = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''LV Underground Maintenance'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_MANHOLE_CLEANING_DEEN = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Manhole Cleaning De-Energized'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_MANHOLE_CLEANING_ENER = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Manhole Cleaning Energized'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_MANHOLE_INSPECTION = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Manhole Inspection'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_UG_EQUIPMENT_INSPECTIONS = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''UG Equipment Inspections'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_UG_INFRA_RED_SCANNING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''UG Infra Red Scanning'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_UG_CABLE_LOCATES = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Underground Cable Locates'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
------------------------ start SCM
if :P33_FENCING_AROUND_SUBSTATION = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Fencing Around Substation'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_FENCING_GREENFIELD = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Fencing Greenfield'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_INSPECTION_AND_TESTING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Inspection And Testing'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_STATION_CIVIL_WORK = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Station Civil Work'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_STATION_CONST_DEENERGIZED = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Station Construction (De'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_STATION_CONST_ENERGIZED = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Station Construction (E'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_STATION_INFRARED_SCANNING = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Station Infrared Scanning'')) > 0) and
(instr(upper(b.”SET_YES_NO”),''NO'') > 0) ';
end if;
if :P33_STATIONS_ASBESTOS_REMOVAL = 'YES' then
if new = 'Y' then q := q || ' and ('; new := 'N';
else
q := q || ' or '; end if;
q := q || '(instr(upper(b."JOB"),upper(''Stations Asbestos Removal'')) > 0) and
(instr(upper(b."SET_YES_NO"),''NO'') > 0) ';
end if;
if new = 'N' then q := q || ' ) ';
end if;
q := q || ' ) ';
return q;
end; -
EXEC SQL , PROBLEM WITH SELECT
Hi.
I have a external database in which I do the next query...
Data: cod_campana TYPE integer,
departament TYPE STRING.
EXEC SQL.
connect to 'EX_PP' as 'ex_pp'
ENDEXEC.
EXEC SQL.
set connection 'ex_pp'
ENDEXEC.
cod_campana = 272
departament = 'BKK' "-> This data it's variable
EXEC SQL.
OPEN c1 FOR
SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
FROM pro_modelos a ,con_color b
WHERE a.cod_modelo = b.cod_modelo
AND a.cod_campana = b.cod_campana
AND a.cod_color = b.numero
AND a.brand = :departament
AND a.cod_campana = :cod_campana
END EXEC
I obtain a dump and the reason it's in the phrase --> AND a.brand = :departament
When I execute the same query and don't put the variable --> AND a.brand = 'BKK' like this the program run correctly... and I don't obtain dump...
EXEC SQL.
OPEN c1 FOR
SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
FROM pro_modelos a ,con_color b
WHERE a.cod_modelo = b.cod_modelo
AND a.cod_campana = b.cod_campana
AND a.cod_color = b.numero
AND a.brand = 'BKK'
AND a.cod_campana = :cod_campana
END EXEC
I don't know what it's the problem, and how I can solve it...,
Can you help me??
I try the next phrases and not obtain a good result:
AND a.brand like :departament
departament = '"BSK"'
and a.brand = :departament
Thks for your helpYou can put the code in TRY-ENDTRY block, and CATCH the exceptions.
If you are sure of the asignation to "department" (try to debug), you can make this:
OPEN c1 FOR
SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
FROM pro_modelos a ,con_color b
WHERE a.cod_modelo = b.cod_modelo
AND a.cod_campana = b.cod_campana
AND a.cod_color = b.numero
AND a.brand = :departament
Remove (AND a.cod_campana = :cod_campana).
Or
OPEN c1 FOR
SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
FROM pro_modelos a ,con_color b
WHERE a.cod_modelo = b.cod_modelo
AND a.cod_campana = b.cod_campana
AND a.cod_color = b.numero
AND ( a.brand = :departament )
AND a.cod_campana = :cod_campana
Remember to put department or DEPARMENT in case. -
Inserting JavA Class in sql,problems with import
hi i am trying to insert java class in the database
create or replace and compile java source named AppelCommande as
import client.AppelClient;
public class Run
* Creates a new instance of Run
public static String Run(String cmd) {
AppelClient AC = new AppelClient();
return AC.AppelCmd(cmd);
it gives me the following error
Class client.AppelClient not found in import.
i can compile this java code alone and i added client.jar in the classPath
so there must be some configuration in the database to make it work
thank you for your helpthx for the reply
i did try to load the classes in the database but i seem to have a problem somewhere
i am using webservices and there are too many libraries to add so i added the rt.jar in java and i am getting the following error
ORA-29545: badly formed class: User has attempted to load a class (java.math.MathContext) into a restricted package. Permission can be granted using dbms_java.grant_permission(<user>, LoadClassInPackage... -
Problem with item and/or data during page-processing-PS/SQL
Greetings!
On my page I have a custom report (from 2 tables) and a small form-field, that adds and edits data in the report. After generating the form with the wizard I added an extra item, to store the id from one of the tables from the report data.
Now, on submit a calculation should take place, that updates data according user input with a procedure in Page-Prosseses:
declare a number;
begin
case :PLATZ
when 1 then a:=100;
when 2 then a:= 50;
else a:=25;
end case;
update TBL_MITGLIEDER set TURNIERPUNKTE = TURNIERPUNKTE + a
where ID_MITGL = :P14_ID_MITGL;
end;
:PLATZ is user selected (1,2,3), :P14_ID_MITGL stores the reference to TBL_MITGLIEDER (and shows the change, when I select another record)
As I understand, that process should also run, when I submit a chance, but nothing happens then.
But when I try to save a new record (which worked without any problems before adding that process), I get this error message:
ORA-06550: line 1, column 64: PL/SQL: ORA-00957: duplicate column name ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
Error Unable to process row of table TBL_TURNIERSIEGER.
Then, when I go back into the app-builder and try to run the page again, I get this message:
ORA-01403: no data found
Error Unable to fetch row.
I am not sure, if you guys have all the information you need, to know whats going on. Maybe this has to do with session-id and the whay, items are updated. I hope you can help me.
Thanks, best regards,
tobiFirst can you please post all log file errors
>> I can't really give you a solution or specific recommendation since I did not saw this error yet myself, but on your own risk you can try:
1. You may try to just register 'dts.dll' using regsvr32.exe, but this error may indicate a bigger problem with setup.
If you are running SQL Server 64bit then try running this at the command prompt: %windir%\syswow64\regsvr32 "%ProgramFiles(x86)%\Microsoft SQL Server\90\dts\binn\dts.dll"
2. You can try reinstall from start (In this case you have to make sure that you un-install all)
[Personal Site] [Blog] [Facebook] -
Problem with provisioning and external SQL server connection
I am configuring IPAM 2012 R2 on a our management server. Completed the first step by enabling the feature. No issues.
Now I am on the Provisioning IPAM step. I get to the Configure Database step...
I choose Microsoft SQL server,
What should those values be in the Server name and Database name fields. Instructions show fqdn or ip address but that doesnt seem to be working for me.
I get the following error at the end of the Provisioning IPAM wizard,
IPAM Deployment failed with the following error.
Failed to connect to database server. Check the database name, connectivity and remote access.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
You can restart this provisioning wizard from the IPAM overview page.
From the management server I have tested the SQL Connection with a udl file. I used myServer\myInstance and it works. It reports that I have made the Connection to the server and database with the sql credentials i have provided.
ThanksRan
into a problem with connecting to the DB on the SQL server from the IPAM server. The Dba and I checked the target SQL instance was enabled TCP and listening on a valid TCP port. SQL server was set to use port 1443 for incoming connections.
IPAM was set by default to use 1433.
Also used
netstat-n to identify issue and verified 1443 on SQL server was
being used. Made the correction under the IPAM provisioning wizard and connected to the database. Fixed.
Important note I was able to connect to the database with a .udlfile
without any issues
Also note that 2012 R2 IPAM only supports 2012 SQL Enterprise. Why? -
Hi
I am using Flex to insert data through remoteobject and using
SAVE method generated from CFC Wizard.
My VO contains the following variables where id has a default
value of 0 :
public var id:Number = 0 ;
public var date:String = "";
public var accountno:String = "";
public var debit:Number = 0;
public var credit:Number = 0;
id is set as the primary key in my database.
I have previously used MySQL which automatically generates a
new id if I either omitted the id value in my insert statement or
use 0 as the default value.
However, now I am using MS SQL Server and the insert
generated this error:
Unable to invoke CFC - Error Executing Database Query.
Detail:
[Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert
explicit value for identity column in table 'Transactions' when
IDENTITY_INSERT is set to OFF.
Strange thing is that I dont see this problem with another
sample application. I compared with that application (it has the
same VO with default value of 0 for id) and everything looks
similar so I can't understand why I have this error in my
application.
This is SQL used to create the table:
USE [Transactions]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
CREATE TABLE [dbo].[Transactions](
[id] [int] IDENTITY(1,1) NOT NULL,
[date] [datetime] NULL,
[accountno] [varchar](100) NULL,
[debit] [int] NULL,
[credit] [int] NULL,
CONSTRAINT [PK_Transactions] PRIMARY KEY CLUSTERED
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE =
OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Has anyone encountered this problem before with insert
statements dealing with a unique id (with MS SQL Server)?Change "addRecords =
connection.prepareStatement("
to "addRecords =
connection.preparedStatement("
-BIGD -
Problem with Latches and Parallelising PL/SQL Cursors
In 9i i have process that do the following:
PROCEDURE LoadClients IS
CURSOR cChanges IS
SELECT ...
WHERE MOD(PK,pnTotalJobs>) = pnThisJob To call this I do the following
nTOTALJOBS CONSTANT := 2;
BEGIN
FOR i IN 1..nTOTALJOBS LOOP
DBMS_JOB.SUBMIT(LoadClient(pnTotalJobs=>nTOTALJOBS, pnThisJob=>i-1));
END LOOP;
COMMIT;So by changing the value of the constant - nTOTALJOBS - I can control the number of instances of LoadClient that run. This means I only need one procedure which can be called multiple times, making maintenance simpler than having multiple procedures.
This process has been running successfully on several procedures of over a year. However recently I have been having trouble with latches in memory. I think these are related to using the variables in the cursor and part of the oracle treating the different queries as being identical. This results in locks in memory and none of the jobs running. In most cases I'm setting nTOTALJOBS to 2. I'm looking into the further with my DBAs.
My questions are:
1. Has anyone come across this sort of problem before?
2. If so is there something I can do in my code or DB parameters to alleviate or test this?
Notes.
1. The process uses row by row processing in PL/SQL This done to get row by row error handling. I'm not going to change this in the short-term
2. The SQL does a call over a database link, I don't know if this has any effect.
3. This method does have a proven performance benefit
4. The code snippets above are just illustrative, I'm not asking for syntax corrections.
Thank you for taking the time to read through this.I would first investigate the "problem with latches" to be sure that it has anything to do with these jobs that you are submitting.
Your concern seems to be "because I am submitting multiple copies of the same PLSQL procedure to run concurrently, am I running into latching issues ?".
Take a step back and look at
a. MultiUser OLTP environments : At any time you can have more than a few users running the same SQL queries submitted through Forms / Client Frontends.
b. ERP Report Extractions (eg in Oracle EBusiness Suite or Peoplesoft) : At any time (say during the daily batch runs ?) you can have multiple copies of the same report (with different bind variables for different business_units / countries etc) running concurrently and extracting reports.
The question would be : How many concurrent executions of the same code is too much ?
I would say that latching issues come up on :
a. Shared Pool : Multiple sessions attempting to load SQL statements and Parse SQL statements
You could reduce some of this with reusable SQLs and bind variables instead of literals in quick running jobs / user front end screens etc
b. Buffer Cache : Hot Blocks being frequently pinned -- eg index root blocks or "busy" table blocks.
If you are running, say 4-8 concurrent copies of the the same code on a 4 CPU or 8 CPU machine, you may not be running into latching issues on the code -- "may not be" -- we can't be too sure, until we identify which latches are under "issue".
However, if the queries are executing nested loops and frequently accessing the same index blocks, you may more likely be having issues with latches on cache buffer chains.
So, this is what I would suggest :
a. Identify the size and scale of the "issues" -- how much CPU time / wait time is accounted for by the latches in relation to the total response time of each of the jobs
b. Identify which latches are the ones under contention
c. On the basis of which latches are the holding up performance, decide your next course of action.
Hemant K Chitale
http://hemantoracledba.blogspot.com -
Problem with java.sql.Clob and oracle.sql.CLOB
Hi,
I am using oracle9i and SAP web application server. I am getClob method and storing that in java.sql.Clob and using the getClass().getName() I am getting the class name as oracle.sql.CLOB. But when I am trying to cast this to oracle.sql.CLOB i am getting ClassCastException. The code is given below
java.sql.Clob lOracleClob = lResultSet.getClob(lColIndex + 1);
lPrintWriter = new PrintWriter(new BufferedWriter (((oracle.sql.CLOB) lOracleClob).getCharacterOutputStream()));
lResourceStatus = true;
can anybody please tell me the what is the problem with this and solution.
thanks,
Ashok.Hi Ashok
You can get a "ClassCastException" when the JVM doesn't have access to the specific class (in your case, "oracle.sql.CLOB").
Just check your classpath and see if you are referring to the correct jar files.
cheers
Sameer
PS: Please award points if you find the answer useful -
Problem with parameter and sql query
I've a problem with te query of my report. The query is:
SELECT [DESCRIPTN]
,[LOGTIME]
,[STATUS]
,[CARDNO]
,[LOGDATE]
FROM [Granta5P0].[dbo].[TIMELOG32]
where cardno in ({?cardNo})
the parameter as multiple values checked so I can query for more than one card.
If i put just one parameter everything works fine but when I put 2 or more I have his error
[http://www.megagaleria.com/pictures/Pic_10074_25.jpg]
I realized that the field as no ' delimiting the parameters, I have a function that already does it but I don't know how to put it in my sql command.
If anyone can help I appreciateYes, because your parameter is only looking for one card.
where cardno in ({?cardNo})
Will you only be creating querys on two cards or less ?
Are you trying to create an Array?
If two or less you could
where cardno = ({?cardNo}) or cardno = ({?cardNo2}) -
Problem with Exporter for MS Access 3.2 in SQL Developer
Hi,
I have problem with exporting tables and data from MS Access to XML with Exporter for MS Access 2000.
This error ocurr: 'Error #5 - XML Exporter'
When I use Exporter for MS Access 2002 this error ocurr: 'Error #3478 - XML Exporter'
Any leads how to solve this problem ?Thread moved to Forum Home » Database » SQL Developer
SQL Developer
Please, stay tune there.
Nicolas. -
I have problem with login in sql Server give me support .pre login handshake
I have problem with login in sql Server give me support .pre login handshake
The following threads are on the same topic:
http://www.sql-server-performance.com/forum/threads/pre-login-handshake-error-when-connecting-to-db.687/
http://stackoverflow.com/questions/12308340/sql-server-2000-connection-error-pre-login-handshake
http://dbaspot.com/sqlserver-server/458011-error-occurred-during-pre-login-handshake-microsoft-sql-server-error-10054-a.html
Kalman Toth Database & OLAP Architect
IPAD SELECT Query Video Tutorial 3.5 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
Hi All,
While i am trying to connect to sql server through an applet it is giving an error in the java console
Ie SQLException: Connection refused :connect
i also tried with standlone application it is working fine then would be the problem with applet
Here is my driver
Class.forName("com.inet.tds.TdsDriver").newInstance();
DriverManager.getConnection("jdbc:inetdae7:SERVER:1433?database=abc","gin","gin");
How can i resolve this issue.
Thx & Rgds
VinCheck the permissions for your applet. Anuntrusted
applet(which it is by default) is not allowed toopen
network connections. That might be the cause. Butthen
you should get a SecurityException and not a
Connection Failed exception. Couls you pleasedescribe
the exception that you are getting.
Cheers
JaySome times it is giving access denied i.e.
java.net.SocketPermission error in java console
Try giving full permissions to your applet. There is a
exe file in the bin dir of the jdk installation which
does that(I forgot the name)
Here is the exact error msg which is displaying in java console
SQLException:access denied(Java.net.SocketPermission 127.0.0.1:1433 connect)
-vin
Maybe you are looking for
-
How can I avoid an iPad appears in iTunes when I have multiple users in lion?
Hi, I have 2 users accounts in Lion, and in both I have iTunes always open. Also have 2 iPads. Both have the sync by wifi enable. One of the iPads, once was synchronized with the iTunes of one of the users accounts cable, and now want that only tries
-
Airplay no longer connecting to apple tv using MAC
Just last night my ipad and my iphone will not connect to my TV via airplay. Tried rebooting everything no luck. I was trying to watch my BBC global player. Any advice? Thanks.
-
Datasource Vs Infosource in BI 7.0
Hi, I have a question .... and we doesn't know answer it. In the new BI version, I suppose that only exist DataSource ( rsa1--datasource). The Infosource option is for the 3.X version( rsa1-infosurce ) Is it correct ? Thanks a lot
-
Hi, I am getting the following error while calling the webservice deployed in Weblogic 8.1sp5 version: Please help: SEVERE: caught throwable java.lang.AbstractMethodError: weblogic.webservice.core.soap.SOAPEnvelopeImpl.normalize()V at com.sun.xml.rpc
-
When typing Chinese characters, I set my language to Pinyin-simplified and when I type in a piyin word such as "hao" I see a bar that displays various character choices. I would like to make that bar larger. Any ideas?