Changeset 1587:2c9c86274a23
- Timestamp:
- 02/20/10 14:27:38 (5 months ago)
- Branch:
- default
- Location:
- apps
- Files:
-
- 2 edited
-
las2oci.cpp (modified) (5 diffs)
-
oci_wrapper.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/las2oci.cpp
r1583 r1587 338 338 } 339 339 340 void GetOrdinates( OWStatement* statement, 341 OCIArray* sdo_ordinates, 342 double x0, double x1, 343 double y0, double y1, 344 double z0, double z1, 345 bool bUse3d) 346 { 347 348 statement->AddElement(sdo_ordinates, x0); 349 statement->AddElement(sdo_ordinates, y0); 350 if (bUse3d) 351 statement->AddElement(sdo_ordinates, z0); 352 353 statement->AddElement(sdo_ordinates, x1); 354 statement->AddElement(sdo_ordinates, y1); 355 if (bUse3d) 356 statement->AddElement(sdo_ordinates, z1); 357 358 359 } 340 360 bool InsertBlock(OWConnection* connection, 341 361 const LASQueryResult& result, … … 437 457 oss_geom.precision(precision); 438 458 439 oss_geom << " mdsys.sdo_geometry("<<s_gtype.str() <<", "<<s_srid.str()<<", null,\n" 459 // oss_geom << " mdsys.sdo_geometry("<<s_gtype.str() <<", "<<s_srid.str()<<", null,\n" 460 // " mdsys.sdo_elem_info_array"<< s_eleminfo.str() <<",\n" 461 // " mdsys.sdo_ordinate_array(\n"; 462 463 oss_geom << " mdsys.sdo_geometry(:5, :6, null,\n" 440 464 " mdsys.sdo_elem_info_array"<< s_eleminfo.str() <<",\n" 441 465 " mdsys.sdo_ordinate_array(\n"; 442 443 466 oss_geom << x0 << ",\n" << y0 << ",\n"; 444 467 … … 457 480 458 481 oss_geom << "))"; 482 oss << "INSERT INTO "<< tableName << 483 "(OBJ_ID, BLK_ID, NUM_POINTS, POINTS, BLK_EXTENT, " 484 "PCBLK_MIN_RES, PCBLK_MAX_RES, NUM_UNSORTED_POINTS, PT_SORT_DIM) " 485 "VALUES ( :1, :2, :3, :4, " << oss_geom.str() << //:7, :8)" 486 // << pc_id << "," << result.GetID() <<"," << num_points << ", " 487 // << oss_geom.str() <<", :1" 488 ", 1, 1, 0, 1)"; 489 490 459 491 // oss << "INSERT INTO "<< tableName << 460 492 // "(OBJ_ID, BLK_ID, NUM_POINTS, BLK_EXTENT, POINTS, " 461 493 // "PCBLK_MIN_RES, PCBLK_MAX_RES, NUM_UNSORTED_POINTS, PT_SORT_DIM) " 462 // "VALUES ( :1, :2, :3, :4, MDSYS.SDO_GEOMETRY(:5, :6, null, :7, :8)"494 // "VALUES ( :1, :2, :3, " << oss_geom.str() << 463 495 // // << pc_id << "," << result.GetID() <<"," << num_points << ", " 464 // // << oss_geom.str() <<", :1" 465 // ", 1, 1, 0, 1)"; 466 467 468 oss << "INSERT INTO "<< tableName << 469 "(OBJ_ID, BLK_ID, NUM_POINTS, BLK_EXTENT, POINTS, " 470 "PCBLK_MIN_RES, PCBLK_MAX_RES, NUM_UNSORTED_POINTS, PT_SORT_DIM) " 471 "VALUES ( :1, :2, :3, " << oss_geom.str() << 472 // << pc_id << "," << result.GetID() <<"," << num_points << ", " 473 474 ",:4, 1, 1, 0, 1)"; 496 // 497 // ",:4, 1, 1, 0, 1)"; 498 499 475 500 476 501 OWStatement* statement = 0; … … 492 517 493 518 // :1 494 statement->Bind( &pc_id );519 statement->Bind( p_pc_id ); 495 520 496 521 // :2 … … 512 537 int gtype = atoi(s_gtype.str().c_str()); 513 538 long* p_gtype = (long*) malloc (1 * sizeof(long)); 514 *p_gtype= gtype;539 p_gtype[0] = gtype; 515 540 516 541 printf("gtype: %d %d %s\n", *p_gtype, gtype, s_gtype.str().c_str()); 517 //statement->Bind(p_gtype);542 statement->Bind(p_gtype); 518 543 519 544 // :6 520 int* p_srid = (int*) malloc (1 * sizeof(int)); 521 *p_srid = srid; 522 // statement->Bind(p_srid); 545 546 long* p_srid = 0; 547 548 if (srid) { 549 p_srid = (long*) malloc (1 * sizeof(long)); 550 p_srid[0] = srid; 551 } 552 statement->Bind(p_srid); 523 553 524 554 // :7 525 555 526 556 OCIArray* sdo_elem_info=0; 557 // connection->CreateType(sdo_elem_info, connection->GetElemInfoType()); 558 // GetElements(statement, sdo_elem_info, bUseSolidGeometry); 559 560 // statement->Bind(sdo_elem_info, connection->GetElemInfoType()); 561 562 // :8 527 563 OCIArray* sdo_ordinates=0; 528 529 connection->CreateType(sdo_elem_info, connection->GetElemInfoType()); 530 connection->CreateType(sdo_ordinates, connection->GetOrdinateType()); 531 532 // GetElements(statement, sdo_elem_info, bUseSolidGeometry); 533 534 // statement->Bind(sdo_elem_info, connection->GetElemInfoType()); 535 536 // :8 537 // statement->Bind(ordinates); 564 // connection->CreateType(sdo_ordinates, connection->GetOrdinateType()); 565 566 // GetOrdinates(statement, sdo_ordinates, x0, x1, y0, y1, z0, z1, bUse3d); 567 // statement->Bind(sdo_ordinates, connection->GetOrdinateType()); 538 568 539 569 if (statement->Execute() == false) { -
apps/oci_wrapper.cpp
r1586 r1587 584 584 585 585 nNextCol++; 586 586 587 sb4 s = -1; 588 589 if (pnData != NULL) 590 s = (sb4)sizeof(long); 591 592 printf("Setting size to %d\n", s); 587 593 CheckError( OCIDefineByPos( hStmt, 588 594 &hDefine, … … 590 596 (ub4) nNextCol, 591 597 (dvoid*) pnData, 592 (sb4) s izeof(long),598 (sb4) s, 593 599 (ub2) SQLT_LNG, 594 600 (void*) NULL, … … 605 611 606 612 printf("Binding long column #: %d\n", nNextBnd); 613 614 sb4 s = 0; 615 616 if (pnData != NULL) 617 s = (sb4)sizeof(long int); 618 619 printf("Setting size to %d\n", s); 607 620 CheckError( OCIBindByPos( 608 621 hStmt, … … 611 624 (ub4) nNextBnd, 612 625 (dvoid*) pnData, 613 (sb4) s izeof(long),614 (ub2) SQLT_ NUM,626 (sb4) s, 627 (ub2) SQLT_INT, 615 628 (void*) NULL, 616 629 (ub2*) NULL,
Note: See TracChangeset
for help on using the changeset viewer.
