Define a line in sql using geotype
Hi,
I have a table which contains lines (segments from roads) that should be displayed on Google Map, and I want to present this lines as lines using geotypes like GeoVal or GeoRef.
Can anybody help me please?
Thanks
Can you post table/index DDL and sample data?
Related thread:
http://social.msdn.microsoft.com/forums/sqlserver/en-US/9d2af509-2fd6-4daf-b3df-632c92a3b2e8/how-to-create-a-line-in-a-spatial-type-geometry-or-geography
Kalman Toth Database & OLAP Architect
T-SQL Scripts at sqlusa.com
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012
Similar Messages
-
How can a type defined in a PL/SQL package be used by an object?
How can a type defined in a PL/SQL package be used by an object?
In the PL/SQL Reference manual it says that object attributes can be
types defined inside a PL/SQL package: How do you make this work?
Here is a sample that demonstrates what I am trying to do:
CREATE OR REPLACE
PACKAGE Phone IS
TYPE Phone_rectype IS RECORD (
Main VARCHAR2(12),
Home VARCHAR2(12),
Business VARCHAR2(12),
Mobile VARCHAR2(12),
Fax VARCHAR2(12),
Pager VARCHAR2(12)
END Phone;
CREATE OR REPLACE
TYPE customer_type
AS OBJECT (
CustNo NUMBER,
CustName VARCHAR2(30),
PhoneNumber Phone.Phone_rectype
This is the error that i get:
Warning: Type created with compilation errors.
Errors for TYPE CUSTOMER_TYPE:
LINE/COL ERROR
0/0 PL/SQL: Compilation unit analysis terminated
5/15 PLS-00201: identifier 'PHONE.PHONE_RECTYPE' must be declared
nullThat's a good point, Justin - thanks for the advice. At the moment, our process of data validation isn't very well defined, so the table definitions aren't always the same beyond a core set. As we get more automated and able to develop table definitions flexible enough to accomodate all the quirks in client data, I may be able to consider moving to a single schema to take advantage of maintenance and performance improvements. My ultimate concern with doing that is that the datasets we're dealing with can be tens of millions of rows in size. Clearly, I'm no DBA, but I just assumed that we would be able to churn through these datasets faster if they were in a schema by themselves rather than lumped together into one huge half-a-billion row table?
-
PL/SQL Using SQL%NOTFOUND to raise a user defined exception in a function
I have written the following function for finding the number of items in stock in the item table.
CREATE OR REPLACE function getAmount (ItemID IN NUMBER)
RETURN NUMBER
AS
invalid_id EXCEPTION;
returnedQty number;
BEGIN
Select qty
Into returnedQty
From item
Where itemNo = ItemID;
RETURN (returnedQty);
IF SQL%NOTFOUND THEN
RAISE invalid_id;
END IF;
COMMIT;
Exception
WHEN invalid_id THEN
DBMS_OUTPUT.PUT_LINE('Invalid ID entered');
END getAmount;
The function compiles successfully, although there is a problem that Oracle is not handling my user-defined exception invalid_id
If I use the following for a valid itemID:
DECLARE
return_value number;
BEGIN
return_value := getAmount(1);
DBMS_OUTPUT.PUT_LINE (return_value);
END;
then the function returns the quantity of items in stock correctly.
However, if I enter an incorrect itemID, say 20
DECLARE
return_value number;
BEGIN
return_value := getAmount(20);
DBMS_OUTPUT.PUT_LINE (return_value);
END;
The invalid_id exception is not raised, and the Oracle errors says: no_data_found and the function has not returned a value. If I add a no_data_found exception, this works perfectly, but for this assignment I must write my own user-defined error.
Any help would be very much appreciated!
Thank you.What you're trying to do, is to use an implicit cursor. Implicit cursors will raise no_data_found and too_many_rows in case of an error. Explicit cursors will not.
Also, you have a small coding error ... a little rewrite and your code will do as you want to:
CREATE OR REPLACE function getAmount (ItemID IN NUMBER)
RETURN NUMBER
AS
invalid_id EXCEPTION;
returnedQty number;
cursor citem is
Select qty
From item
Where itemNo = ItemID;
fnd boolean;
BEGIN
open citem;
fetch citem Into returnedQty;
fnd := citem%found;
close citem;
if fnd then
RETURN (returnedQty);
else
RAISE invalid_id;
END IF;
/* Do not catch your own exception or the calling code will not receive it.
Exception
WHEN invalid_id THEN
DBMS_OUTPUT.PUT_LINE('Invalid ID entered');
END getAmount;
Your problem is, you're not using a package. This means, that the calling code has no way of catching this user-defined exeption. The correct way is to define a package, define the userdefined exception in the package and refer to it in your code:
create or replace package amt
is
invalid_id EXCEPTION;
function getAmount (ItemID IN NUMBER)
RETURN NUMBER;
end;
create or replace package body amt
is
function getAmount (ItemID IN NUMBER)
RETURN NUMBER
AS
returnedQty number;
cursor citem is
Select qty
From item
Where itemNo = ItemID;
fnd boolean;
BEGIN
open citem;
fetch citem Into returnedQty;
fnd := citem%found;
close citem;
if fnd then
RETURN (returnedQty);
else
RAISE invalid_id;
END IF;
end;
end; -- end package
To do a simple test, you'll do:
declare
a number;
begin
a := amt.getAmount(123);
dbms_output.put_line('The result is '||a);
exception
when amt.invalid_id then
dbms_output.put_line('ID not found');
end;
Other ways is to raise the exception in your no_data_found block.
But I'm REALLY puzzled if there's really someone out there who prefers a user-defined exception instead of the clearly defined NO_DATA_FOUND exception.
I can't be sure of course, but are you sure what they mean is they don't want ANY exception? That's a pretty common requirement.
In general - explicit cursors are a bit faster because Oracle does not have to do a second fetch to determine TOO_MANY_ROWS. And it's not too much additional writing. Explicit cursors will never raise exceptions - unless you use dynamic sql and your SQL is invalid.
Good luck -
Can i use the char (defined as line iteam dim) in Aggregates
Hi
I am maintaining aggregates on cube. can i use char which is defined as line iteam dimenstion.if i use how will be the effect.
thanks
ShalinyHi,
of course you can use it!
The behaviour is the same than with the other characteristics: you will have as many records as DISTINCT ocurrences of the combination of all CHARS you have included in your aggregate.
I suggest to first create your aggregate with a fixed value on another characteristic so you can have a feeling about how many records it will have and how long it will take to create it.
In general if you have flagged your char in a line itm DIM it means that this CHAR has very high cardinality (nearly the same number of records than the fact table itself) therefore it wouldn't make sense to include it in a ggregate except if your filter it for particluar fixed value.
The only difference you have with this line itm DIM is that there is no DIM table as such; the chars is accessed firectly from the cube fact(s) table. This will be the same for your aggregate (no aggr dim table created, access form your aggr fact(s) tables).
hoping this help...
Olivier. -
Syntax error when creating a user-defined table type in SQL Server 2012
Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
CREATE TYPE ReportsTableType AS TABLE
( reportId INT
, questionId INT
, questionOrder INT );
Results:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS'.Hope these posts could help,
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
Regards, Dineshkumar,
Please Mark as Answer if my post answers your question and
Vote as Helpful if it helps you -
GL display for inventory account which are not defined as line item display
Hi All,
We have inventory gl accounts which are auto post accounts , these accounts get posted when grn is done. these accounts are not defined as line item display accounts, but if we execute the T code: FS10 we get the gl balance display and not line item display.
Our requirement is that we should be able to view the line item display matching the GL account balance in that GL account.
Can we get the report in MM module line items wise display.
Regards
Prashant P. ZingeHello,
You should use RFSEPA01 program via execute SE38 transaction.
This program activate line item for each account. Activation means, this program generate line items to BSIS table. So that after this program running, you can see line items in FBL3N.
Regards,
Burak -
Can we define a trriger with sql to GML automaticly ?
hello,
i just need to know if we can define a trriger with sql to GML ?
thanks,
best regards ,
lama
Edited by: user11255382 on 25 juin 2009 12:18Yes, a trigger can be written to convert sdo_geometry to GML using SDO_UTIL.TO_GMLGEOMETRY.
-
How to define our line size in module pool?
Dear Friends,
I have requirment to increse the length or size of a list which is calling itself from a module pool using leave list processing.
Please suggest me the way?
Regards
RickyIt is very much same like report programming.
Report z****** Message-id 38 Line-Size 190 Line-Count 0 No Standard Page Heading.
use this report command on top of page to define the line size. -
Report To Show SQL Used In A Report
I am creating a set of quality reports using the apex views.
I would like to create a report to check the sql used in classic reports, but can't seem to find the right view to use.
If it was a interactive report I would use the SQL_QUERY column in the APEX_APPLICATION_PAGE_IR view, but this does not seem to exist for classic reports
Help appreciated.
GusGus C wrote:
I am creating a set of quality reports using the apex views.
I would like to create a report to check the sql used in classic reports, but can't seem to find the right view to use.
If it was a interactive report I would use the SQL_QUERY column in the APEX_APPLICATION_PAGE_IR view, but this does not seem to exist for classic reports
You can use the Data dictionary view APEX_APPLICATION_PAGE_REGIONS. There's a field called "REGION_SOURCE" - just filter for the appropriate region type.
Help appreciated.Really? What about Re: Validate Date and Time? If you want to show genuine appreciation for help given, why not award "correct/helpful" points to posts which helped you solve your problem, as per the forum introduction post:
>
* It is considered good etiquette to reward answers with points (as "helpful" - 5 pts - or "correct" - 10pts).
>
Having a brief look through your list of recently answered questions, you don't seem to award helpful points, even when you've explicitly saying (paraphrasing) "Thanks for your help". Maybe it's a tipping thing - perhaps you subscribe to the doctrine of Mr. Pink but, hey if it helps you get your question answered and it literally costs you nothing but a few seconds of effort, why not throw us a bone by awarding a point now and then? -
Run a report in PL/SQL using utl_http.request
Hi
I need to run a report in PL/SQL using utl_http.request
How that can be done ??
Thank you!Okay, backtrack.
A web server can deliver all kinds of content. From static HTML pages, to XML files and videos and dynamic content. Including reports.
The communication language (protocol) used to talk to a web server is HTTP.
UTL_HTTP is an Oracle PL/SQL library that implements the client side of this communication. It allows the developer to write code that acts like a web browser and communicates with a web server.
Now what do you not understand and cannot use?
HTTP is not simple and easy. You need to understand the basics of this communication language in order to communicate successfully with the web server. Like knowing the difference between GET and PUT and POST commands, how the URL query string works and so on.
Once you know that, you can look at how the web server provides reports. How do you authenticate as a web browser with the web reporting system? What URLs do you use to access which reports? How do you pass name-values to the web server as report parameters? What HTTP response formats (MIME types) does the web report server provide? Which one do you plan to use and how do you parse that response into a meaning structured data format?
If you're thinking it is "easy", think again. Sure, someone here can provide sample code that for example grabs a CSV report file from a web server and (using a pipeline table function), turn that into rows and columns. But that will not teach you the fundamentals you need to know and not equip you with dealing with the problem with your own brains, hands and keyboard.
PS. In other words, learn to crawl and walk before trying to run. Get to grips with how HTTP works before diving into the deep end of web report integration. -
How to create a muli line text area using JavaFx
Hi all,
Since the preview SDK does not contain TextArea any more, I am wondering how to create a muli line text area using JavaFX. The behaviour of this text area/field should be somehow similar to JTextArea in Swing or StyledTextWidget in SWT.
Does JavaFX have any support for this? What would be a sensible approach to create such a widget?
Thanks for your suggestions,
br michaelThis is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
Here's a simple example:
Group {
content: [
TextBox {
text: "This is a multi-line textbox"
lines: 10 // <-- this may/may not be necessary depending on your situation. Default is 5.
multiline: true
}Edited by: loeschg on Jul 29, 2010 2:59 PM -
I plan on buying a new I Pad wit wifi and cell from Apple. But I don't want to select a cell carrier right now. Q 1: Do I have to select a carrier at purchase? and Q 2, In the meantime will I be able to get on line at home using my Cox Internet wi fi? Thanks.
Thanks for the help. Now I can feel comfortable in not having to sign up for cellular when I buy, esp. Since I'll be using my new IPad mostly at home on my Cox wi fi. Then I can see, in using the i pad, how often I'd actually use the cellular, and where. This can help decide which type of cell plan I get. Small problem it may seem, but a very helpful answer. Thanks.
-
How to define variables in toad sql script editor - newbie
I have just pull out the script of a Function and want to run it on toad SQL editor.
I am little bit confused how to define the VARIABLEs here in toad SQL editor to run my script.
SELECT
NVL(SUM(debit), 0) - NVL(SUM(credit), 0)
INTO l_accountBalance
FROM
GLP_VoucherMaster vm
INNER JOIN GLP_VoucherDetail vd ON vm.GLP_VoucherMaster_ID = vd.GLP_VoucherMaster_ID
INNER JOIN GLP_ChartOFAccounts coa ON vd.GLP_ChartOfAccounts_ID = coa.GLP_ChartOfAccounts_ID
WHERE
vm.isActive = 'Y' AND vd.isActive = 'Y'
-- *** how to define variables in toad sql script editor ***
AND vm.voucherDate < p_cDate
AND coa.AccountCode LIKE p_accountCode || '%';
Thanks
w\Just prefix with a colon (:)
SELECT NVL (SUM (Debit), 0) - NVL (SUM (Credit), 0)
INTO L_accountbalance
FROM Glp_vouchermaster Vm
INNER JOIN
Glp_voucherdetail Vd
ON Vm.Glp_vouchermaster_id = Vd.Glp_vouchermaster_id
INNER JOIN
Glp_chartofaccounts Coa
ON Vd.Glp_chartofaccounts_id = Coa.Glp_chartofaccounts_id
WHERE Vm.Isactive = 'Y'
AND Vd.Isactive = 'Y'
AND Vm.Voucherdate < :P_cdate
AND Coa.Accountcode LIKE :P_accountcode || '%';
/:p -
Error while calling .svc web service from pl/sql using utl_dbws
Hello Folks,
I am calling a .svc web service from pl/sql using utl_dbws and encountering the following error
javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
Can you help me find what am I doing wrong?
Thanks
RkHi,
Here are the details
1. What version?
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
2. What error message ... we need the full and complete error stack not your interpretation of it.
ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Messag
3. "I am calling means what?" We need the full and complete statement showing the values of all parameters.
The input to the web-service is a xmltype containing address information and the web-service returns a string
CREATE OR REPLACE FUNCTION get_id
RETURN VARCHAR2
AS
l_service UTL_DBWS.service;
l_call UTL_DBWS.CALL;
l_wsdl_url VARCHAR2 (32767);
l_namespace VARCHAR2 (32767);
l_service_qname UTL_DBWS.qname;
l_port_qname UTL_DBWS.qname;
l_operation_qname UTL_DBWS.qname;
l_xmltype_in SYS.XMLTYPE;
l_xmltype_out SYS.XMLTYPE;
l_return VARCHAR2 (32767);
BEGIN
l_wsdl_url := 'http://test.com/test.svc?wsdl';
l_namespace := 'http://test.org/';
l_service_qname := UTL_DBWS.to_qname (l_namespace, 'SName');
l_port_qname := UTL_DBWS.to_qname (l_namespace, 'BasicHttpBinding_ISName');
l_operation_qname := UTL_DBWS.to_qname (l_namespace, 'Iden');
l_service :=
UTL_DBWS.create_service
(wsdl_document_location => urifactory.geturi
(l_wsdl_url),
service_name => l_service_qname
l_call :=
UTL_DBWS.create_call (service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname
l_xmltype_in :=
SYS.XMLTYPE
('<IdenRequest xmlns:i="http://www.w3.org/XMLSchema-instance" xmlns="http://test.org/SNameIden.WCFService">
<address />
<zip>12345</zip>
<state>AA</state>
<street>W Test </street>
</address>
</IdenRequest>'
l_xmltype_out :=
UTL_DBWS.invoke (call_handle => l_call,
request => l_xmltype_in);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
l_return := l_xmltype_out.EXTRACT ('//Iden/text()').getstringval();
RETURN l_return;
END;
/ -
Hello,
i have question regarding PL/SQL using DECODE when i use following qurey in SQL plus it is working fine but when i try to run in tode it only display value of g.
everything else is blank........
so can u plz assist me on that .....
thanks in advance!!!!!!!!!!
SELECT
b.g,b.s,
COUNT(DECODE(a.u,'R',a.rep)) AS R,
COUNT(DECODE(a.u,'u',a.rep)) AS U,
COUNT(DECODE(a.u,'C',a.rep))AS C,
COUNT(DECODE(a.u,'I',a.rep)) AS I,
COUNT(DECODE(a.u,NULL,a.rep)) AS B
FROM AREA a, data b
WHERE a.rep = '454637'
AND a.rep = b.emp
GROUP BY b.g,b.sVery strange.
Find out if there are alterations to your SQL*PLUS envirionment. Warren mentioned user/database wierdness; the ALTER SCHEMA and other commands can affect privilges and what objects you can see. Sometimes these commands are buried in LOGIN.SQL and GLOGIN.SQL files (for SQL*PLUS), and more hard to find they can call files buried on a network somewhere.
Try the query without the DECODE() and see what's in the table without trying to modify the values in both envirionments.
Maybe you are looking for
-
FIMSynchronizationService restarting after a WMI call
Is there a way to prevent the FIM Synchronization service from auto-starting when it's queried by WMI? I'm working on an MA scheduling application. When I test stopping the service while remotely invoking the WMI MA execute method via my app, the s
-
Netboot and DHCP Issue - Setting up AST Diagnostic Gateway
Hi everyone, I recently set up a new Mac Mini as a stand-alone server for the Apple Service Toolkit Diagnostic Gateway. Here are the specs of the Mini, if needed by anyone: Mac OS X 10.6 Server (patched to 10.6.8) 2.66GHz Core 2 Duo 8 GB DDR3 RAM I h
-
After Mavericks upgrade, apps using iCloud hang
I had earlier posted in the iWork forum about issues using Pages etc after Mavericks upgrade https://discussions.apple.com/thread/5618268?tstart=90 However, the problem is more general. It seems that any app that uses iCloud to store data or docume
-
EDI documents transmitted via the Internet
Hi Experts , Scenario : EDI Documents via intenet <---> XI <-- > ECC In the above mentioned scenario how can we use Seeburger Adapter? . Does Seeberger EDI adapter has the capability of receiven messages from Internet? Is there any mapping available
-
How do I get passed the card/iTunes card part when I create an account?
How do I get passed the card/iTunes card part when I create an account?