Home » Developer & Programmer » Forms » connection string in form builder 6i to SYS user (form 6i /xp)  () 1 Vote
icon5.gif  connection string in form builder 6i to SYS user [message #586655] Sun, 09 June 2013 00:19 Go to next message
MAHOOR
Messages: 12
Registered: April 2008
Junior Member
hi dear,
first of all, i apologize for my bad English.
i want to create a form like a console with form builder 6i for databases monitoring.
i have to connect to more than 10 databases and monitoring them at same time.
my question is, how can i create connection string for each one in form builder?
after connect to per database i want to select some quires, for example :
"select STATUS from v$instance;"
--Attention: i don't want use db-link
regrades,
mahoor

[Updated on: Sun, 09 June 2013 00:20]

Report message to a moderator

Re: connection string in form builder 6i to SYS user [message #586664 is a reply to message #586655] Sun, 09 June 2013 04:29 Go to previous messageGo to next message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
You have no choice but to use a DB link. It can't be done in forms any other way.

Why don't you just use enterprise manager instead? It's actually designed for this purpose.
Re: connection string in form builder 6i to SYS user [message #586666 is a reply to message #586664] Sun, 09 June 2013 04:54 Go to previous message
MAHOOR
Messages: 12
Registered: April 2008
Junior Member
dear cookiemonster,
thanks for answer and your suggestion.Do you know about "exec_sql" package?
i think , it will solve my PB.
i trying that but i really don't know good knowledge for use it.
let me put my code:
declare
connection_id EXEC_SQL.CONNTYPE;
cursor_number EXEC_SQL.CursType;

ret PLS_INTEGER;
nRows PLS_INTEGER := 0;
sqlstr varchar2(500);
bIsConnected boolean;
BEGIN
break;

connection_id := EXEC_SQL.OPEN_CONNECTION('sys/sys@tt as sysdba');
bIsConnected := EXEC_SQL.IS_CONNECTED(connection_id);
--connection_id := EXEC_SQL.DEFAULT_CONNECTION;

cursor_number := EXEC_SQL.OPEN_CURSOR(connection_id);

sqlstr := 'select STATUS from v$instance';
EXEC_SQL.PARSE(connection_id, cursor_number, sqlstr, exec_sql.V7);




EXEC_SQL.DEFINE_COLUMN(connection_id, cursor_number, 1, :nd_status, 30);
ret := EXEC_SQL.EXECUTE(connection_id,cursor_number);


WHILE (EXEC_SQL.FETCH_ROWS(connection_id, cursor_number) > 0 ) LOOP
nRows := nRows + 1;
EXEC_SQL.COLUMN_VALUE(connection_id, cursor_number, 1, :nd_status);




END LOOP;
EXEC_SQL.CLOSE_CURSOR(connection_id,cursor_number);
EXEC_SQL.CLOSE_CONNECTION(connection_id);
EXCEPTION
WHEN EXEC_SQL.PACKAGE_ERROR THEN
message('ERROR (' ||
TO_CHAR(EXEC_SQL.LAST_ERROR_CODE(connection_id)) || '): ' ||EXEC_SQL.LAST_ERROR_MESG(connection_id));
IF EXEC_SQL.IS_CONNECTED(connection_id) THEN
IF EXEC_SQL.IS_OPEN(connection_id,cursor_number) THEN
EXEC_SQL.CLOSE_CURSOR(connection_id,cursor_number);
EXEC_SQL.CLOSE_CONNECTION(connection_id);
END IF;
EXEC_SQL.CLOSE_CONNECTION(connection_id);
end if;
END;
let me know what is your mind about that, and if you have some sample in this case share with me, please.
thank you again
regard,
mahoor
Previous Topic: how deal with primary key while using for loop in forms 6i
Next Topic: Create view from forms based on values selected in forms
Goto Forum:
  


Current Time: Tue Jul 02 20:59:48 CDT 2024