How create a view from a SQL string in a Stored Procedure?
Posted in 1998
Topics: SQL Development & Query Writing, Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET
Hi.
Please help me!
I am the only one at the office that not is on vacation.
I don't know anything about Informix and Stored procedures, but i must
create a view in the database
that displays data from several tables in order to get a proper ground for
statistics in Excel (which i am good at).
My SQL string that produces my data is:
SELECT supercustomer.errandid, supercustomer.createdby,
supercustomer.datecreate, supercustomer.datefinish, descisionlog.code,customer.segment, creditdescision.typeof, credit.wantedcredit, credit.credit
FROM (((credit INNER JOIN creditdescision ON credit.errandid =
creditdescision.errandid) INNER JOIN customer ON credit.errandid =
customer.errandid) INNER JOIN descisionlog ON credit.errandid =
descisionlog.errandid) INNER JOIN supercustomer ON descisionlog.errandid =
supercustomer.errandid;
When i run this in Access i get my table properly but now i want it via ODBC
to Excel and i want to call a view instead of this complex string (it hangs
my computer).
My call from Excel is:
iChannel = SQLOpen(DSN=TEST)
sSQL = "SELECT * FROM MY_NEW_VIEW"
SQLExecQuery iChannel; sSQL
SQLRetrieve iChannel; My_Destination_In_Excel
I have access to the database via Telnet and wants to know how to create
MY_NEW_VIEW from there.
Thanks! /Ove