How to return records from an MS SQL Database
I have created a small form in Adobe LiveCycle 9. I setup a new data connection to a database on my MS SQL server 2008. I can see my sql data fields under the data connection tab and bound them to my corresponding fields in my form. The form populates with information from the first record in my database.
I would like to create a field on my form where my users could enter in an account number and then my fields would populate from that record. Right now I can only see the record with account number 1.
Any help would be appreciated.
I am getting an error message that states the Connection for source DataConnection failed because the environment is not trusted. How can I fix this?
Thank you for your help!
Jon
Similar Messages
-
Import data from csv to SQL database
How to Import data from csv to SQL database through BLS-xMII?
Hi,
if you using Oracle, you may also use the bulk insert with MII. You can use the String List to XML parser to convert your CSV to XML, and then use a query that calls a stored procedure which does the bulk insert.
Also have a look at thread [read XML file into stored procedure|http://forums.sdn.sap.com/click.jspa?searchID=63850236&messageID=7455643].
Michael -
How to update Records from Internal table to u2018Zu2019 table?
Hi Friends,
How to update Records from Internal table to u2018Zu2019 table.
I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
( my internal table & u2018 Zu2019 table structures are same.)
Thanking you.
Regards,
SubashHi,
loop at internal table.
modify <Z- table > from values < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
endloop.
or
UPDATE <Z- table > from table < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
Prabhudas -
How to insert data from access to sql server ?
How to insert data from access to sql server ?
Please help me
thanksphamtrungkien wrote:
How to insert data from access to sql server by JAVA?The first four words of my last post:
masijade wrote:
JDBC with two connectionsGet a resultset from the jdbc-odbc bridge access connection, cycle through it and add batch insert commands to the jdbc connection to sql server. Give it a try and if the code has an error, then post your code ans ask a question.
The real question, though, is why you think it absolutely necessary to use Java for this. -
How can i record from radio to mp3 format?
How can i record from radio to mp3 format?
because i want to record a radio program, and save it, how can i do it?If you can, the instructions will be in the user manual - iPod Manuals
-
Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?
Now a days we are saving / extracting data in a excel spreadsheet, but we would like to do that using a database because it is better.You can use ODBC connection to work with SQL Server database.
Use SQLExec object to execute the SQL statement. Here is a KB about the SQL statement.
http://digital.ni.com/public.nsf/allkb/4ADEEA04CD24AE0B862565E20002A16F?OpenDocument
To write data to spreadsheet is more straightforward because Lookout has built-in spreadsheet object. But you need to write SQL statement by yourself to interact with other database.
To read the data back is the same way. Just use "select" SQL statement to query. You can use Datatable object to query.
The "Data Source" can be "DSN = data source name;". The data source name is configured in Control Panel->Administrative Tools->Data Sources(ODBC).
Ryan Shi
National Instruments -
Is it possible using SQLite to collect data from an older SQL database?
Is it possible using SQLite to collect data from an older SQL database? Where can I find a possible answer. Thanks in advance.
There are 3rd-party tools (see comprehensive list at http://www.kenhamady.com/bookmarks.html) that provide extra pdf functionality on top of the pdf export from Crystal.
In the case of my Visual CUT software, you can use hidden formulas inside your Crystal report to generate form fields (pre-populated as well as empty) as part of the pdf export process.
hth,
ido -
Return records from Stored Procedure to Callable Statement
Hi All,
I am createing a web application to display a students score card.
I have written a stored procedure in oracle that accepts the student roll number as input and returns a set of records as output containing the students scoring back to the JSP page where it has to be put into a table format.
how do i register the output type of "records" from the stored function in oracle in the "registerOutParameter" method of the "callable" statement in the JSP page.
if not by this way is there any method using which a "stored function/procedure" returning "record(s)" to the jsp page called using "callable" statement be retrieved to be used in the page. let me know any method other that writing a query for the database in the JSP page itself.I have a question for you:
If the stored procedure is doing nothing more than generating a set of results why are you even using one?
You could create a view or write a simple query like you mentioned.
If you're intent on going the stored procedure route, then I have a suggestion. Part of the JDBC 2.0 spec allows you to basically return an object from a CallableStatement. Its a little involved but can be done. An article that I ran across a while back really helped me to figure out how to do this. There URL to it is as follows:
http://www.fawcette.com/archives/premier/mgznarch/javapro/2000/03mar00/bs0003/bs0003.asp
Pay close attention to the last section of the article: Persistence of Structured Types.
Here's some important snippets of code:
String UDT_NAME = "SCHEMA_NAME.PRODUCT_TYPE_OBJ";
cstmt.setLong(1, value1);
cstmt.setLong(2, value2);
cstmt.setLong(3, value3);
// By updating the type map in the connection object
// the Driver will be able to convert the array being returned
// into an array of LikeProductsInfo[] objects.
java.util.Map map = cstmt.getConnection().getTypeMap();
map.put(UDT_NAME, ProductTypeObject.class);
super.cstmt.registerOutParameter(4, java.sql.Types.STRUCT, UDT_NAME);
* This is the class that is being mapped to the oracle object.
* There are two methods in the SQLData interface.
public class ProductTypeObject implements java.sql.SQLData, java.io.Serializable
* Implementation of method declared in the SQLData interface. This method
* is called by the JDBC driver when mapping the UDT, SCHEMA_NAME.Product_Type_Obj,
* to this class.
* The object being returned contains a slew of objects defined as tables,
* these are retrieved as java.sql.Array objects.
public void readSQL(SQLInput stream, String typeName) throws SQLException
String[] value1 = (String[])stream.readArray().getArray();
String[] value2 = (String[])stream.readArray().getArray();
public void writeSQL(SQLOutput stream) throws SQLException
}You'll also need to create Oracles Object. The specification for mine follows:
TYPE Detail_Type IS TABLE OF VARCHAR2(1024);
TYPE Product_Type_Obj AS OBJECT (
value1 Detail_Type,
value2 Detail_Type,
value3 Detail_Type,
value4 Detail_Type,
value5 Detail_Type,
value6 Detail_Type,
value7 Detail_Type,
value8 Detail_Type);Hope this helps,
Zac -
How to return rows from tmp table created inside function??
Hi,
I'm trying to return rows from a cursor or table (created within
the function). How do I specify the return type?Hi,
Here is the code that examples to create a function that can
return data from table.This is achieved using REFCURSOR concept.
Hope this helps you.I'm giving all stuff in single PL/SQL
block.You can break it and create a package and declare
refcursor type and function in that as well.
DECLARE
-- Declare generic cursor type
TYPE gencur_type IS REF CURSOR ;
-- Declare generic cursor varaible
gencur gencur_type;
-- Declare record type
TYPE rec_type IS RECORD(descr emp.ename%type) ;
-- Declare record type variable
rec rec_type;
--This how you declare a local function that returns gencrtype
data set
--This function is called in main block
FUNCTION call_refcur return gencur_type
AS
rr gencur_type;
BEGIN
OPEN rr FOR SELECT descr FROM emp;
RETURN rr;
END;-- end of local function
-- Main block begins here
BEGIN
-- Call the local function so that gencur will have
-- the data set returned by select statement
gencur:= call_refcur;
-- Open a loop to test the stuff
LOOP
FETCH gencur INTO rec;
EXIT WHEN gencur%NOTFOUND;
null;
dbms_output.put_line(rec.ename);
END LOOP;
END;
Regards,
Sridhar -
How to fetch records from the database into a combo box?
Hi:
I´m really new with ABLBPM and I´m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I´m using a dynamic method with this code:
<em>for each row in SELECT campo1, campo2 from TABLE</em>
<em>do</em>
<em>solicitudes[] = [row.campo1, row.campo2]</em>
<em>end</em>
<em>return solicitudes
</em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
Do you know another way to do it?
P.D. Sorry for my terrible english
GreetingsHi Steve,
Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
Motivo: 'java.lang.NullPointerException'.
at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
Any ideas??
Thanks and greetings -
How to count records from 2 tables and show in RDLC Report
hi all,
its being a one day searching for the solution but No Luck.
I have two SQL tables tblstudetail and tblfeereceiptdetail.
i just want to count records from both tables and show in RDLC report.
I tried SQl Query Like This:
select a.session, a.course,
Count(CASE a.ADstatus WHEN 'OK' THEN 1 ELSE 0 END ) AS Admission,
Count(CASE s .I_receiptstatus WHEN 'OK' THEN 1 ELSE 0 END) AS Feeprint
from
tblstudetail a
FULL join
tblfeereceiptdetail s on s.studentID = a.studentID
where a.session = '2015' AND s.Fsession = '2015' AND a.adcat = 'Regular'
GROUP BY a.session,a.course
ORDER by a.course
The result Show the Same Value in Both columns
Session Course Admission FeeDetail
2015 B.A. I 275 275
2015 B.A. II 307 307
2015 B.A. III 255 255
2015 B.Sc. I 110 110
2015 B.Sc. II 105 105
2015 B.Sc. III 64 64
Actully I want to Count How many ADMISSION have been Taken(FROM tblstudetail) and How many FEE RECEIPT have been Print (From tblfeereceiptdetail).
please guide me for this as soon as possible.
thanks in advance...I am counting 'OK' in both the table columns I.e 'ADstatus' in tblstudetail and 'feereceiptstatus' in tblfeereceiptdetail
please suggest me -
How to returning rowid from a dynamic
which gentleman can do me a favor, tell me how to get the rowid from a returning clause in a dynamic sql.
i use one clause as:
declare
v_rowid char(18);
begin
sql :='insert into test values('a') returning rowid into :rowid';
execute immediate sql using out v_rowid;
dbms_output.put_line(v_rowid);
end;
however, this clause always promte on
value error
i do not know what mistake i made.declare
v_rowid char(18);
v_sql varchar2(200);
begin
v_sql :='insert into test_Tab values(''a'') returning rowid into :1';
execute immediate v_sql using out v_rowid;
dbms_output.put_line(v_rowid);
end;
Not everyone on this board is a gentleman, some of us are ladies.
null -
How to show records from xml file
HI All
I have created one region its actually search region
which having 5 items and result table region
I want to search records based on that 5 items and want to show output in table
I have table name as hr_api_transactions which contains lot of columns
and that table also contain one column
name as TRANSACTION_DOCUMENT of type CLOB()
that columns xml files for each record
I want to extract data from that xml file and want to display.I have created one region on seeded page
in that region I have created one table for output
that region is search region
which having 5 items of textfield and 2 items of type submit button
GO and Clear
I want to search based on that 5 items
I want to display records in table that I have created on that region
I have one seeded table
that contain one column
that column contain xml file for each individual records
that xaml file contains values what I want to display
MY problems are
how can I extract data from xml file?
how can I show all values for each records on that table?
how can I search based on that 5 items?
now I am able to find out single value from that XML file
by using SQL command
select xmltype(transaction_document).extract('//IrcPostingContentsVlEORow/CreationDate/text()').getStringVal() CreationDate
from hr_api_transactions
where transaction_ref_table = 'PER_ALL_VACANCIES'
and transaction_ref_id = 4693;how can I extract more than one records from that XML file -
Some "formula" interpreter or returning value from unnamed PL/Sql blocks
Hello,
My company is developing Payroll and HR software and we use Oracle 10G Database. For a new module we are looking for a system were the end user (power user) can put in some kind of "formula's" to define what info/figures he wants for certain calculations done by de module (the budget module calculations will be done in PL/SQL stored proc written by us).
Example: item "MonthlySalaryCost" = (BaseYearSal + TotalBonus)/12
Where BaseYearSal and TotalBonus are functions that exist our will exist in or database. The idea is that a PL/SQL proc (which will be the same for all our customers), at runtime will execute that "formula" and use the result in its further calculations. The "formulas" will be stored in a table. (I foresee of course a "formula" validation to prevent dangerous sql-injection).
My idea was to use Execute Immediate in the proc to execute the formula's and work with the results. In this approach we have to write (and foresee) all possible functions to access the data the user wants to use.
Another (more powerful) solution I think about, is seeing these "formula's" as unnamed PL/SQL blocks (stored in a table), were the end user (or consultant) can use the full power of PL/SQL (if then else, select into ..., etc..) to obtain the result he wants to return into the item.
My problem here is : how to return a value from a unnamed PL/SQL block that is executed via Execute Immediate in a stored proc ?
And a general question: what do you think of this approach ? are there others possibilities to do this ?
Thanks in advance,
Philippe.Hi,
Welcome to the forum!
This is a simple example:
Some functions to test:
CREATE OR REPLACE FUNCTION f_test1 RETURN NUMBER IS
RESULT NUMBER;
BEGIN
RESULT := 12;
RETURN(RESULT);
END f_test1;
CREATE OR REPLACE FUNCTION f_test2 RETURN NUMBER IS
RESULT NUMBER;
BEGIN
RESULT := 10;
RETURN(RESULT);
END f_test2;
CREATE OR REPLACE PACKAGE pack_test_functions IS
PROCEDURE proc_test;
END pack_test_functions;
CREATE OR REPLACE PACKAGE BODY pack_test_functions IS
PROCEDURE proc_test IS
v_sql VARCHAR2(4000);
v_result NUMBER;
BEGIN
v_sql := 'SELECT F_TEST1() + F_TEST2() FROM DUAL';
EXECUTE IMMEDIATE v_sql
INTO v_result;
dbms_output.put_line(v_result);
END proc_test;
END pack_test_functions;
/into v_result you have the result of the operation.
Regards, -
How to view record from java source table
hi,
i had created a table as
CREATE JAVA SOURCE NAMED "Hello" AS
public class Hello {
public static String hello() {
return "Hello World"; } };
also it compiled but i dont've idea to view the record from it
can u help mePlease check the following script --
create or replace and resolve java source named "Hello"
as
import java.io.*;
import java.sql.*;
import java.math.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
public class Hello extends Object
public static String Display()
throws IOException
return "Hello World";
create or replace procedure Hello(v_str out varchar2)
is
language java
name 'Hello.Display(java.lang.String) return String';
create or replace procedure HDisplay
is
x varchar2(400);
begin
Hello(x);
dbms_output.put_line('String is: '||x);
end;And, from sql prompt --
exec HDisplay;N.B.: Not Tested...
Regards.
Satyaki De.
Message was edited by:
Satyaki_De
Maybe you are looking for
-
I purchased a song, and it won't play. How do I fix it?
How do I go about getting a song I payed for to actually play????? I use the same computer or phone to make my purchases, and this has never happened, every other song I downloaded the same night dowloaded correctly, but this one I guess didn't. How
-
Pointing to an object in a picture
Hi there. I would like to draw an arrow between a word below a jpeg and an object in the jpeg. Every time I create an arrow it moves the jpeg out of the way. For example, if I have a family photo and I want to draw an arrow to single out one member i
-
Hi, I have a requirement where for a G/L, i have to match the total for my report. I will be taking all open items from the G/L and it should match with my report output. But it is not matching. The problem is in G/L account from FBL3N some accounts
-
Edit Quiz Format - Button Location
In Connect 6, how do you easily edit quiz questions without messing up the functionality of the buttons? When multiple choice answers extend more than one line, the buttons do not line up properly next to the item. This makes it difficult for users t
-
Help! my 2007 Macbook Pro just quit and will not reboot. What should I do?
The white screen, Apple logo, and spinning circle is as far as it will go.